On the Effectiveness of Concern Metrics to Detect Code Smells: An Empirical Study

Traditional software metrics have been used to evaluate the maintainability of software programs by supporting the identification of code smells. Recently, concern metrics have also been proposed with this purpose. While traditional metrics quantify properties of software modules, concern metrics quantify concern properties, such as scattering and tangling. Despite being increasingly used in empirical studies, there is a lack of empirical knowledge about the effectiveness of concern metrics to detect code smells. This paper reports the results of an empirical study to investigate whether concern metrics can be useful indicators of three code smells, namely Divergent Change, Shotgun Surgery, and God Class. In this study, 54 subjects from two different institutions have analyzed traditional and concern metrics aiming to detect instances of these code smells in two information systems. The study results indicate that, in general, concern metrics support developers detecting code smells. In particular, we observed that (i) the time spent in code smell detection is more relevant than the developers’ expertise; (ii) concern metrics are clearly useful to detect Divergent Change and God Class; and (iii) the concern metric Number of Concerns per Component is a reliable indicator of Divergent Change.

[1]  Cláudio Sant'Anna,et al.  Identifying Code Smells with Multiple Concern Views , 2010, 2010 Brazilian Symposium on Software Engineering.

[2]  Nenad Medvidovic,et al.  Are automatically-detected code anomalies relevant to architectural modularity?: an exploratory analysis of evolving systems , 2012, AOSD.

[3]  Hung Viet Nguyen,et al.  Aspect recommendation for evolving software , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[4]  Cláudio Sant'Anna,et al.  Evolving software product lines with aspects , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[5]  Arthur J. Riel,et al.  Object-Oriented Design Heuristics , 1996 .

[6]  Stéphane Ducasse,et al.  Object-Oriented Metrics in Practice , 2005 .

[7]  Eugene Miya,et al.  On "Software engineering" , 1985, SOEN.

[8]  Radu Marinescu,et al.  Detection strategies: metrics-based rules for detecting design flaws , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[9]  Raj Jain,et al.  The art of computer systems performance analysis - techniques for experimental design, measurement, simulation, and modeling , 1991, Wiley professional computing.

[10]  Alfred V. Aho,et al.  Do Crosscutting Concerns Cause Defects? , 2008, IEEE Transactions on Software Engineering.

[11]  Cláudio Sant'Anna,et al.  On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study , 2007, ECOOP.

[12]  Thaís Vasconcelos Batista,et al.  An exploratory study of fault-proneness in evolving aspect-oriented programs , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[13]  Marcelo de Almeida Maia,et al.  On the impact of crosscutting concern projection on code measurement , 2011, AOSD '11.

[14]  Erik Ernst,et al.  ECOOP 2007 - Object-Oriented Programming, 21st European Conference, Berlin, Germany, July 30 - August 3, 2007, Proceedings , 2007, ECOOP.

[15]  Eduardo Figueiredo,et al.  On the relationship of concern metrics and requirements maintainability , 2012, Inf. Softw. Technol..

[16]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[17]  Carlos José Pereira de Lucena,et al.  Modularizing design patterns with aspects: a quantitative study , 2005, AOSD '05.

[18]  Shari Lawrence Pfleeger,et al.  Software Metrics : A Rigorous and Practical Approach , 1998 .

[19]  Cláudio Sant'Anna,et al.  On the Maintainability of Aspect-Oriented Software: A Concern-Oriented Measurement Framework , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

[20]  Stéphane Ducasse,et al.  Distribution Map , 2006, 2006 22nd IEEE International Conference on Software Maintenance.

[21]  Martin P. Robillard,et al.  Representing concerns in source code , 2007, TSEM.

[22]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[23]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.