Class cohesion is considered as one of most important object-oriented software attributes. Cohesion refers to the degree of relatedness between members in a class. High cohesion is a desirable property of classes. Several metrics have been proposed in literature in order to measure class cohesion in object-oriented systems. They capture class cohesion in terms of connections between members within a class. Most of these metrics have been experimented and widely discussed. They do not take into account some characteristics of classes as stated in several papers. We present, in this paper, an extention of the cohesion metric we proposed in a previous work. We introduce a new cohesion criterion based on common objects parameters. Our main goal in this work was: (1) to demonstrate, by analyzing many real systems that the introduced criterion is statistically significative and, (2) to validate our approach for class cohesion assessment by exploring empirically the relationship that may exist between our new cohesion metric and coupling. We developed a cohesion measurement tool for Java programs and performed an empirical study on several systems. The selected test systems vary in size and domain. The obtained results demonstrate that: (1) the new class cohesion metric captures several additional pairs of related methods and (2) there exists a significatice correlation between the new cohesion metric and coupling.
Note: Due to the typographical sophistication of this article, no HTML version is available. Please use the PDF version.
About the author
Linda Badri, Mourad Badri and Alioune Gueye: "Revisiting Class Cohesion: An empirical investigation on several systems", in Journal of Object Technology, vol. 7, no. 6, July-August 2007, pp. 55-75 http://www.jot.fm/issues/issue_2008_07/article1/