On the Impact of Refactoring Operations on Code Quality Metrics

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

2014 · 64 citations · 8 references

Concepts

TL;DR

Refactorings are behavior‑preserving transformations whose impact on code quality is difficult to assess, requiring developers to weigh both benefits and side effects. The authors introduce RIPE, a technique that predicts how refactoring operations affect source‑code quality metrics. RIPE supports 12 refactorings and 11 metrics, works with any recommendation tool, and was applied to 504 refactorings across 15 open‑source projects, estimating 8,103 metric changes. The predictions were correct 38 % of the time, with a median deviation of 5 % and an average deviation of 31 % from actual metric values.

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).

References

8