The Effectiveness of Supervised Machine Learning Algorithms in Predicting Software Refactoring

Journal Article (2020)
Author(s)

Maurício Aniche (TU Delft - Software Engineering)

Erick Maziero (Universidade Federal de Lavras)

Rafael Durelli (Universidade Federal de Lavras)

Vinicius Durelli (Federal University of São João del-Rei)

Research Group
Software Engineering
Copyright
© 2020 Maurício Aniche, Erick Maziero, Rafael Durelli, Vinicius Durelli
DOI related publication
https://doi.org/10.1109/TSE.2020.3021736
More Info
expand_more
Publication Year
2020
Language
English
Copyright
© 2020 Maurício Aniche, Erick Maziero, Rafael Durelli, Vinicius Durelli
Research Group
Software Engineering
Issue number
4
Volume number
48
Pages (from-to)
1432 - 1450
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Refactoring is the process of changing the internal structure of software to improve its quality without modifying its external behavior. Empirical studies have repeatedly shown that refactoring has a positive impact on the understandability and maintainability of software systems. However, 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 (i.e., Logistic Regression, Naive Bayes, Support Vector Machine, Decision Trees, Random Forest, and Neural Network) 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 percent. 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.

Files

Tse2020.pdf
(pdf | 0.481 Mb)
License info not available