How effective are traditional test criteria at detecting bugs in large language models generated code?
- Source
- arxiv.org
- Author
- Asma Hamidi, Michael Konstantinou, Renzo Degiovanni, Mike Papadakis
- Date

Context
An AI-generated test can exercise faulty behavior and still report success if its expected result is wrong. This study examined 6,066 selected, harder-to-detect faulty Python implementations. Tests often supplied inputs that distinguished faulty code from a reference implementation, but their assertions failed to recognize the difference.
The researchers compared selecting tests by executed statements, exercised branches and detection of deliberately introduced code changes. Differences between those criteria were generally small beside the failure of the assertions themselves. For teams generating both code and tests with AI, the result directs to checking expected behavior: a test's reach through the code and its ability to recognize a wrong answer are separate properties.
- attention — The mechanism that lets a model weigh which earlier words matter for the word it's currently processing — the core operation of a transformer.
- LLM — A large language model — the neural network behind tools like Claude and ChatGPT, trained on huge amounts of text to predict what comes next.
“First, most faults introduced by LLMs are relatively trivial to catch.”
“Second, the challenging faults are difficult to trigger using either traditional coverage-based or mutation-based criteria.”
“Third, actual fault detection rates remain extremely low, often near zero, because test oracles fail to capture faulty behavior triggered by the generated test prefixes, exposing a critical limitation of automated test generation.”
“Fourth, prompt-aware oracles can improve fault detection, but their overall effectiveness remains limited, highlighting the need for users to manually reason about test assertions.”
articleAn Empirical Evaluation of Cost-Efficient Large Language Models on Algorithmic Programming TasksChandimal Adikari, Nandika Herath
articleCode Health in LLM-Based Test Generation: Effectiveness and Token EfficiencyFreya Wirdemann, Markus Borg, Nadim Hagatulah, Adam Tornhill
articleHow well LLM-based test generation techniques perform with newer LLM versions?Michael Konstantinou, Renzo Degiovanni, Mike Papadakis
Checking sign-in…
Loading comments…