Enhancing LLM‐Based Code Smell Prediction Using Empirical Detection Strategies
Zijie Huang, Haitao Wu, Kai Shi
Key points
From the paper's conclusion- The results highlight the significant advantage of leveraging structured software engineering knowledge to guide LLM reasoning for more accurate and reliable code smell detection.
Abstract
Code smells are indicators of poor design that hinder software maintainability. While existing detection methods range from rule‐based to machine‐learning approaches, they often struggle with generalizability and feature engineering issues. Recent attempts using large language models (LLMs) with simple prompts have shown limited success. This study proposes a novel framework that systematically integrates classic, empirically validated code smell detection strategies with LLMs through strategy‐level and ensemble prompt engineering. Evaluated on a refined version of the MLCQ data set, our framework demonstrates superior performance compared to state‐of‐the‐art classical machine learning, deep learning, and basic LLM approaches across key code smells including God Class, Feature Envy, Data Class, and Long Method. The results highlight the significant advantage of leveraging structured software engineering knowledge to guide LLM reasoning for more accurate and reliable code smell detection.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Software Refactoring Research with Large Language Models: A Systematic Literature ReviewarXiv · 2026
- Beyond Benchmarks: Evaluating Large Language Models and Agentic Patterns for Static Code Analysis Warning ClassificationarXiv · 2026
- Helping LLMs improve code generation using feedback from testing and static analysisDiscover Artificial Intelligence · 2026
- Modern Approaches to Software Vulnerability Detection: A Survey of Machine Learning, Deep Learning, and Large Language ModelsElectronics · 2025
- CQLLM: A Framework for Generating CodeQL Security Vulnerability Detection Code Based on Large Language ModelApplied Sciences · 2026
- Assessing and Improving Prompting Large Language Models for Software Vulnerability AnalysisACM Transactions on Software Engineering and Methodology · 2026