Using LLMs to enhance code quality: A systematic literature review

  • Nawaf Alomari*
  • , Moussa Redah
  • , Ahmad Ashraf
  • , Mohammad Alshayeb
  • *Corresponding author for this work

Research output: Contribution to journalReview articlepeer-review

Abstract

Context: Large Language Models (LLMs) are increasingly used in software engineering to enhance code quality through tasks such as refactoring and code smell detection and many other tasks. Code smells are poor design decisions that can be resolved by changing the internal structure of the code without affecting its output, a process known as refactoring. Objective: This study systematically reviews the use of LLMs in code quality enhancement, focusing on techniques such as refactoring, smell detection, and other code improvement methods. Method: Using SLR techniques, we reviewed 49 studies up to September 2024, analyzing both qualitative and quantitative data to assess trends and effectiveness. Results: The field is active, with refactoring as the most common task, followed by smell detection. Refactored code by LLMs is not reliable. Prompting is used more frequently than fine-tuning, with few-shot learning as the leading prompting method. Java and Python are the most represented languages, while F1, Precision, Recall, and Accuracy are common evaluation metrics, along with BLEU and EM for generation tasks. Open-source and general language models are preferred, with validation datasets as the primary validation approach. Conclusions: LLMs show promise for code quality improvement, but challenges in optimization and reliability remain. Future research should prioritize fine-tuning for refactoring, linking LLMs to specific quality attributes, developing benchmark datasets, constructing datasets for diverse programming languages, and exploring a wider range of promoting techniques.

Original languageEnglish
Article number107960
JournalInformation and Software Technology
Volume190
DOIs
StatePublished - Feb 2026

Bibliographical note

Publisher Copyright:
© 2025 Elsevier B.V. All rights are reserved, including those for text and data mining, AI training, and similar technologies.

Keywords

  • Code quality
  • LLM
  • systematic literature review

ASJC Scopus subject areas

  • Software
  • Information Systems
  • Computer Science Applications

Fingerprint

Dive into the research topics of 'Using LLMs to enhance code quality: A systematic literature review'. Together they form a unique fingerprint.

Cite this