Design level class cohesion metrics are based on the assumption that if all the methods of a class have access to similar parameter types, then they all process closely related information. A class with a large number of parameter types common in its methods is more cohesive than a class with less number of parameter types common in its methods. In this paper, we review the design level class cohesion metrics with a special focus on metrics which use similarity of parameter types of methods of a class as the basis of its cohesiveness. Basically three metrics fall in this category: Cohesion Among Methods of a Class (CAMC), Normalized Hamming Distance (NHD), and Scaled NHD (SNHD). Keeping in mind the anomalies in the definitions of the existing metrics, a variant of the existing metrics is introduced. It is named NHD Modified (NHDM). A major point of difference is that the NHD metric counts a disagreement only if class methods taken as pairs disagree on a parameter type that one method uses but the other method, in the pair, does not use. It ignores the case when both methods of a pair do not use a parameter type. NHD indirectly counts it as an agreement, but NHDM considers such a case as a disagreement. An automated metric collection tool is used to collect the metrics data from an open source Java based software program containing 884 classes. Metrics data is then subjected to statistical analysis. The NHDM metric shows the maximum amount of variation in data values in comparison to other metrics in the group. NHDM is strongly correlated with CAMC. Unlike the previous studies, no significant correlation is found in CAMC and NHD.
['Kuljit Kaur Chahal', 'Hardeep Singh']
An Investigation of Design Level Class Cohesion Metrics