An exploration of the 'introduce explaining variable' refactoring
Steve Counsell, Xinxin Liu, Stephen Swift, Jim Buckley, Mike English, Sebastian Herold, Sigrid Eldh, Andreas Ermedahl · 2015
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.