The International Arab Journal of Information Technology (IAJIT)

..............................
..............................
..............................


A New Metric for Class Cohesion for Object Oriented Software

Various class cohesion metrics exist in literature both at design level and source code level to assess the quality of Object Oriented (OO) software. However, the idea of cohesive interactions (or relationships) between instance variables (i.e., attributes) and methods of a class for measuring cohesion varies from one metric to another. Some authors have used instance variable usage by methods of the class to measure class cohesion while some focus on similarity of methods based on sharing of instance variables. However, researchers believe that such metrics still do not properly capture cohesiveness of classes. Therefore, measures based on different perspective on the idea of cohesive interactions should be developed. Consequently, in this paper, we propose a source code level class cohesion metric based on instance variable usage by methods. We first formalize three types of cohesive interactions and then categorize these cohesive interactions by providing them ranking and weights in order to compute our proposed measure. To determine the usefulness of the proposed measure, theoretical validation using a property based axiomatic framework has been done. For empirical validation, we have used Pearson correlation analysis and logistic regression in an experimental study conducted on 28 Java classes to determine the relationship between the proposed measure and maintenance-effort of classes. The results indicate that the proposed cohesion measure is strongly correlated with maintenance-effort and can serve as a good predictor of the same.


[1] Aggarwal K., Singh Y., Kaur A., and Malhotra R., “Investigating Effect of Design Metrics on Fault Proneness in Object-Oriented Systems,” Journal of Object Technology, vol. 6, no. 10, pp.127-141, 2007.

[2] Al-Dallal J. and Briand L., “A Precise Method- Method Interactionbased Cohesion Metric for Object-Oriented Classes,” ACM Transactions on Software Engineering and Methodology, vol. 21, no. 2, pp. 1-34, 2011.

[3] Al-Dallal J., “Object-Oriented Class Maintainability Prediction Using Internal Quality Attributes,” Information and Software Technology, vol. 55, no. 11, pp. 2028-2048, 2013.

[4] Aman H., Yamasaki K., Yamada H., and Noda M., “A Proposal of Class Cohesion Metrics Using Sizes of Cohesive Parts,” in Proceedings of 5th Joint Conference On Knowledge-Based Software Engineering, Rozman, pp. 102-107, 2002.

[5] Badri L. and Badri M., “A Proposal of A New Class Cohesion Criterion: An Empirical Study,” Journal of Object Technology, vol. 3, no. 4, pp. 145-159, 2004.

[6] Bandi R., Vaishnavi V., and Turk E., “Predicting Maintenance Performance Using Object- Oriented Design Complexity Metrics,” IEEE Transactions on Software Engineering, vol. 29, no. 1, pp. 77-87, 2003.

[7] Basili V. and Weiss D., “A Methodology for Collecting Valid Software Engineering Data,” IEEE Transactions on Software Engineering, vol. 10, no. 6, pp. 728-738, 1984. 420 The International Arab Journal of Information Technology, Vol. 17, No. 3, May 2020

[8] Bieman J. and Kang B., “Cohesion and Reuse in an Object-Oriented System,” in Proceedings of the Symposium on Software Reusability, Seattle, pp. 259-262, 1995.

[9] Bieman J. and Ott L., “Measuring Functional Cohesion,” IEEE Transactions on Software Engineering, vol. 20, no. 8, pp. 644-657, 1994.

[10] Bonja C. and Kidanmariam E., “Metrics for Class Cohesion and Similarity between Methods,” in Proceedings of the 44th Annual ACM Southeast Regional Conference, Melbourne, pp. 91-95, 2006.

[11] Briand L., El Emam K., and Morasca S., “Theoretical and Empirical Validation of Software Product Measures,” Technical Report ISERN-95-03, 1995.

[12] Briand L., Morasca S., and Basili V., “Property- Based Software Engineering Measurement,” IEEE Transactions on Software Engineering, vol. 22, no. 1, pp. 68-86, 1996.

[13] Briand L., Wüst J., Ikonomovski S., and Lounis H., “A Comprehensive Investigation of Quality Factors in Object-Oriented Designs: An Industrial Case Study,” Technical Report, ISERN, 98-29, 1998.

[14] Briand L., Bunse C., and Daly J., “A Controlled Experiment for Evaluating Quality Guidelines on The Maintainability of Object-Oriented Designs,” IEEE Transactions on Software Engineering, vol. 27, no.6, pp. 513-530, 2001.

[15] Chidamber S. and Kemerer C., “Towards a Metrics Suite for Object-Oriented Design,” in Proceedings of Object-Oriented Programming Systems, Languages and Applications, Phoenix Arizona, pp. 197-211, 1991.

[16] Chidamber S. and Kemerer C., “A Metrics Suite for Object Oriented Design,” IEEE Transactions on Software Engineering, vol. 20, no. 6, pp. 476- 493, 1994.

[17] Deligiannis I., Shepperd M., Roumeliotis M., and Stamelos I., “An Empirical Investigation of An Object-Oriented Design Heuristic for Maintainability,” Journal of Systems and Software, vol. 65, no. 2, pp.127-139, 2003.

[18] Fernandez L. and Pena R., “A Sensitive Metric of Class Cohesion,” International Journal of Information Theory and Applications, vol. 13, no.1, pp. 82-91, 2006.

[19] Gosain A. and Sharma G., “Object Oriented Dynamic Complexity Measures for Software Understandability,” Innovations in Systems and Software Engineering, vol. 13, no. 2-3, pp. 177- 190, 2017.

[20] Gosain A. and Sharma G., “Predicting Software Maintainability Using Object Oriented Dynamic Complexity Measures,” in Proceedings of International Conference on Smart Trends for Information Technology and Computer Communications, Jaipur, pp. 218-230, 2016.

[21] Gupta V. and Chhabra J., “Dynamic Cohesion Measures for Object-Oriented Software,” Journal of Systems Architecture, vol. 57, no. 4, pp. 452-462, 2011.

[22] Henderson-Sellers B., Object Oriented Metrics: Measures of Complexity, Prentice Hall Inc., 1996.

[23] Hitz M. and Montazeri B., “Measuring Coupling and Cohesion in Object Oriented Systems,” in Proceedings of International Symposium on Applied Corporate Computing, Monterrey, pp. 25-27, 1995.

[24] IEEE Std. 610.12-1990. Standard Glossary of Software Engineering Terminology, IEEE Computer Society Press, Los Alamitos, CA, 1993.

[25] Kabaili H., Keller R., and Lustman F., “Cohesion as Changeability Indicator In Object- Oriented Systems,” in Proceedings of 5th European Conference on Software Maintenance and Reengineering, Lisbon, pp. 39-46 2001.

[26] Kaur K. and Singh H., “An Investigation of Design Level Class Cohesion Metrics,” The International Arab Journal of Information Technology, vol. 9, no. 1, pp. 66-73, 2012.

[27] Kitchenham B., Pfleeger S., and Fenton N., “Towards A Framework for Software Measurement Validation,” IEEE Transaction on Software Engineering, vol. 21, no. 12, pp. 929- 944, 1995.

[28] Li W., and Henry S., “Object-Oriented Metrics that Predict Maintainability,” Journal of Systems and Software, vol. 23, no. 2, pp. 111-122, 1993.

[29] Liang, Y., Introduction to Java Programming, Prentice Hall Inc, 2014.

[30] Naughton P., and Schildt H., Java 2: The Complete Reference, McGraw-Hill, 1999.

[31] Kitchenhem B., Pfleeger S., Pickard L., Jones P., Hoaglin D., El Emmam K., and Rosenberg J., “Preliminary Guidelines for Empirical Research in Software Engineering,” IEEE Transactions on Software Engineering, vol. 28, no. 8, pp. 721- 734, 2002.

[32] Wohlin C., Runeson P., Höst M., Ohlsson M., Regnell B., and Wesslen A., Experimentation in Software Engineering, Kluwer Academic Publishers, 2000. A New Metric for Class Cohesion for Object Oriented Software 421 Anjana Gosain is currently working as Professor at University School of Information, Communication & Technology, Guru Gobind Singh Indraprastha University, Dwarka, New Delhi, India. She has worked in the areas of data warehousing, data mining, requirements engineering, conceptual modelling, software engineering and machine learning and has authored/co-authored over 90 research publications in peer-reviewed reputed international journals, book chapter sand conferenceproceedings. Ganga Sharma is currently working as Assistant Professor at School of Engineering, G D Goenka University, Sohna, Gurgaon-122103, Haryana, India. Her research interests include software engineering, object oriented analysis and design, software metrics and aspect orientation.