Quantifying Class Cohesion in Object‐Oriented Software Systems Using Hesitant Fuzzy Entropy for Improved Software Maintenance
ABSTRACT Class cohesion is an important design aspect in object‐oriented software systems, impacting their development and maintenance. Existing literature proposes various object‐oriented cohesion metrics, aiming to measure the relationship among class members. However, these metrics differ in their approaches to measuring cohesion through interactions between attributes and methods. Anomalies such as lack of discrimination and sensitivity pose fundamental problems in cohesion metrics. The objective is to address the limitations of existing metrics and provide a more effective measure to compute the class cohesion. This paper introduces a new approach, SCBHFE, based on hesitant fuzzy entropy, to measure class cohesion. This approach not only uses shared attributes but also unshared attributes and neighbors of the method to evaluate class cohesion. The proposed method involves establishing a fuzzy set that corresponds to the target class and assigns membership degrees to individual methods. The SCBHFE metric is designed to preserve the four important properties of class cohesion theory. We empirically validate SCBHFE through a multifaceted evaluation. First, on a benchmark of 20 diverse classes, SCBHFE achieves 100% discrimination accuracy, successfully differentiating all key cohesion cases where 22 existing metrics, including LCOM1, LCOM2, LCOM3, LCOM5, Coh, CC, SCOM, LSCC, and LCC‐fail. Subsequently, applying SCBHFE to three large Java open‐source systems (Tomcat, Ant, and JFreeChart) confirms its practical effectiveness, consistently identifying low‐cohesion classes with values as low as 0.03–0.13. Statistical validation via principal component analysis further shows that SCBHFE captures a unique dimension of cohesion not addressed by prior metrics. Finally, SCBHFE demonstrates strong utility in detecting god classes in GanttProject and Xerces, thereby providing a reliable indicator for refactoring.
Authors
- Maryam Hooshyar
- Jaber Karimpour (ORCID: https://orcid.org/0000-0001-6193-3240)
- Habib Izadkhah (ORCID: https://orcid.org/0000-0001-7595-8350)
Institutions
- University of Tabriz (IR)
Publication Details
- Journal
- Journal of Software Evolution and Process
- Published
- 2026-05-01
- DOI
- https://doi.org/10.1002/smr.70101
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00