Measuring the Discriminative Power of Object-Oriented Class Cohesion Metrics

Several object-oriented cohesion metrics have been proposed in the literature. These metrics aim to measure the relationship between class members, namely, methods and attributes. Different metrics use different models to represent the connectivity pattern of cohesive interactions (CPCI) between class members. Most of these metrics are normalized to allow for easy comparison of the cohesion of different classes. However, in some cases, these metrics obtain the same cohesion values for different classes that have the same number of methods and attributes but different CPCIs. This leads to incorrectly considering the classes to be the same in terms of cohesion, even though their CPCIs clearly indicate that the degrees of cohesion are different. We refer to this as a lack of discrimination anomaly (LDA) problem. In this paper, we list and discuss cases in which the LDA problem exists, as expressed through the use of 16 cohesion metrics. In addition, we empirically study the frequent occurrence of the LDA problem when the considered metrics are applied to classes in five open source Java systems. Finally, we propose a metric and a simulation-based methodology to measure the discriminative power of cohesion metrics. The discrimination metric measures the probability that a cohesion metric will produce distinct cohesion values for classes with the same number of attributes and methods but different CPCIs. A highly discriminating cohesion metric is more desirable because it exhibits a lower chance of incorrectly considering classes to be cohesively equal when they have different CPCIs.

[1]  James M. Bieman,et al.  Measuring Functional Cohesion , 1994, IEEE Trans. Software Eng..

[2]  Jehad Al Dallal Software similarity-based functional cohesion metric , 2009, IET Softw..

[3]  S. Siegel,et al.  Nonparametric Statistics for the Behavioral Sciences , 2022, The SAGE Encyclopedia of Research Design.

[4]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[5]  James M. Bieman,et al.  Cohesion and reuse in an object-oriented system , 1995, SSR '95.

[6]  Doo-Hwan Bae,et al.  A cohesion measure for object‐oriented classes , 2000, Softw. Pract. Exp..

[7]  Mourad Badri,et al.  A Proposal of a New Class Cohesion Criterion: An Empirical Study , 2004, J. Object Technol..

[8]  Tibor Gyimóthy,et al.  Empirical validation of object-oriented metrics on open source software for fault prediction , 2005, IEEE Transactions on Software Engineering.

[9]  Shari Lawrence Pfleeger,et al.  Software Metrics : A Rigorous and Practical Approach , 1998 .

[10]  Chris F. Kemerer,et al.  Towards a metrics suite for object oriented design , 2017, OOPSLA '91.

[11]  Lionel C. Briand,et al.  Empirical Studies of Quality Models in Object-Oriented Systems , 2002, Adv. Comput..

[12]  Martin Hitz,et al.  Measuring coupling and cohesion in object-oriented systems , 1995 .

[13]  Yuming Zhou,et al.  DRC: a dependence relationships based cohesion measure for classes , 2003, Tenth Asia-Pacific Software Engineering Conference, 2003..

[14]  Letha H. Etzkorn,et al.  Clarifying specialized forms of association in UML and OML , 1998 .

[15]  Rudolf Ferenc,et al.  Using the Conceptual Cohesion of Classes for Fault Prediction in Object-Oriented Systems , 2008, IEEE Transactions on Software Engineering.

[16]  Jehad Al Dallal Mathematical Validation of Object-Oriented Class Cohesion Metrics , 2010 .

[17]  Lionel C. Briand,et al.  A Precise Method-Method Interaction-Based Cohesion Metric for Object-Oriented Classes , 2012, TSEM.

[18]  Sandro Morasca,et al.  Defining and Validating Measures for Object-Based High-Level Design , 1999, IEEE Trans. Software Eng..

[19]  Sallie M. Henry,et al.  Maintenance metrics for the object oriented paradigm , 1993, [1993] Proceedings First International Software Metrics Symposium.

[20]  Shari Lawrence Pfleeger,et al.  Towards a Framework for Software Measurement Validation , 1995, IEEE Trans. Software Eng..

[21]  Jehad Al Dallal A Design-Based Cohesion Metric for Object-Oriented Classes , 2012 .

[22]  Mohammad Alshayeb,et al.  An Empirical Validation of Object-Oriented Metrics in Two Different Iterative Software Processes , 2003, IEEE Trans. Software Eng..

[23]  Yuming Zhou,et al.  A novel approach to measuring class cohesion based on dependence analysis , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[24]  J. Hanley,et al.  The meaning and use of the area under a receiver operating characteristic (ROC) curve. , 1982, Radiology.

[25]  Jason Crampton,et al.  The interpretation and utility of three cohesion metrics for object-oriented design , 2006, TSEM.

[26]  Luis Fernández,et al.  A SENSITIVE METRIC OF CLASS COHESION , 2006 .

[27]  Letha H. Etzkorn,et al.  A Class Cohesion Metric For Object-Oriented Designs , 1999, J. Object Oriented Program..

[28]  K. K. Aggarwal,et al.  Investigating effect of Design Metrics on Fault Proneness in Object-Oriented Systems , 2007, J. Object Technol..

[29]  Challa Bonja,et al.  Metrics for class cohesion and similarity between methods , 2006, ACM-SE 44.

[30]  Yuming Zhou,et al.  DMC: a more precise cohesion measure for classes , 2005, Inf. Softw. Technol..

[31]  Lionel C. Briand,et al.  Replicated Case Studies for Investigating Quality Factors in Object-Oriented Designs , 2001, Empirical Software Engineering.

[32]  Heeae Ko,et al.  A Study on the Mobile Web Generating using Element of User Experience , 2007 .

[33]  Doo-Hwan Bae,et al.  Response to ‘Comments on: A cohesion measure for object‐oriented classes’ , 2001, Softw. Pract. Exp..

[34]  Yuming Zhou,et al.  Measuring class cohesion based on dependence analysis , 2008, Journal of Computer Science and Technology.

[35]  Lionel C. Briand,et al.  A Unified Framework for Cohesion Measurement in Object-Oriented Systems , 2004, Empirical Software Engineering.

[36]  Yuming Zhou,et al.  Comments on ‘A cohesion measure for object‐oriented classes’ by Heung Seok Chae, Yong Rae Kwon and Doo Hwan Bae (Softw. Pract. Exper. 2000; 30:1405–1431) , 2001, Softw. Pract. Exp..

[37]  Lionel C. Briand,et al.  An object-oriented high-level design-based class cohesion metric , 2010, Inf. Softw. Technol..

[38]  Brian Henderson-Sellers,et al.  Object-oriented metrics: measures of complexity , 1995 .