Intermediate Representation-Based Approach for Code Refactoring and Quality Evaluation
Code refactoring is an important technical approach to improve code quality. Contemporary software engineering practice has witnessed the development of diverse refactoring recommendation tools that propose refactoring optimization operations to improve code quality metrics. These tools predominantly rely on Abstract Syntax Tree (AST) analysis for both refactoring implementation and quality evaluation, which frequently leads to computational inefficiency during the search for optimal refactoring sequences. To address this limitation, the present study conducts a comprehensive analysis of code elements associated with 14 distinct refactoring types implemented in existing recommendation tools, along with 6 evaluation metrics derived from the QMOOD quality model. Through systematic encapsulation and structural organization across three fundamental dimensions - attributes, methods, and classes - this research proposes an innovative Intermediate Representation for Code Refactoring and Quality Evaluation (IR4CRQE). Based on IR4CRQE, the study implements support for the aforementioned refactoring types and QMOOD metrics, and provides open-source code. Empirical validation across four industrial cases reveals that IR4CRQE achieves significant performance improvements, reducing refactoring time by 92% and quality evaluation time by 96% compared to conventional AST-based approaches, significantly improving the efficiency of refactoring recommendations.
Institutions
- Fujian Normal University (CN)
Publication Details
- Published
- 2025-06-20
- DOI
- https://doi.org/10.1109/seai65851.2025.11108763
- Primary Topic
- Agriculture, Water, and Health
- Type
- article
- Field-Weighted Citation Impact
- 0.00