# Software Refactoring Research with Large Language Models: A Systematic Literature Review

DevFeed: [Software Refactoring Research with Large Language Models: A Systematic Literature Review](<https://devfeed.tech/articles/software-refactoring-research-with-large-language-models-a-systematic-literature-review-129173.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.14027>)

Author: Sofia Martinez, Luo Xu, Mariam Elnaggar, Eman Abdullah AlOmar

Published: 2026-11-11T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [apache](<https://devfeed.tech/tags/apache.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [automate](<https://devfeed.tech/tags/automate.md>), [automated](<https://devfeed.tech/tags/automated.md>), [chain-of-thought](<https://devfeed.tech/tags/chain-of-thought.md>), [code](<https://devfeed.tech/tags/code.md>), [code-smell](<https://devfeed.tech/tags/code-smell.md>), [code-smells](<https://devfeed.tech/tags/code-smells.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [developers](<https://devfeed.tech/tags/developers.md>), [effectiveness](<https://devfeed.tech/tags/effectiveness.md>), [f-droid](<https://devfeed.tech/tags/f-droid.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [large-language-models](<https://devfeed.tech/tags/large-language-models.md>), [literature](<https://devfeed.tech/tags/literature.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [research](<https://devfeed.tech/tags/research.md>), [review](<https://devfeed.tech/tags/review.md>), [software](<https://devfeed.tech/tags/software.md>)

## AI overview

The review finds promising but uneven evidence for using large language models to automate code refactoring. Studies used varied tools and datasets, mostly involving Java, and reported that prompting methods such as one-shot, few-shot, context-specific, or chain-of-thought could reduce code smells by up to 89% in some cases. Extract Method was the most commonly applied refactoring, while Large Class and Long Method were frequently examined. Results are difficult to compare because studies define "accuracy" differently; the authors call for a standardized measure. The review also reports recurring failures: generated errors, difficulty with complex refactoring, and misunderstanding or omission of developer requests.

## Source excerpt

arXiv:2611.14027v1 Announce Type: new Abstract: Background: Code refactoring is the improvement of code internally without changing the external functionalities of the program. Due to its exhaustive nature, developers often avoid manually refactoring code. Researchers have since looked into utilizing LLMs to automate the task of refactoring. Aim and Method: Despite the promising results, there is a lack of clear un- derstanding of LLMs' effectiveness in automated refactoring. Result: From our literature review we found that: (i) there are various tools that different studies use to enhance and study LLM-driving refactoring, with tools that were used to detect code smells, generate code bases, and compare refactoring outcomes. (ii) Various datasets were collected from multiple open- source projects in multiple programming languages for analysis. These platforms included GitHub, Apache, and F-Droid, with the most popular language collec- ted and analyzed being Java. (iii) One-Shot, Few-Shot, Context-Specific, and Chain-of-Thought prompting methods have been shown to be the most effective depending on the language used. In some instances, being capable of reducing code smell by up to 89%. (iv) The definition of "accuracy" varies significantly across the literature surveyed, as this depends on the context of the study, thus calling for a need to have a standardized measurement for Accuracy. (v) The most often mentioned code smells were Large Class and Long Method, with a lot of studies also not specifying, while the most often applied refactoring type is Extract Method, showing promising results in using LLM to perform this refactoring type. (vi) When working with LLMs, they often generate erroneous code, struggle with more complex refactoring, and often misunderstand the developers' requests and miss refactoring requests.