Concurrency and Computation: Practice and Experience

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

Enhancing LLM‐Based Code Smell Prediction Using Empirical Detection Strategies — Science Skim