Classes are the fundamental concepts in the object-oriented paradigm. They are the basic units of object-oriented programs, and serve as the units of encapsulation, which promotes the modifiability and the reusability of them. In order to take full advantage of the desirable features provided by classes, such as data abstraction and encapsulation, classes should be designed to have good quality. Because object-oriented systems are developed by heavily reusing the existing classes, the classes of poor quality can be a serious obstacle to the development of systems. We define a new cohesion measure for assessing the quality of classes. Our approach is based on the observations on the salient natures of classes which have not been considered in the previous approaches. A Most Cohesive Component (MCC) is introduced as the most cohesive form of a class. We believe that the cohesion of a class depends on the connectivity of itself and its constituent components. We propose the connectivity factor to indicate the degree of the connectivity among the members of a class, and the structure factor to take into account the cohesiveness of its constituent components. Consequently, the cohesion of a class is defined as the product of the connectivity factor and the structure factor. This cohesion measure indicates how closely a class approaches MCC; the closely a class approaches MCC, the greater cohesion the class has.
[1]
Victor R. Basili,et al.
A Validation of Object-Oriented Design Metrics as Quality Indicators
,
1996,
IEEE Trans. Software Eng..
[2]
Sallie M. Henry,et al.
Object-oriented metrics that predict maintainability
,
1993,
J. Syst. Softw..
[3]
Alan Snyder,et al.
Encapsulation and inheritance in object-oriented programming languages
,
1986,
OOPLSA '86.
[4]
Sandro Morasca,et al.
Defining and validating high-level design metrics
,
1994
.
[5]
Heung Seok Chae,et al.
Assessing and restructuring of classes based on cohesion
,
1996,
Proceedings 1996 Asia-Pacific Software Engineering Conference.
[6]
Chris F. Kemerer,et al.
Towards a metrics suite for object oriented design
,
2017,
OOPSLA '91.
[7]
Chris F. Kemerer,et al.
A Metrics Suite for Object Oriented Design
,
2015,
IEEE Trans. Software Eng..