When Does a Refactoring Induce Bugs? An Empirical Study
Authors:
- Gabriele BavotaGBGabriele Bavota
- Bernardino De CarluccioBCBernardino De Carluccio
- Andrea De LuciaALAndrea De Lucia
- Massimiliano Di PentaMPMassimiliano Di Penta
- Rocco OlivetoRORocco Oliveto
- Orazio StrolloOSOrazio Strollo
- 1 September 2012
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 104-113
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
This publication has 19 references indexed in Scilit:
- Identifying Extract Class refactoring opportunities using structural and semantic cohesion measuresJournal of Systems and Software, 2011
- Template-based reconstruction of complex refactorings2010
- Fair and balanced?2009
- Classifying Software Changes: Clean or Buggy?IEEE Transactions on Software Engineering, 2008
- Is it a bug or an enhancement?2008
- Identifying Refactorings from Source-Code Changes2006
- Refactoring Detection based on UMLDiff Change-Facts Queries2006
- When do changes induce fixes?2005
- A survey of software refactoringIEEE Transactions on Software Engineering, 2004
- Finding refactorings via change metricsACM SIGPLAN Notices, 2000