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]  Adnan Shaout,et al.  Many-Objective Software Remodularization Using NSGA-III , 2015, TSEM.

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

[3]  Helen Sharp,et al.  Agile Processes, in Software Engineering, and Extreme Programming , 2016, Lecture Notes in Business Information Processing.

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

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

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

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

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

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

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

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

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

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

[14]  Alberto Sillitti Agile Processes in Software Engineering and Extreme Programming, 11th International Conference, XP 2010, Trondheim, Norway, June 1-4, 2010. Proceedings , 2010, XP.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[32]  Meiyappan Nagappan,et al.  Curating GitHub for engineered software projects , 2017, Empirical Software Engineering.

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

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

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

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

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

[38]  Andreas Zeller,et al.  The impact of tangled code changes on defect prediction models , 2015, Empirical Software Engineering.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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