Exploring Design Level Class Cohesion Metrics
- 1 Department of Computer Science and Engineering, Guru Nanak Dev University, Amritsar, India.
- 2 Department of Computer Science and Engineering, Guru Nanak Dev University, Amritsar, India.
Abstract
In object oriented paradigm, cohesion of a class refers to the degree to which members of the class are interrelated. Metrics have been defined to measure cohesiveness of a class both at design and source code levels. In comparison to source code level class cohesion metrics, only a few design level class cohesion metrics have been proposed. Design level class cohesion metrics are based on the assumption that if all the methods of a class have access to similar para-meter 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). An automated metric collection tool is used to collect the metric data from an open source software program. The metric data is then subjected to statistical analysis.
- P. Chidamber and C. Kemerer, “Towards a Metrics Suite for Object Oriented Design,” Proceedings of 6th ACM Conference on Object Oriented Programming, Systems, Languages and Applications, Phoenix, Arizona, 1991, pp. 197-211.
- L. Briand, J. Wust, J. Daly and D. Porter, “Exploring the Relationships between Design Measures and Software Quality in Object Oriented Systems,” Journal of Systems and Software, Vol. 51, No. 3, 2000, pp. 245-273.
- J. Bansiya and C. Davis, “A Hierarchical Model for Object Oriented Quality Assessment,” IEEE Transactions on Software Engineering, Vol. 28, No. 1, 2002, pp. 4-17.
- T. Gyimothy, R. Ferenc and I. Siket, “Empirical Validation of Object-Oriented Metrics on Open Source Software for Fault Prediction,” IEEE Transactions on Software Enineering, Vol. 31, No. 10, 2005, pp. 897-910.
- Z. Zhou and H. Leung, “Empirical Analysis of Object- Oriented Design Metrics for Predicting High and Low Severity Faults,” IEEE Transactions on Software Engi-neering, Vol. 32, No. 10, 2006, pp. 771-789.
- M. Marcus and D. Poshyvanyk, “Using the Conceptual Cohesion of Classes for Fault Prediction in Object-Orien- ted System,” IEEE Transactions on Software Engineering, Vol. 34, No. 2, 2008.
- J. Lee, S. Jung, S. Kim, W. Jang and D. Ham,“Component Identification Method with Coupling and Cohesion,” Proceedings of the Eighth Asia-Pacific Software Engineering Conference, December 2001, pp. 79-86.
- G. Gui and D. Scott, “Measuring Software Component Reusability by Coupling and Cohesion Metrics,” Journal of Computers, Vol. 4, No 9, Academy Publishers, 2009, pp. 797-805.
- J. Bansiya, L. Etzkorn, C. Davis and W. Li, “A Class Cohesion Metric for Object Oriented Designs,” Journal of Object Oriented Programming, Vol. 11, No. 8, 1999, pp. 47-52.
- S. Counsell, S. Swift and J. Crampton, “The Interpretation and Utility of Three Cohesion Metrics for Object- Oriented Design,” ACM Transactions on Software Engineering and Methodology, Vol. 15, No. 2, 2006, pp. 123-149.
- J. Dallal, “A Design-Based Cohesion Metric for Object- Oriented Classes,” Proceedings of the International Conference on Computer and Information Science and Engineering, 2007, pp. 301-306.
- W. Li and S. Henry, “Object-Oriented Metrics that Predict Maintainability,” Journal of Systems and Software, Vol. 23, No. 2, 1993, pp. 111-122.
- S. Chidamber and C. Kemerer, “A Metrics Suite for Object Oriented Design,” IEEE Transactions on Software Engineering, Vol. 20, 1994, pp. 476-493.