An exploration of the 'introduce explaining variable' refactoring

While we know much about refactoring trends and their occurrence in open-source and proprietary systems, we still know little about their association with defects or the nature of classes where refactoring is applied. In this paper, we explore one such refactoring, "Introduce explaining variable" (IEV), a low-level code based refactoring which simplifies a complex expression through the introduction of added variables. We explore the possibility that this type of refactoring, requiring manipulation of variables and constructs will have a greater association with defects than other types of refactoring. Classes where they are applied will have lower coupling levels. Five releases from two projects of Eclipse were used to support this analysis and tools to extract both the set of class refactorings and class coupling and size metrics supported the analysis. Results showed that for four out of the five releases studied, classes where the IEV refactoring had been applied were more defect-prone than other classes. Coupling in the same set of classes was higher in all five releases. Size, on the other hand, may be a confounding factor but tentative results suggest that areas of code where this refactoring had been applied are indicative of defect-prone code.

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

[2]  Robert M. Hierons,et al.  Conditional-Based Refactorings and Fault-Proneness: An Empirical Study , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation Workshops.

[3]  Stephan Diehl,et al.  Are refactorings less error-prone than other changes? , 2006, MSR '06.

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

[5]  Harald C. Gall,et al.  On the relation of refactorings and software defect prediction , 2008, MSR '08.

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

[7]  Miryung Kim,et al.  An empirical investigation into the impact of refactoring on regression testing , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

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

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

[10]  Miryung Kim,et al.  An empirical investigation into the role of API-level refactorings during software evolution , 2011, 2011 33rd International Conference on Software Engineering (ICSE).