AI-Driven Code Refactoring Assistant Using Large Language Models
DOI:
https://doi.org/10.70849/IJSCIKeywords:
AI Code Refactoring, Large Language Models, GPT, Software Maintenance, Prompt Engineering, Code SmellsAbstract
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
Issue
Section
License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.








