Predicting software refactoring opportunities using two-level TB-Stacking ensemble models
摘要
Software refactoring is essential for maintaining the quality and extendibility of source code. Although prior research achieved high accuracy in predicting software refactoring opportunities using traditional machine learning methods, further refinements can still boost predictive reliability across multiple refactoring operations. The main objective of this study is to develop a more accurate model for software refactoring predictions. The main objective of this study is to develop a more accurate model for software refactoring predictions. We propose a two-level Tree-based Stacking (TB-Stacking) Ensemble designed to predict refactoring opportunities at the class, method, and variable levels. Various stacking ensembles were built to identify the optimal configurations of base and meta-models. Additionally, two feature selection techniques were employed to identify the most relevant features for accurate predictions. We evaluated our model using a publicly available dataset comprising over two million refactoring instances. The performance of nine traditional machine learning models and seven tree-based ensembles was also assessed, with statistical comparisons drawn against our proposed TB-Stacking model. Results indicate that the TB-Stacking Ensemble consistently outperformed traditional models in all refactoring operations, and demonstrated competitive or superior performance compared to tree-based ensembles. It demonstrated significant improvements in prediction capabilities highlighted by statistical analysis. The model’s robust performance across various refactoring tasks establishes a new benchmark for future refactoring tools.