Measuring Trivial and Non-Trivial Refactoring: A Predictive Analysis and Index Proposal - Pinheiro, Darwin; Bezerra, Carla; Uchôa, Anderson (Anais Estendidos do Congresso Brasileiro de Software: Teoria e Prática (CBSoft), 2025)
This study investigates the relationship between trivial and non-trivial refactorings and proposes a metric to evaluate refactoring triviality. We analyzed 1.9M refactorings from 1,291 open-source projects with 45 code metrics using supervised learning. We evaluate 5 classification models and 7 regression models under various configurations. Based on these results, we propose a metric based on complexity, speed and risk, with insights from 15 developers on 58 selected features. The results show that separating the refactorings by triviality improves the predictions and that the use of all features outperforms the prioritization of the developer. Ensemble models outperformed linear ones, and expert perceptions aligned with model results. These findings support refactoring decisions and highlight future research opportunities.