AI-Driven Code Refactoring Assistant Using Large Language Models

Authors

  • Tharuneshya M, Dr.Umadevi Ramamoorthy School of Science and Computer Studies, CMR University, Bengaluru, Karnataka Author

DOI:

https://doi.org/10.70849/IJSCI

Keywords:

AI Code Refactoring, Large Language Models, GPT, Software Maintenance, Prompt Engineering, Code Smells

Abstract

Modern software systems often need refactoring code to make them more readable, efficient, and easy to maintain without changing their behavior. This has traditionally been a manual activity, error-prone, and time-consuming. With Large Language Models like GPT-4 available, now it becomes possible to automate refactoring activities. This research suggests an AI-Driven Code Refactoring Assistant built on LLMs to examine, suggest, and re-engineer source code into better-performing and easier-to-maintain code. The assistant identifies common code issues, proposes patterns of design, and encourages clean coding. Through prompt engineering and tuned LLMs, the assistant provides language-agnostic, context-specific refactoring suggestions. We perform experiments on open-source software repositories and measure the quality of AI-refactored code using cyclomatic complexity, maintainability index, and developer satisfaction via questionnaires. Experiments show that LLMs greatly reduce developers' cognitive load and increase productivity. This research also considers ethics, limitations of current models, and potential for real-time adoption into development environments.

Downloads

Published

09-09-2025

How to Cite

[1]
Tharuneshya M, Dr.Umadevi Ramamoorthy, “AI-Driven Code Refactoring Assistant Using Large Language Models”, Int. J. Sci. Inno. Eng., vol. 2, no. 9, pp. 308–315, Sep. 2025, doi: 10.70849/IJSCI.