Beyond Coverage and Mutation: A Blind-Spot Analysis of LLM-Generated Unit Tests
Abstract
Existing evaluation protocols for unit tests rely on aggregate metrics such as branch coverage and mutation score. These metrics quantify the extent to which a test suite exercises program behavior, but do not identify the behavioral obligations it systematically leaves unchecked. We propose BlindSpotEval, an obligation-based evaluation framework aligned with the Arrange-Act-Assert pattern. The framework comprises three metrics, Boundary-Value Adequacy, Control-Flow Adequacy, and Oracle Strength, complemented by an assessment of execution reliability. We also introduce ObligBench, a complexity-stratified Java benchmark comprising 895 complex and 700 low-complexity functions with source-side obligation annotations. Evaluating 14,320 tests from four LLMs under four prompting strategies reveals systematic blind spots. Incorrect assertions account for 15.6% of test failures, illustrating that coverage alone does not establish oracle correctness. Among executable tests, coverage of null, negative, and empty arguments reaches only 34.8%, 23.8%, and 38.8%, compared with average coverage above 93% for booleans. Catch blocks and default groups have Control-Flow Adequacy scores of only 0.100 and 0.312. Across both dimensions, LLM-generated tests exhibit the happy-path bias observed in human-written tests, concentrating on normal inputs and expected flows while leaving unusual values and exceptional paths unchecked. Oracle strength is high on average but uneven, with weaker assertions for object return property values and exceptions. These blind spots also occur in low-complexity functions, suggesting that code complexity alone does not explain them. BlindSpotEval provides construct-level adequacy profiles that identify under-tested obligation types and can guide targeted improvements beyond those supported by aggregate scores alone.
Create a lesson
Related papers
Beyond Passing Tests: A Systematic Review and Controlled Re-evaluation of Techniques for Improving the Quality of LLM-Generated Code
Shared title terminologycs.SEPrashank Kadam
Can AI Guide Testing Without Generating Tests? A Comparative Study of AI-Assisted Unit Testing
Shared title terminologycs.SEZihan Fang, Ron Asoulin-Handelman, Helen Wu et al.
Spec-Test Coverage Gap: Detecting Overspecified Tests in SWE-Bench-Style Benchmarks
Shared title terminologycs.SEAvi Aggarwal, Yiran Hu
From Observation to Explanation: Mechanistic Interpretability of LLM-Generated Code for Principled Repair
Shared title terminologycs.SEMusfiqur Rahman
Can Coding Agents Write and Transpile Unit Tests
Shared title terminologycs.SEGil Pasternak, AJ Langley, Tom Yotam et al.
How Specification Explicitness Shapes Failure in LLM-Generated Code
Shared title terminologycs.SEElmira Onagh, Maleknaz Nayebi