loading...
 This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
2007 31st Annual International Computer Software and Applications Conference
Client based Object-Oriented Cohesion Metrics
Beijing, China
July 24-July 27
ISBN: 0-7695-2870-8
Sami Makela, University of Turku and TUCS, Finland
Ville Leppanen, University of Turku and TUCS, Finland

For code quality control, there exists tens of objectoriented (OO) metrics on class cohesion and coupling. This abundant variety indicates that designing feasible metrics to differentiate good object-oriented programs from bad ones is not an easy task. Even worse, in practice OO cohesion metrics have a minor role in code reviews. In this paper we argue the proposed cohesion metrics, based on internal usage of class members, yield misleading (bad) values for several reasons. We propose a totally different kind of cohesion metric based on external class usage.

Cohesion metrics typically define a bipartite usage graph between methods of a class and its variables. Providing different interpretations for methods, variables, usage relation, and calculation method have served as sources of variation. Classical interpretation is to measure internal usage of instance variables by the instance methods of a class to evaluate relatedness of the class properties. We argue that the relatedness also depends on the usage context, e.g. an application. Another problem is that objects often consist of property sets that are only slightly related internally, since an inheriting class often defines properties that are only slightly related to the inherited ones. Yet, the clients of such objects often make connections between the property sets by simultaneously advancing internally seemingly unrelated property sets.

We propose forming cohesion graphs between the clients of a class and its member variables. Our approach complements the internal cohesion view with external views based on the external usage of class properties. We provide results for three popular open-source projects indicating our external cohesion measure to give much more meaningful results.

Citation:
Sami Makela, Ville Leppanen, "Client based Object-Oriented Cohesion Metrics," compsac, vol. 2, pp.743-748, 2007 31st Annual International Computer Software and Applications Conference, 2007
Usage of this product signifies your acceptance of the Terms of Use.