Determining the capabilities of generative artificial intelligence tools to increase the efficiency of refactoring process
DOI:
https://doi.org/10.15587/2706-5448.2025.326899Keywords:
AI-driven refactoring, code quality improvement, automated code smell detection, generative AI tools, software optimizationAbstract
The object of research is a source code refactoring facilitated and proctored by generative artificial intelligence tools. The paper is aimed at assessing their impact on refactoring quality while determining their practical applicability for improving software maintainability and efficiency.
The problem addressed in this research is the limitations of traditional rule-based refactoring tools, which require predefined rules and are often language-specific. Generative AI, with its advanced pattern recognition and adaptive learning capabilities, offers an alternative approach. However, its effectiveness in handling various refactoring tasks and its reliability remain undisclosed.
The research involved multiple experiments, where four AI tools – ChatGPT, Copilot, Gemini, and Claude – were tested on various refactoring tasks, including code smell detection, efficiency improvements, decoupling, and large-scale refactoring.
The results showed that Claude achieved the highest success rate (78.8%), followed by ChatGPT (76.6%), Copilot (72.8%), and Gemini (61.8%). While all tools demonstrated at least a basic understanding of refactoring principles, their effectiveness varied significantly depending on the complexity of the task. These results can be attributed to differences in model training, specialization, and underlying architectures. Models optimized for programming tasks performed better in structured code analysis, whereas more general-purpose models lacked depth in specific programming-related tasks.
The practical implications of this research highlight that while Generative AI tools can significantly aid in refactoring, human oversight remains essential. AI-assisted refactoring can enhance developer productivity, streamline software maintenance, and reduce technical debt, making it a valuable addition to modern software development workflows.
References
- Fowler, M. (2019). Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional.
- Mens, T., Tourwé, T., Demeyer, S. (2019). Software Evolution. Springer.
- Tkachuk, A., Bulakh, B. (2023). Describing the Knowledge About the Source Code Using an Ontology. Infocommunication and computer systems, 1 (5), 123–133. https://doi.org/10.36994/2788-5518-2023-01-05-14
- Tkachuk, A. V. (2024). Automated code refactoring using a knowledge base and logical rules. Scientific Bulletin of UNFU, 34 (2), 87–93. https://doi.org/10.36930/40340211
- Põld, J., Robal, T., Kalja, A. (2013). On Proving the Concept of an Ontology Aided Software Refactoring Tool. Frontiers in Artificial Intelligence and Applications, 249, 84–94. https://doi.org/10.3233/978-1-61499-161-8-84
- Bommasani, R., Hudson, D., Adeli, E., Altman, R., Arora, S., Arx, S. et al. (2021). On the opportunities and risks of foundation models. arXiv. https://doi.org/10.48550/arXiv.2108.07258
- Russell, S., Norvig, P. (2020). Artificial Intelligence: A Modern Approach. Pearson.
- Poldrack, R., Lu, T., Begus, G. (2023). AI-assisted coding: Experiments with GPT-4. arXiv. https://doi.org/10.48550/arXiv.2304.13187
- Dhruv, A., Dubey, A. (2024). Leveraging Large Language Models for Code Translation and Software Development in Scientific Computing. https://doi.org/10.48550/arXiv.2410.24119
- Sajja, A., Thakur, D., Mehra, A. (2024). Integrating Generative AI into the Software Development Lifecycle: Impacts on Code Quality and Maintenance. International Journal of Science and Research Archive, 13 (1), 1952–1960. https://doi.org/10.30574/ijsra.2024.13.1.1837
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Andrii Tkachuk

This work is licensed under a Creative Commons Attribution 4.0 International License.
The consolidation and conditions for the transfer of copyright (identification of authorship) is carried out in the License Agreement. In particular, the authors reserve the right to the authorship of their manuscript and transfer the first publication of this work to the journal under the terms of the Creative Commons CC BY license. At the same time, they have the right to conclude on their own additional agreements concerning the non-exclusive distribution of the work in the form in which it was published by this journal, but provided that the link to the first publication of the article in this journal is preserved.



