When Does a Refactoring Induce Bugs? An Empirical Study

  • Authors:
  • Gabriele Bavota;Bernardino De Carluccio;Andrea De Lucia;Massimiliano Di Penta;Rocco Oliveto;Orazio Strollo

  • Affiliations:
  • -;-;-;-;-;-

  • Venue:
  • SCAM '12 Proceedings of the 2012 IEEE 12th International Working Conference on Source Code Analysis and Manipulation
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

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.