The Effectiveness of Supervised Machine Learning Algorithms in Predicting Software Refactoring
Refactoring is the process of changing the internal structure of software to improve its quality without modifying its external behavior. Before carrying out refactoring activities, developers need to identify refactoring opportunities. Currently, refactoring opportunity identification heavily relies on developers’ expertise and intuition.
In this paper, we investigate the effectiveness of machine learning algorithms in predicting software refactorings. More specifically, we train six different machine learning algorithms with a dataset comprising over two million refactorings from 11,149 real-world projects from the Apache, F-Droid, and GitHub ecosystems.
The resulting models predict 20 different refactorings at class, method, and variable-levels with an accuracy often higher than 90%. Our results show that (i) Random Forests are the best models for predicting software refactoring, (ii) process and ownership metrics seem to play a crucial role in the creation of better models, and (iii) models generalize well in different contexts.
Watch a summary of the paper (in English):
BibTeX:
@article{aniche-ml-and-refactoring, author = "Maurício Aniche and Erick Maziero and Rafael Durelli and Vinicius Durelli", title = "The Effectiveness of Supervised Machine Learning Algorithms in Predicting Software Refactoring", journal = "Transactions on Software Engineering (TSE)", year = 2020, doi = "10.1109/TSE.2020.3021736" }