A New Approach for Class Cohesion Assessment: An Empirical Validation on Several Systems

L. Badri and M. Badri (Canada)

Keywords

OO Software Quality, Software Metrics, Cohesion, Criterion,Connected methods.

Abstract

Class cohesion refers to the degree of the relatedness of the members in a class. Several metrics have been proposed in the literature in order to measure class cohesion in object-oriented systems. They capture class cohesion in terms of connections among members within a class. The major existing class cohesion metrics are essentially based on instance variables usage criteria. We believe that it is a special and a restricted way of capturing class cohesion. We present, in this paper, a new approach for class cohesion assessment taking into account a new criterion, which focuses on interactions between class methods. We present also a new approach for determining the connected components of a class, which may be considered as a way for restructuring weakly cohesive classes. Our main goal in this work was to demonstrate the effectiveness of the introduced criterion and to validate our approach for class cohesion assessment. We developed a cohesion measurement tool for Java programs and performed a case study on several systems. The obtained results demonstrate that our new class cohesion metric captures several pairs of related methods, which are not captured by the existing cohesion metrics, particularly the ones supposed taking into account the interactions between methods.

Important Links:



Go Back