How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Study
Alejandro Velasco, Daniel Rodriguez-Cardenas, Luftar Rahman Alif,, David N. Palacio, Denys Poshyvanyk

TL;DR
This study introduces CodeSmellEval, a benchmark with a new metric to assess how prone large language models are to generating code smells, revealing that current models often produce such undesirable code patterns.
Contribution
The paper presents a novel benchmark and metric for evaluating code smell propensity in LLM-generated code, filling a gap in current assessment methods.
Findings
Both models tend to generate code smells.
The benchmark effectively evaluates LLM reliability.
CodeSmellEval highlights models' tendencies to produce undesirable code patterns.
Abstract
Large Language Models (LLMs) have shown significant potential in automating software engineering tasks, particularly in code generation. However, current evaluation benchmarks, which primarily focus on accuracy, fall short in assessing the quality of the code generated by these models, specifically their tendency to produce code smells. To address this limitation, we introduce CodeSmellEval, a benchmark designed to evaluate the propensity of LLMs for generating code smells. Our benchmark includes a novel metric: Propensity Smelly Score (PSC), and a curated dataset of method-level code smells: CodeSmellData. To demonstrate the use of CodeSmellEval, we conducted a case study with two state-of-the-art LLMs, CodeLlama and Mistral. The results reveal that both models tend to generate code smells, such as simplifiable-condition and consider-merging-isinstance. These findings highlight the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Software Engineering Research
MethodsFocus
