Title :
When Does a Refactoring Induce Bugs? An Empirical Study
Author :
Bavota, Gabriele ; De Carluccio, Bernardino ; De Lucia, Andrea ; Penta, Massimiliano Di ; Oliveto, Rocco ; Strollo, Orazio
Author_Institution :
Univ. of Salerno, Fisciano, Italy
Abstract :
Refactorings are - as defined by Fowler - behavior preserving source code transformations. Their main purpose is to improve maintainability or comprehensibility, or also reduce the code footprint if needed. In principle, refactorings are defined as simple operations so that are "unlikely to go wrong" and introduce faults. In practice, refactoring activities could have their risks, as other changes. This paper reports an empirical study carried out on three Java software systems, namely Apache Ant, Xerces, and Ar-go UML, aimed at investigating to what extent refactoring activities induce faults. Specifically, we automatically detect (and then manually validate) 15,008 refactoring operations (of 52 different kinds) using an existing tool (Ref-Finder). Then, we use the SZZ algorithm to determine whether it is likely that refactorings induced a fault. Results indicate that, while some kinds of refactorings are unlikely to be harmful, others, such as refactorings involving hierarchies (e.g., pull up method), tend to induce faults very frequently. This suggests more accurate code inspection or testing activities when such specific refactorings are performed.
Keywords :
program debugging; Apache Ant; Argo UML; Java software systems; Xerces; code inspection; empirical study; refactoring induce bugs; source code transformations; testing activities; Computer bugs; Context; Data mining; Java; Software algorithms; Software systems; Empirical Studies; Fault-inducing changes; Mining software repositories; Refactoring;
Conference_Titel :
Source Code Analysis and Manipulation (SCAM), 2012 IEEE 12th International Working Conference on
Conference_Location :
Trento
Print_ISBN :
978-1-4673-2398-7
DOI :
10.1109/SCAM.2012.20