Specification Grounding Drives Test Effectiveness for LLM Code
When an LLM writes code, then tests, then fixes the code until the tests pass, the tests are usually guessing at what the code is supposed to do. This paper shows the fix is one prompt line: paste the task's requirements into the test-writing prompt as a numbered checklist, one test per requirement. That beats every brute-force alternative — 38 points more correct code on every Claude tier (GPT +28, Gemini +19), while doubling the test budget or generating 8 independent test suites barely moves the needle. Tests that could see the spec caught 27 of 30 real bugs; tests written from a careful plan without it caught 2. And they stopped failing correct code: false alarms fell from 33% to zero.