Back to overview

On the Impact of Refactoring Operations on Code Naturalness

Type of publication Peer-reviewed
Publikationsform Proceedings (peer-reviewed)
Author Lin Bin, Nagy Csaba, Bavota Gabriele, Lanza Michele,
Project PROBE - Live Actionable Software Analytics
Show all

Proceedings (peer-reviewed)

Page(s) 594 - 598
Title of proceedings Proceedings of SANER 2019 (26th International Conference on Software Analysis, Evolution, and Reengineering)

Open Access

Type of Open Access Repository (Green Open Access)


Recent studies have demonstrated that software is natural, that is, its source code is highly repetitive and predictable like human languages. Also, previous studies suggested the exis- tence of a relationship between code quality and its naturalness, presenting empirical evidence showing that buggy code is “less natural” than non-buggy code. We conjecture that this quality- naturalness relationship could be exploited to support refactoring activities (e.g., to locate source code areas in need of refactoring). We perform a first step in this direction by analyzing whether refactoring can improve the naturalness of code. We use state-of-the-art tools to mine a large dataset of refac- toring operations performed in open source systems. Then, we investigate the impact of different types of refactoring operations on the naturalness of the impacted code. We found that (i) code refactoring does not necessarily increase the naturalness of the refactored code; and (ii) the impact on the code naturalness strongly depends on the type of refactoring operations.