The Relationship between Traceable Code Patterns and Code Smells

Context: It is important to maintain software quality as a software system evolves. Managing code smells in source code contributes towards quality software. While metrics have been used to pinpoint code smells in source code, we present an empirical study on the correlation of code smells with class-level (micro pattern) and methodlevel (nano-pattern) traceable patterns of code. Objective: This study explores the relationship between code smells and class-level and method-level structural code constructs. Method: We extracted micro patterns at the class level and nano-patterns at the method level from three versions of Apache Tomcat and PersonalBlog and Roller from Standford SecuriBench and compared their distributions in code smell versus non-code smell classes and methods.Result: We found that DataManager, Record and Outline micro patterns are more frequent in classes having code smell compared to non-code smell classes in the applications we analyzed. localReader, localWriter, Switcher, and ArrReader nano-patterns are more frequent in code smell methods compared to the non-code smell methods. Conclusion: We conclude that code smells are correlated with both micro and nano-patterns.

[1]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[2]  Tiago L. Alves,et al.  Deriving metric thresholds from benchmark data , 2010, 2010 IEEE International Conference on Software Maintenance.

[3]  Yi Sun,et al.  Some Code Smells Have a Significant but Small Effect on Faults , 2014, TSEM.

[4]  Forrest Shull,et al.  Investigating the impact of design debt on software quality , 2011, MTD '11.

[5]  Radu Marinescu,et al.  InCode: Continuous Quality Assessment and Improvement , 2010, 2010 14th European Conference on Software Maintenance and Reengineering.

[6]  Foutse Khomh,et al.  An Exploratory Study of the Impact of Code Smells on Software Change-proneness , 2009, 2009 16th Working Conference on Reverse Engineering.

[7]  Marco Zanoni,et al.  Code Smells and Micro Patterns Correlations , 2013 .

[8]  Francesca Arcelli Fontana,et al.  Towards Assessing Software Architecture Quality by Exploiting Code Smell Relations , 2015, 2015 IEEE/ACM 2nd International Workshop on Software Architecture and Metrics.

[9]  Gavin Brown,et al.  Fundamental Nano-Patterns to Characterize and Classify Java Methods , 2010, LDTA.

[10]  C.J.H. Mann,et al.  Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems , 2007 .

[11]  Aiko Yamashita,et al.  Assessing the capability of code smells to explain maintenance problems: an empirical study combining quantitative and qualitative data , 2013, Empirical Software Engineering.

[12]  Bartosz Walter,et al.  Leveraging Code Smell Detection with Inter-smell Relations , 2006, XP.

[13]  Itay Maman,et al.  Micro patterns in Java code , 2005, OOPSLA '05.

[14]  Michele Marchesi,et al.  Micro Pattern Fault-Proneness , 2012, 2012 38th Euromicro Conference on Software Engineering and Advanced Applications.

[15]  Francesca Arcelli Fontana,et al.  On Investigating Code Smells Correlations , 2011, 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops.

[16]  Marco Tulio Valente,et al.  Extracting relative thresholds for source code metrics , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[17]  Raed Shatnawi,et al.  An empirical study of the bad smells and class error probability in the post-release object-oriented system evolution , 2007, J. Syst. Softw..