Evaluating the Robustness of LLM-Generated Tests via Mutation Analysis
Master's thesis investigating whether LLMs can generate test suites robust enough to detect bugs using mutation testing as ground truth.
- The problem
- High coverage can still miss bugs. Does LLM tests' coverage change on buggy code?
- What I did
- Compared the coverage of 9 LLMs' Java tests on original code and copies with one small bug.
- What I found
- On the buggy copies, branch coverage was only 1.2 points lower on average, from 90.8%.
- The limit
- I measured coverage, not test failures, so whether the tests catch bugs is unknown.
Each mutant changes one operator in a Java program. Nine LLMs wrote tests from the original or from the mutant, and each suite's branch coverage was measured on both programs.
Mutants come from the Universal Mutator with custom Comby rules, covering five operator types. Coverage is JaCoCo branch coverage.
Redrawn from Figures 1–2; terms from the result tables.
With one small bug injected, the branch coverage of LLM-written tests was only 1.2 points lower on average than the 90.8% on the original.
A net mean over nine LLMs, for tests written from the original code: rises and falls offset each other.
'Mutation Operator Analysis' and 'LLM Branch Coverage Performance' tables. Mean computed.
Tests written from the mutant had a smaller net coverage difference on average (0.42 vs 1.19 points). Ignoring sign, it was smaller for 7 of 9 LLMs.
Left of zero, the tests covered more of the mutant than of the original. No spread or repeat runs are shown.
'LLM Branch Coverage Performance' table. Means and counts computed.
Conditional and arithmetic mutants moved coverage most; shift mutants did not move it at all.
Each row averages nine LLMs; the source table counts 5 per operator.
'Mutation Operator Analysis' table.
Branch coverage moved in 13 of 16 model–mutant pairs, but test failures were not measured, so none can be counted as a caught bug.
Signs come from comparing the original and mutant coverage columns. Gemini is Gemini 2.0 Flash.
'Java Mutation Detection Analysis' table. Counts computed.



































































































