On the Impact of Refactoring on the Relationship between Quality Attributes and Design Metrics

Background: Refactoring is a critical task in software maintenance and is generally performed to enforce the best design and implementation practices or to cope with design defects. Several studies attempted to detect refactoring activities through mining software repositories allowing to collect, analyze and get actionable data-driven insights about refactoring practices within software projects. Aim: We aim at identifying, among the various quality models presented in the literature, the ones that are more in-line with the developer’s vision of quality optimization, when they explicitly mention that they are refactoring to improve them. Method: We extract a large corpus of design-related refactoring activities that are applied and documented by developers during their daily changes from 3,795 curated open source Java projects. In particular, we extract a large-scale corpus of structural metrics and anti-pattern enhancement changes, from which we identify 1,245 quality improvement commits with their corresponding refactoring operations, as perceived by software engineers. Thereafter, we empirically analyze the impact of these refactoring operations on a set of common state-of-the-art design quality metrics. Results: The statistical analysis of the obtained results shows that (i) a few state-of-the-art metrics are more popular than others; and (ii) some metrics are being more emphasized than others. Conclusions: We verify that there are a variety of structural metrics that can represent the internal quality attributes with different degrees of improvement and degradation of software quality. Most of the metrics that are mapped to the main quality attributes do capture developer intentions of quality improvement reported in the commit messages, but for some quality attributes, they don’t.

[1]  Mohamed Wiem Mkaouer,et al.  Can Refactoring Be Self-Affirmed? An Exploratory Study on How Developers Document Their Refactoring Activities in Commit Messages , 2019, 2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR).

[2]  Ricardo Terra,et al.  A Quality-oriented Approach to Recommend Move Method Refactorings , 2018, SBQS.

[3]  Gabriele Bavota,et al.  Improving Code: The (Mis) Perception of Quality Metrics , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[4]  Danny Dig,et al.  Accurate and Efficient Refactoring Detection in Commit History , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[5]  Ricardo Terra,et al.  JMove: A novel heuristic and tool to detect move method refactoring opportunities , 2018, J. Syst. Softw..

[6]  Alessandro F. Garcia,et al.  How does refactoring affect internal quality attributes?: A multi-project study , 2017, SBES.

[7]  Nuthan Munaiah,et al.  Curating GitHub for engineered software projects , 2017, Empirical Software Engineering.

[8]  Marco Tulio Valente,et al.  RefDiff: Detecting Refactorings in Version Histories , 2017, 2017 IEEE/ACM 14th International Conference on Mining Software Repositories (MSR).

[9]  Mohamed Wiem Mkaouer,et al.  A robust multi-objective approach to balance severity and importance of refactoring opportunities , 2017, Empirical Software Engineering.

[10]  Alessandro F. Garcia,et al.  Does refactoring improve software structural quality? A longitudinal study of 25 projects , 2016, SBES.

[11]  Marco Tulio Valente,et al.  Why we refactor? confessions of GitHub contributors , 2016, SIGSOFT FSE.

[12]  H. Sharp,et al.  Agile Processes, in Software Engineering, and Extreme Programming , 2016 .

[13]  A. Zeller,et al.  The impact of tangled code changes on defect prediction models , 2016, Empirical Software Engineering.

[14]  Gabriele Bavota,et al.  An experimental investigation on the innate relationship between quality and refactoring , 2015, J. Syst. Softw..

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

[16]  Adnan Shaout,et al.  Many-Objective Software Remodularization Using NSGA-III , 2015, TSEM.

[17]  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.

[18]  Mohamed Wiem Mkaouer,et al.  Recommendation system for software refactoring using innovization and interactive dynamic optimization , 2014, ASE.

[19]  Mohamed Wiem Mkaouer,et al.  High dimensional search-based software engineering: finding tradeoffs among 15 objectives for automating software refactoring using NSGA-III , 2014, GECCO.

[20]  Ricardo Terra,et al.  Recommending automated extract method refactorings , 2014, ICPC 2014.

[21]  Charles A. Sutton,et al.  Mining source code repositories at massive scale using language modeling , 2013, 2013 10th Working Conference on Mining Software Repositories (MSR).

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

[23]  Vinay Singh,et al.  Evaluation and Application of Package Level Metrics in Assessing Software Quality , 2012 .

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

[25]  István Siket,et al.  Effect of object oriented refactorings on testability, error proneness and other maintainability attributes , 2010 .

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

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

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

[29]  Alexander Chatzigeorgiou,et al.  JDeodorant: Identification and Removal of Type-Checking Bad Smells , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

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

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

[32]  Audris Mockus,et al.  Refactoring for changeability: a way to go? , 2005, 11th IEEE International Software Metrics Symposium (METRICS'05).

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

[34]  Jan Verelst,et al.  Does the "Refactor to Understand" reverse engineering pattern improve program comprehension? , 2005, Ninth European Conference on Software Maintenance and Reengineering.

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

[36]  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).

[37]  John Mylopoulos,et al.  Quality-driven software re-engineering , 2003, J. Syst. Softw..

[38]  Ladan Tahvildari,et al.  A metric-based approach to enhance design quality through meta-pattern transformations , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

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

[40]  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.

[41]  Brian Henderson-Sellers,et al.  Object-Oriented Metrics , 1995, TOOLS.

[42]  Brian A. Nejmeh,et al.  NPATH: a measure of execution path complexity and its applications , 1988, CACM.

[43]  Sallie M. Henry,et al.  Software Structure Metrics Based on Information Flow , 1981, IEEE Transactions on Software Engineering.

[44]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

[45]  Christoph Bockisch,et al.  A Survey of Refactoring Detection Tools , 2019, Software Engineering.

[46]  Naoyasu Ubayashi,et al.  Can Abstraction Be Taught? Refactoring-based Abstraction Learning , 2018, MODELSWARD.

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

[48]  C. Izurieta,et al.  TrueRefactor : An Automated Refactoring Tool to Improve Legacy System and Application Comprehensibility , 2011 .

[49]  C. Neelamegam,et al.  P a g e | 183 Global Journal of Computer Science and Technology A Survey- Object Oriented Quality Metrics , 2010 .

[50]  S. Kowalewski,et al.  An Empirical Evaluation of Refactoring , 2007, e Informatica Softw. Eng. J..

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

[52]  Bart Du Bois,et al.  Describing the impact of refactoring on internal program quality , 2003 .

[53]  Serge Demeyer,et al.  Maintainability versus Performance: What's the Effect of Introducing Polymorphism ? , 2003 .

[54]  M. Fowler Refactoring , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[55]  Eleni Stroulia,et al.  Metrics of Refactoring-based Development: An Experience Report , 2001, OOIS.