DMC: a more precise cohesion measure for classes
Jianmin Wang,Yuming Zhou,Lijie Wen,Yujian Chen,Hongmin Lu,Baowen Xu
DOI: https://doi.org/10.1016/j.infsof.2004.07.001
IF: 3.9
2005-01-01
Information and Software Technology
Abstract:In object-oriented systems, a single class consists of attributes and methods and its cohesion denotes the degree of relatedness among these elements. To quantify the cohesiveness of a class, a large number of measures that only depict method–attribute reference relationships have been proposed in last decade. However, the flow-dependence relationships among attributes, the direction of method–attribute references, and the potential dependence relationships among the elements in the class are ignored. To address this problem, this paper first depicts four types of explicit dependence relationships and uses a class element dependence graph to represent all dependencies among the elements in a class. Then, a dependence matrix that reflects the degree of direct dependence and indirect dependence among the elements in a class is computed. Finally, a more precise cohesion measure for classes is proposed.