On the Impact of Refactoring Operations on Code Quality Metrics

Oscar Chaparro, Gabriele Bavota, Andrian Marcus, and Massimiliano Di Penta

Proceedings of the 30th IEEE International Conference on Software Maintenance and Evolution (ICSME'14), ERA track, pp. 456–460, 2014

[PDF] [Replication package]

Abstract: Refactorings are behavior-preserving source code transformations. While tool support exists for (semi)automatically identifying refactoring solutions, applying or not a recommended refactoring is usually up to the software developers, who have to assess the impact that the transformation will have on their system. Evaluating the pros (e.g., the bad smell removal) and cons (e.g., side effects of the change) of a refactoring is far from trivial. We present RIPE (Refactoring Impact PrEdiction), a technique that estimates the impact of refactoring operations on source code quality metrics. RIPE supports 12 refactoring operations and 11 metrics and it can be used together with any refactoring recommendation tool. RIPE was used to estimate the impact on 8,103 metric values, for 504 refactorings from 15 open source systems. 38% of the estimates are correct, whereas the median deviation of the estimates from the actual values is 5% (with a 31% average).