Abstract
Software refactoring is pivotal in improving software quality and ensuring complex software systems' long-term viability and sustainability. However, developers still face challenges in understanding how refactoring approaches influence software quality, as existing classifications largely overlook sustainability aspects and provide limited guidance for long-term software evolution. This gap creates difficulties for developers in selecting appropriate refactoring approaches supporting quality improvement and sustainable maintenance. Therefore, this study addresses these challenges by proposing a novel refactoring taxonomy based on estimated external quality attributes (EEQAs). The proposed taxonomy was developed through three key phases: exploratory study, experimental study, and multi-case analysis. The exploratory study identified the most used refactoring approaches in practice, the EEQAs (effectiveness, extendibility, flexibility, functionality, reusability, and understandability), and five case studies. In the experimental study, 41 experiments across the case studies were conducted to assess the influence of refactoring approaches on EEQAs. Then, a multi-case analysis was performed to examine these effects across all case studies. The proposed refactoring taxonomy categorized the refactoring approaches into positive, negative, and ineffective groups by using their aggregate impact on the EEQAs. The proposed taxonomy puts software sustainability practices at the forefront, prioritizing EEQAs: effectiveness, extendibility, flexibility, functionality, reusability, and understandability. It offers developers a systematic approach to improving software quality, aligning with user expectations, supporting future enhancements, and facilitating system maintenance. By prioritizing these attributes in refactoring practices, developers can build sustainable, robust, and maintainable software systems that deliver long-term value to stakeholders, effectively manage the complexity of software systems, and maintain high code quality standards over time.