Abstract
Class cohesion has an immediate impact on maintainability, modifiability and understandability of the software. Here, a new metric of cohesion based on complex networks (CBCN) for measuring connectivity of class members was developed mainly relying on calculating class average clustering coefficient from graphs representing connectivity patterns of the various class members. In addition, the CBCN metric was assessed with theoretical validation according to four properties (nonnegativity and normalization, null and maximum values, monotonicity, cohesive modules) of the class cohesion theory. Based on data comparison with existing seventeen typical class cohesion metrics of class cohesion for a system, the CBCN metric was superior to others. Applying the CBCN metric to three open source software systems to calculate class average clustering coefficients, we found that understanding, modification and maintenance of classes in an open software system could be likely less difficult compared with those of others. Three open software systems have power-law distributions for the class average clustering coefficient, which makes possible the further understanding of the cohesion metric based on complex networks.
Similar content being viewed by others
References
Al Dallal, J.: Fault prediction and the discriminative powers of connectivity-based object-oriented class cohesion metrics. Inf. Softw. Technol. 54, 396–416 (2012)
Bansiya, J.; Davis, C.G.: A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. 28, 4–17 (2002)
Yourdon, E.; Constantine, L.L.: Structured Design. Yourdon Press, Shepherdstown (1978)
Yourdon, E.: Structured Design Fundamentals of a Discipline of Computer Program and Systems Design. Prentice-Hall Inc, Reno (1979)
Briand, L.C.; Bunse, C.; Daly, J.: A controlled experiment for evaluating quality guidelines on the maintainability of object-oriented designs. IEEE Trans. Softw. Eng. 27, 513–530 (2001)
Ujhazi, B.; Ferenc, R.; Poshyvanyk, D.; Gyimothy, T.: New conceptual coupling and cohesion metrics for object-Oriented systems. In: 2010 10th IEEE Working Conference on Source Code Analysis and Manipulation (SCAM), pp. 33–42. IEEE (2010)
Cox, G.W.; Etzkorn, L.H.; Hughes, W.E.: Cohesion metric for object-oriented systems based on semantic closeness from disambiguity. Appl. Artif. Intell. (AAI) 20, 419–436 (2006)
Etzkorn, L.H.; Gholston, S.E.; Fortune, J.L.; Stein, C.E.; Utley, D.; Farrington, P.A.; Cox, G.W.: A comparison of cohesion metrics for object-oriented systems. Inf. Softw. Technol. (INFSOF) 46, 677–687 (2004)
Chen, Z.; Zhou, Y.; Xu, B.: A novel approach to measuring class cohesion based on dependence analysis. In: 2002 Proceedings of the International Conference on Software Maintenance, pp. 377–384 (2002)
Chidamber, S.R.; Kemerer, C.F.: Towards a metrics suite for object-oriented design. In: Object-Oriented Programming Systems, Languages and Applications. Special Issue of SIGPLAN Notice, vol. 26, pp. 197–211 (1991)
Chidamber, S.R.; Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20, 476–493 (1994)
Li, W.; Henry, S.: Maintenance metrics for the object oriented paradigm. In: 1993 Proceedings of 1st International Software Metrics Symposium, Baltimore, MD, pp. 52–60 (1993)
Hitz, M.; Montazeri, B.: Measuring coupling and cohesion in object oriented systems. In: 1995 Proceedings of the International Symposium on Applied Corporate Computing, Mexico, pp. 25–27 (1995)
Sellers, B.H.: Object-Oriented Metrics Measures of Complexity. Prentice-Hall, Englewood Cliffs (1996)
Bonja, C.; Kidanmariam, E.: Metrics for class cohesion and similarity between methods. In: 2006 Proceedings of the 44th Annual ACM Southeast Regional Conference, Melbourne, Florida, pp. 91–95 (2006)
Fernández, L.; Peña, R.: A sensitive metric of class cohesion. Int. J. Inf. Theor. Appl. 13, 82–91 (2006)
Briand, L.C.; Daly, J.W.; Wst, J.: A unified framework for cohesion measurement in object-oriented systems. Empir. Softw. Eng. 3, 65–117 (1998)
Bieman, J.M.; Kang, B.K.: Cohesion and reuse in an object-oriented system. In: 1995 Proceedings of the 1995 Symposium on Software reusability. Seattle, Washington, USA, pp. 259–262 (1995)
Badri, L.; Badri, M.: A proposal of a new class cohesion criterion: an empirical study. J. Object Technol. 3, 145–159 (2004)
Chae, H.S.; Kwon, Y.R.; Bae, D.H.: A cohesion measure for object-oriented classes. Softw. Pract. Exp. 30, 1405–1431 (2000)
Xu, B.W.; Zhou, Y.M.: Comments on ‘A cohesion measure for object-oriented classes’ by Chae HS, Kwon YR, Bae DH (Softw. Pract. Exper. 2000; 30: 1405–1431). Softw. Pract. Exp. 31, 1381–1388 (2001)
Xu, B.W.; Zhou, Y.M.: More comments on ‘A cohesion measure for object-oriented classes’ by Chae HS, Kwon YR, Bae DH (Softw. Pract Exper. 2000; 30: 1405–1431). Softw. Pract. Exp. 33, 583–588 (2003)
Yang, X.: Research on class cohesion measures. M.S. Thesis, Department of Computer Science and Engineering, Southeast University (2002)
Al Dallal, J.; Briand, L.C.: A precise method-method interaction-based cohesion metric for object-oriented classes. ACM Trans. Softw. Eng. Methodol. (TOSEM) 21, 8 (2012)
Briand, L.C.; Morasca, S.; Basili, V.R.: Property-based software engineering measurement. IEEE Trans. Softw. Eng. 22, 68–86 (1996)
Al Dallal, J.; Briand, L.C.: An object-oriented high-level design-based class cohesion metric. Inf. Softw. Technol. 52, 1346–1361 (2010)
Al Dallal, J.: Measuring the discriminative power of object-oriented class cohesion metrics. IEEE Trans. Softw. Eng. 37, 778–804 (2011)
Al Dallal, J.: Transitive-based object-oriented lack-of-cohesion metric. Proc. Comput. Sci. 3, 1581–1587 (2011)
Al Dallal J.: Theoretical analysis for the impact of including special methods in lack-of-cohesion computation. In: 2012 First World Conference on Innovation and Computer Sciences, pp. 167–171 (2012)
Al Dallal, J.: Incorporating transitive relations in low-level design-based class cohesion measurement. Softw. Pract. Exp. 43, 685–704 (2013)
Al Dallal, J.: The impact of accounting for special methods in the measurement of object-oriented class cohesion on refactoring and fault prediction activities. J. Syst. Softw. 85, 1042–1057 (2012)
Watts, D.J.; Strogatz, S.H.: Collective dynamics of small-world networks. Nature 393, 440–442 (1998)
Barabási, A.L.; Albert, R.: Emergence of scaling in random networks. Science 286, 509–512 (1999)
Valverds, S.; Cancho, R.F.; Sole, R.V.: Scale-free networks from optimal design. Europhys. Lett. 60, 512–517 (2002)
Myers, C.R.: Software systems as complex networks: structure, function, and evolvability of software collaboration graphs. Phys. Rev. E 68, 046116.1–046116.15 (2003)
LaBelle, N.; Wallingford, E.: Inter package dependency networks in open source software. arXiv: cs.SE/0411096 (2004)
Ma, Y.T.; He, K.Q.; Du, D.H.: A qualitative method for measuring the structural complexity of software systems Based on complex networks. In: 2005 Proceedings of 12th Asia-Pacific Software Engineering Conference (APSEC05), Taipei, Taiwan, December, pp. 257–263 (2005)
Hyland Wood D.; Carrington, D.; Kaplan, S.: Scale-free nature of Java software package, class and method collaboration graphs (Tech. Rep. No. TR-MS1286), University of Maryland College Park (2006)
Gao, Y.; Xu, G.A.; Yang, Y.X.; Niu, X.X.; Guo, S.Z.: Empirical analysis of software coupling networks in object-oriented software systems. In: 2010 IEEE International Conference on Software Engineering and Service Sciences (ICSESS), Beijing, pp. 178–181 (2010)
Savić, M.; Ivanović, M.; Radovanović, M.: Characteristics of class collaboration networks in Large Java Software Projects. Inf. Technol. Control J. 40, 48–58 (2011)
Subelj, L.; Bajec, M.: Software systems through complex networks science: review, analysis and applications. In: 2012 Proceedings of the First International Workshop on Software Mining, Software Mining, pp. 9–16. ACM, New York (2012)
Illusion (June 2012). http://sourceforge.net/projects/aoi/
JabRef (June 2012). http://sourceforge.net/projects/JabRef/
GanttProject (June 2012). http://sourceforge.net/projects/GanttProject/
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Gu, A., Zhou, X., Li, Z. et al. Measuring Object-Oriented Class Cohesion Based on Complex Networks. Arab J Sci Eng 42, 3551–3561 (2017). https://doi.org/10.1007/s13369-017-2588-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s13369-017-2588-x