Analysis of existing approaches to automated refactoring of object-oriented software systems
Main Article Content
Abstract
Automated refactoring plays a crucial role in the maintenance and evolution of object-oriented software systems, where improving internal code structure directly impacts maintainability, scalability, and technical debt reduction. This paper presents an extended review of current approaches to automated refactoring, emphasizing methodological foundations, automation levels, the application of artificial intelligence, and practical integration into CI/CD workflows. We examine rule-based, graph-based, machine learning–based (CNNs, GNNs, LLMs), and history-aware (MSR) techniques, along with hybrid systems incorporating human-in-the-loop feedback. The taxonomy of refactoring types is aligned with established terminology – particularly Fowler’s classification – distinguishing structural, semantic (architectural), and behavioral transformations, all grounded in the principle of behavior preservation. Formal models are introduced to describe refactorings as graph transformations governed by preconditions and postconditions that ensure semantic equivalence between program versions. The paper provides a concrete example of a transformation generated by the DeepSmells tool, demonstrating the «before/after» change and explaining the rationale behind the AI-driven recommendation. The study also addresses the challenges of explainability and semantic drift, proposing mitigation strategies such as SHAP-based analysis, attention visualization in transformer architectures, integration with formal verification tools (e.g., SMT solvers, symbolic execution), and explainable AI recommendations. Special attention is given to the limitations of automated refactoring in dynamically typed languages (e.g., Python, JavaScript), where the lack of static type information reduces the effectiveness of traditional techniques. Generalization to multilingual systems is supported through models like CodeBERT, CodeT5, and PLBART, which operate over token-level, syntactic, and graph-based representations to enable language-agnostic refactoring. The paper also discusses real-world integration of automated refactoring into CI/CD environments, including the use of bots, refactoring-aware quality gates, and scheduled transformations applied at commit or merge time. Practical examples illustrate the verification of behavior preservation through regression testing or formal methods. This work targets software engineers, researchers, and tool developers engaged in intelligent software maintenance and automated quality assurance. By offering a consolidated classification, tool selection criteria, and practical scenarios, the paper delivers applied value for designing custom refactoring solutions or adopting existing technologies across diverse project constraints–ranging from safety-critical systems to large-scale continuous delivery pipelines.