An experimental investigation on the innate relationship between quality and refactoring

Abstract Previous studies have investigated the reasons behind refactoring operations performed by developers, and proposed methods and tools to recommend refactorings based on quality metric profiles, or on the presence of poor design and implementation choices, i.e., code smells. Nevertheless, the existing literature lacks observations about the relations between metrics/code smells and refactoring activities performed by developers. In other words, the characteristics of code components increasing/decreasing their chances of being object of refactoring operations are still unknown. This paper aims at bridging this gap. Specifically, we mined the evolution history of three Java open source projects to investigate whether refactoring activities occur on code components for which certain indicators—such as quality metrics or the presence of smells as detected by tools—suggest there might be need for refactoring operations. Results indicate that, more often than not, quality metrics do not show a clear relationship with refactoring. In other words, refactoring operations are generally focused on code components for which quality metrics do not suggest there might be need for refactoring operations. Finally, 42% of refactoring operations are performed on code entities affected by code smells. However, only 7% of the performed operations actually remove the code smells from the affected class.

[1]  Victor R. Basili,et al.  A Validation of Object-Oriented Design Metrics , 1995 .

[2]  David J. Sheskin,et al.  Handbook of Parametric and Nonparametric Statistical Procedures , 1997 .

[3]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[4]  Maliha S. Nash,et al.  Handbook of Parametric and Nonparametric Statistical Procedures , 2001, Technometrics.

[5]  Alberto Sillitti,et al.  Does Refactoring Improve Reusability? , 2006, ICSR.

[6]  Ivan Moore,et al.  Automatic inheritance hierarchy restructuring and method refactoring , 1996, OOPSLA '96.

[7]  Jan Verelst,et al.  Refactoring - improving coupling and cohesion of existing code , 2004, 11th Working Conference on Reverse Engineering.

[8]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

[9]  Gabriele Bavota,et al.  An empirical study on the developers' perception of software coupling , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[10]  SinghYogesh,et al.  Empirical validation of object-oriented metrics for predicting fault proneness models , 2010 .

[11]  Eleni Stroulia,et al.  Assessing the maintainability benefits of design restructuring using dependency analysis , 2003, Proceedings. 5th International Workshop on Enterprise Networking and Computing in Healthcare Industry (IEEE Cat. No.03EX717).

[12]  J. Zeman,et al.  quantitative evaluation of by , 2010 .

[13]  Alexander Chatzigeorgiou,et al.  Identification of Move Method Refactoring Opportunities , 2009, IEEE Transactions on Software Engineering.

[14]  Jana Polgar,et al.  Object-Oriented Software Metrics , 2005, Encyclopedia of Information Science and Technology.

[15]  Lionel C. Briand,et al.  Investigating quality factors in object-oriented designs: an industrial case study , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[16]  Mark Kent O'Keeffe,et al.  Search-based software maintenance , 2006, Conference on Software Maintenance and Reengineering (CSMR'06).

[17]  Gabriele Bavota,et al.  Methodbook: Recommending Move Method Refactorings via Relational Topic Models , 2014, IEEE Transactions on Software Engineering.

[18]  Gabriele Bavota,et al.  Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[19]  Diomidis Spinellis,et al.  Refactoring--Does It Improve Software Quality? , 2007, Fifth International Workshop on Software Quality (WoSQ'07: ICSE Workshops 2007).

[20]  Tibor Gyimóthy,et al.  Empirical validation of object-oriented metrics on open source software for fault prediction , 2005, IEEE Transactions on Software Engineering.

[21]  Eleni Stroulia,et al.  JDeodorant: identification and application of extract class refactorings , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[22]  Gabriele Bavota,et al.  Improving software modularization via automated analysis of latent topics and dependencies , 2014, TSEM.

[23]  David W. Hosmer,et al.  Applied Logistic Regression , 1991 .

[24]  Darren C. Atkinson,et al.  Lightweight detection of program refactorings , 2005, 12th Asia-Pacific Software Engineering Conference (APSEC'05).

[25]  R. O’Brien,et al.  A Caution Regarding Rules of Thumb for Variance Inflation Factors , 2007 .

[26]  Lionel C. Briand,et al.  Using coupling measurement for impact analysis in object-oriented systems , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[27]  Harald C. Gall,et al.  Improving evolvability through refactoring , 2005, MSR.

[28]  Mohammad Alshayeb,et al.  Empirical investigation of refactoring effect on software quality , 2009, Inf. Softw. Technol..

[29]  J. Gerring A case study , 2011, Technology and Society.

[30]  Houari A. Sahraoui,et al.  Deviance from perfection is a better criterion than closeness to evil when identifying risky code , 2010, ASE.

[31]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

[32]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[33]  Thierry Bodhuin,et al.  SORMASA: A tool for Suggesting Model Refactoring Actions by Metrics-led Genetic Algorithm , 2007, WRT.

[34]  Andrew P. Black,et al.  How We Refactor, and How We Know It , 2012, IEEE Trans. Software Eng..

[35]  D. Sheskin Handbook of Parametric and Nonparametric Statistical Procedures: Third Edition , 2000 .

[36]  Yi Wang,et al.  What motivate software engineers to refactor source code? evidences from professional developers , 2009, 2009 IEEE International Conference on Software Maintenance.

[37]  Tibor Gyimóthy,et al.  Bulk Fixing Coding Issues and Its Effects on Software Quality: Is It Worth Refactoring? , 2014, 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation.

[38]  Andrew P. Black,et al.  How we refactor, and how we know it , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[39]  Victor R. Basili,et al.  A Validation of Object-Oriented Design Metrics as Quality Indicators , 1996, IEEE Trans. Software Eng..

[40]  Raed Shatnawi,et al.  An Empirical Assessment of Refactoring Impact on Software Quality Using a Hierarchical Quality Model , 2011 .

[41]  Tibor Gyimóthy,et al.  Using information retrieval based coupling measures for impact analysis , 2009, Empirical Software Engineering.

[42]  Miryung Kim,et al.  Template-based reconstruction of complex refactorings , 2010, 2010 IEEE International Conference on Software Maintenance.

[43]  Gabriele Bavota,et al.  Recommending Refactoring Operations in Large Software Systems , 2014, Recommendation Systems in Software Engineering.

[44]  Houari A. Sahraoui,et al.  Can metrics help to bridge the gap between the improvement of OO design quality and its automation? , 2000, Proceedings 2000 International Conference on Software Maintenance.

[45]  Takeo Imai,et al.  A quantitative evaluation of maintainability enhancement by refactoring , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[46]  Marouane Kessentini,et al.  Competitive Coevolutionary Code-Smells Detection , 2013, SSBSE.

[47]  Stephen R. Schach,et al.  Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures , 1998, Proceedings of the 20th International Conference on Software Engineering.

[48]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[49]  Claus Lewerentz,et al.  Metrics Based Refactoring , 2001, CSMR.

[50]  Gabriele Bavota,et al.  Mining Version Histories for Detecting Code Smells , 2015, IEEE Transactions on Software Engineering.

[51]  Gabriele Bavota,et al.  When Does a Refactoring Induce Bugs? An Empirical Study , 2012, 2012 IEEE 12th International Working Conference on Source Code Analysis and Manipulation.

[52]  Gabriele Bavota,et al.  Automating extract class refactoring: an improved method and its evaluation , 2013, Empirical Software Engineering.

[53]  Eduardo Casais,et al.  An Incremental Class Reorganization Approach , 1992, ECOOP.

[54]  Rudolf Ferenc,et al.  Using the Conceptual Cohesion of Classes for Fault Prediction in Object-Oriented Systems , 2008, IEEE Transactions on Software Engineering.

[55]  Daryl Pregibon,et al.  An analysis of static metrics and faults in C software , 1985, J. Syst. Softw..

[56]  Tibor Gyimóthy,et al.  Modeling class cohesion as mixtures of latent topics , 2009, 2009 IEEE International Conference on Software Maintenance.

[57]  Miryung Kim,et al.  A field study of refactoring challenges and benefits , 2012, SIGSOFT FSE.

[58]  C. Lewerentz,et al.  Metrics based refactoring , 2001, Proceedings Fifth European Conference on Software Maintenance and Reengineering.

[59]  Katsuhisa Maruyama,et al.  Automatic method refactoring using weighted dependence graphs , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

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

[61]  Witold Pedrycz,et al.  A Case Study on the Impact of Refactoring on Quality and Productivity in an Agile Team , 2008, CEE-SET.