Quality Histories of Past Extract Method Refactorings

Modern programming environments offer the Extract Method refactoring as a way to improve software quality by moving a source code fragment into a new method. This refactoring comes with an immediate positive feedback by shortening the refactored method. It can also increase code re-usage and encourage developers to remove code clones. The impact of refactorings on the software quality has been the topic of many research efforts. However, these refactorings are usually studied in groups. Therefore the metrics evaluated and the observation are not tailored to a specific refactoring, thus hiding a valuable insight on how practitioners use a refactoring in particular. In this paper, we conduct an assessment of the quality impact resulting from the Extract Method refactoring. Our results statistically confirm the tendency of the Extract Method to improve complexity and slightly worsen cohesion, respectively in 46% and 70% of the refactoring. In addition, we observe that the Extract Method favors re-use and reduces occurrences of code clones in 56% of the extracted methods. However, our results also show that some specific cases are contrary to the previously mentioned trends and that it is therefore necessary to study refactorings at a low granularity.

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

[2]  Anas Abdin,et al.  Empirical Evaluation of the Impact of Object-Oriented Code Refactoring on Quality Attributes: A Systematic Literature Review , 2018, IEEE Transactions on Software Engineering.

[3]  Apostolos Ampatzoglou,et al.  Identifying Extract Method Refactoring Opportunities Based on Functional Relevance , 2017, IEEE Transactions on Software Engineering.

[4]  Sanjay Misra,et al.  A Suite of Object Oriented Cognitive Complexity Metrics , 2018, IEEE Access.

[5]  Cristina V. Lopes,et al.  50K-C: A Dataset of Compilable, and Compiled, Java Projects , 2018, 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR).

[6]  Katsuro Inoue,et al.  An Investigation into the Characteristics of Merged Code Clones during Software Evolution , 2014, IEICE Trans. Inf. Syst..

[7]  Harris Cooper,et al.  Effect Size Substantive Interpretation Guidelines : Issues in the Interpretation of Effect Sizes , 2007 .

[8]  Sanjay Misra,et al.  A Framework for Evaluation and Validation of Software Complexity Measures , 2014 .

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

[10]  Cristian Mateos,et al.  A Novel Unsupervised Learning Approach for Assessing Web Services Refactoring , 2019, ICIST.

[11]  Sanjay Misra,et al.  Exploring Web Service QoS Estimation for Web Service Composition , 2020, ICIST.

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

[13]  Broderick Crawford,et al.  A systematic literature review of open source software quality assessment models , 2016, SpringerPlus.

[14]  Alexandre Bergel,et al.  Improving the success rate of applying the extract method refactoring , 2020, Sci. Comput. Program..

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

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

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

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

[19]  Mohamed Wiem Mkaouer,et al.  On the Impact of Refactoring on the Relationship between Quality Attributes and Design Metrics , 2019, 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM).

[20]  Tibor Gyimóthy,et al.  A Manually Validated Code Refactoring Dataset and Its Assessment Regarding Software Maintainability , 2016, PROMISE.

[21]  Analysis of Expectations of Students and Their Initial Concepts on Software Quality , 2016 .

[22]  Alexandre Bergel,et al.  Understanding and addressing exhibitionism in Java empirical research about method accessibility , 2016, Empirical Software Engineering.

[23]  Mohammad Alshayeb,et al.  A Classification of Refactoring Methods Based on Software Quality Attributes , 2011 .

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

[25]  Cristian Mateos,et al.  Reducing Efforts in Web Services Refactoring , 2019, ICCSA.

[26]  Tibor Gyimóthy,et al.  A Code Refactoring Dataset and Its Assessment Regarding Software Maintainability , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).