Search

Using LLM for Code Refactoring: an Evaluation of Effectiveness and Correctness

Contribution type: article

Title: Using LLM for Code Refactoring: an Evaluation of Effectiveness and Correctness

Authors:

Luigi Lavazza, Università degli Studi dell’Insubria, Italy
Gabriele Rotoloni, Università degli Studi dell’Insubria, Italy

Keywords: Code smells; code refactoring; LLM for software development

Abstract:

Code smells are indicators of poor software structure and organization, suggesting potential maintenance challenges and future issues. To enhance code quality and eliminate these smells, developers often engage in code refactoring, which involves restructuring existing code without altering its external behavior. This process, while essential, can be time-consuming and may not require advanced programming skills. Recent advancements in large language models (LLMs) have prompted investigations into their ability to automate code refactoring.This paper presents an experimental evaluation of LLMs' capabilities in refactoring code within development environments that utilize test cases for code units. Recognizing the risk of regression—where changes inadvertently disrupt previously functioning features—developers typically establish a comprehensive set of test cases for each software unit. Our approach leverages automatic code smell detection tools alongside existing test cases to streamline the refactoring process, maximizing automation while maintaining code integrity. The findings of this study contribute to the objectives of the conference by addressing the impact of AI on software development; specifically, the paper contributes to the exploration of LLMs' potential to enhance code quality through automated refactoring techniques.

Publication Date: November 16, 2025

Presented during:

Dates: November 16, 2025 to November 20, 2025

Location: Nice / Saint-Laurent-du-Var, France

Venue:

Novotel Nice Airport Cap 3000

40 Avenue de Verdun
06700 SAINT LAURENT DU VAR
France

Hotel website

Copyright (c) DTR Society, 2025

Contact Us

Proposals

The submission system is currently being prepared. We invite you to subscribe to the newsletter so you will be the first to know when it goes online.