Spec-Test Coverage Gap: Detecting Overspecified Tests in SWE-Bench-Style Benchmarks
Organizations: Purdue University
Abstract
SWE-bench-style benchmarks, such as SWE-bench Verified (Verified) and SWE-bench Pro (Pro), evaluate coding agents with tests taken from the change that originally fixed each issue. However, these tests can enforce details the task never states, causing correct alternative fixes to fail. Such overspecified tests have so far been found mainly through expensive expert review. To address this, we define the Spec-Test Coverage Gap (STCG), a 1-4 scale measuring overspecification, and score it with two LLM judges, Claude Opus 5.5 and GPT-6.1 Sol, which are given the specification and the test patch. A task is flagged as overspecified when both judges score it 3 or higher. Our study has three parts. First, we validate the judges on 206 tasks that earlier human audits and agent results label as overspecified or fine. Second, we apply STCG to all 500 Verified and 731 public Pro tasks and compare the flags with the results of the top 30 Verified submissions. Third, we verify the flags by asking Claude Opus 5.5 to loosen the overspecified requirements of flagged tasks, and regrade 2,186 failed patches from those submissions. Our main findings are: (1) Overspecified tests are detectable: on the validation tasks, the judges correctly flag 89% of the tasks that human audits identify as overspecified and wrongly flag only 4% of the tasks known to be fine. (2) Overspecified tests are common: applied to whole benchmarks, the judges flag 23% of Verified and 35% of Pro tasks. (3) Flagged tasks are much harder for agents: the top 30 Verified submissions resolve only 31% of the flagged tasks on average, against 88% of the other tasks. (4) Overspecified tests change the leaderboard: relaxing the tests lets 61% of the 2,186 failed patches on flagged tasks pass. Counting these patches as resolved would add 33 to 60 tasks to each top-30 submission, raising resolve rates by up to 12 percentage points.
Figures & tables
| Task | The issue asks for | The evaluation test requires | Why it is overspecified |
|---|---|---|---|
| django-16667 | SelectDateWidget should not crash with OverflowError when a request supplies a very large year, month or day. | value_from_datadict returns exactly the string "0-0-0" for such input. | The issue never says what to return. A fix that returns the submitted values, as the widget already does for other invalid dates, stops the crash but fails the test. |
| django-13794 | The add template filter should concatenate a string with a lazy string instead of returning an empty string. | Two lazy integer proxies can be added with + . | The issue is only about the filter. A fix inside the filter passes the filter tests but fails this one, which needs + support on Django’s lazy objects. |
| Score | Meaning |
|---|---|
| 1 | Directly specified. The evaluation tests check the behavior the specification describes, or its reproduction example, near-verbatim. |
| 2 | Reasonably specified. The tests add only what a careful reader would infer: a standard exception type, an existing pattern, the same function on related inputs. |
| 3 | Mildly overspecified. The tests check observable behavior but pin one valid choice among several, such as an exact message, an order, or a specific value. |
| 4 | Significantly overspecified. The tests check how the fix was written: a sentinel value, internal state, a private method, a new name the specification never mentions, or a different code path than the one the specification implicates. |
| Set | Label | Source | Tasks | Dev | Test |
|---|---|---|---|---|---|
| openai_excluded | overspecified | SWE-bench tasks left out of Verified; all three annotators said the tests may reject valid fixes | 112 | 45 | 67 |
| pro_narrow_original | overspecified | SWE-bench Pro tasks later repaired for overly narrow tests (original versions) | 75 | 30 | 45 |
| agent_consensus | fine | Verified tasks all three annotators rated fine, resolved by 90% of top submissions with differing patches | 157 | 63 | 94 |
| Total | 344 | 138 | 206 |
| Scorer | Recall, all overspecified | openai_excluded | pro_narrow_original | False-flag rate |
| Dev split (138 tasks) | ||||
| Panel (both judges flag) | 81% (61/75; 71–89%) | 87% (39/45) | 73% (22/30) | 3% (2/63; 1–11%) |
| Claude alone | 83% (62/75; 73–90%) | 89% (40/45) | 73% (22/30) | 3% (2/63; 1–11%) |
| GPT alone | 88% (66/75; 79–94%) | 89% (40/45) | 87% (26/30) | 17% (11/63; 10–29%) |
| Test split (206 tasks) | ||||
| Panel (both judges flag) | 89% (100/112; 82–94%) | 97% (65/67) | 78% (35/45) | 4% (4/94; 2–10%) |
| Verified | Pro (public) | |
| Tasks | 500 | 731 |
| Flagged by the panel | 23% (117/500) | 35% (258/731) |
| 95% CI | 20–27% | 32–39% |
| score 3 (mild) | 78 | 143 |
| score 4 (significant) | 39 | 115 |
| between judges | 0.61 | 0.62 |
| Prompt | Recall | False flags | Recall, one judge | Uncertain | Flags | ||
|---|---|---|---|---|---|---|---|
| Claude | GPT | changed | |||||
| Full prompt | 81% (61/75) | 3% (2/63) | 83% | 88% | 0.78 | 10 | – |
| Full prompt, identical rerun | 80% (60/75) | 5% (3/63) | 81% | 88% | 0.77 | 12 | 6 |
| Full prompt + reference fix | 87% (65/75) | 5% (3/63) | 87% | 88% | 0.87 | 5 | 5 |
| One-paragraph baseline | 72% (54/75) | 6% (4/63) | 81% | 77% | 0.78 | 4 | 9 |
| Both judges flag | Neither judge flags | |||
| with findings | no findings | forced | no findings | |
| Tasks | 108 | 108 | 79 | 79 |
| Candidate patches | 2,186 | 2,186 | 417 | 417 |
| Valid relaxations | 93 | 82 | 76 | 0 |
| Declined | 15 | 26 | 1 | 79 |
| Lines changed, median | 11 | 10 | 5 | – |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Difficulty | Tasks | Flagged | Mean resolve rate | |
|---|---|---|---|---|
| flagged | not flagged | |||
| 15 min fix | 194 | 13% (26/194; 9–19%) | 41% | 93% |
| 15 min - 1 hour | 261 | 25% (65/261; 20–30%) | 32% | 85% |
| 1 hour | 45 | 58% (26/45; 43–71%) | 16% | 68% |
| Resolved by | Flagged | Control, forced |
|---|---|---|
| 0% of top 30 | 73% (545/745) | 0% (0/30) |
| 1-50% of top 30 | 72% (696/969) | 42% (75/178) |
| 51-89% of top 30 | 69% (82/118) | 26% (32/125) |
| 90% of top 30 | 62% (8/13) | 30% (13/44) |
| Task | The issue asks for | Original test and relaxed test | A patch that flips |
|---|---|---|---|
| django-11790 (22 of 23) | The username field of AuthenticationForm should render the maxlength HTML attribute again. | Original: widget.attrs[’maxlength’] equals the integer 255. Relaxed: the rendered field contains maxlength="255" . | Stores the string ’255’ , as Django’s own CharField does. The rendered HTML is the same as with the reference fix. |
| django-12308 (20 of 20) | A JSONField shown read-only in the admin should display valid JSON, not a Python dict. The issue proposes calling the field’s prepare_value . | Original: besides the valid-JSON cases, a dict with a tuple key, which cannot be stored as JSON, must display as its Python repr . Relaxed: that case is removed. | Calls the form field’s prepare_value , as the issue proposes. It raises TypeError on the tuple-key dict. |
| pylint-4661 (30 of 30) | Stop storing data in ~/.pylint.d and follow the XDG specification, which puts data in ~/.local/share/<program> . | Original: PYLINT_HOME equals appdirs.user_cache_dir("pylint") , the cache directory. Relaxed: an absolute path that names pylint and is neither ~/.pylint.d nor directly in the home directory. | Uses ~/.local/share/pylint , the location the issue names. No top-30 submission resolves the original task. |
| Submission | Resolved | Flips | After | Rank | Rank after |
|---|---|---|---|---|---|
| 20251205_sonar-foundation-agent_claude-opus-4-5 | 396 | 41 | 437 | 1 | 3 |
| 20251215_livesweagent_claude-opus-4-5 | 396 | 38 | 434 | 1 | 4 |
| 20250928_trae_doubao_seed_code | 394 | 45 | 439 | 3 | 1 |
| 20251127_openhands_claude-opus-4-5 | 388 | 44 | 432 | 4 | 5 |
| 20251120_livesweagent_gemini-3-pro-preview | 387 | 43 | 430 | 5 | 7 |
| 20250804_epam-ai-run-claude-4-sonnet | 384 | 38 | 422 | 6 | 10 |
| Repository | Tasks | Flagged | Score 3 | Score 4 |
|---|---|---|---|---|
| django/django | 231 | 20% (46/231; 15–26%) | 33 | 13 |
| sympy/sympy | 75 | 31% (23/75; 21–42%) | 17 | 6 |
| sphinx-doc/sphinx | 44 | 25% (11/44; 15–39%) | 9 | 2 |
| matplotlib/matplotlib | 34 | 26% (9/34; 15–43%) | 3 | 6 |
| scikit-learn/scikit-learn | 32 | 25% (8/32; 13–42%) | 4 | 4 |
| astropy/astropy | 22 | 27% (6/22; 13–48%) | 5 | 1 |
| Repository | Tasks | Flagged | Score 3 | Score 4 |
|---|---|---|---|---|
| ansible/ansible | 96 | 43% (41/96; 33–53%) | 27 | 14 |
| internetarchive/openlibrary | 91 | 21% (19/91; 14–30%) | 10 | 9 |
| flipt-io/flipt | 85 | 42% (36/85; 32–53%) | 12 | 24 |
| qutebrowser/qutebrowser | 79 | 30% (24/79; 21–41%) | 17 | 7 |
| gravitational/teleport | 76 | 46% (35/76; 35–57%) | 9 | 26 |
| protonmail/webclients | 65 | 34% (22/65; 24–46%) | 16 | 6 |
| Run | Calls | Input tokens (M) | Output tokens (M) | Cost |
|---|---|---|---|---|
| Judge panel, all tasks | 2,686 | 13.37 | 3.32 | $94 |
| Ablation: identical rerun | 276 | 1.23 | 0.31 | $9 |
| Ablation: with reference fix | 276 | 1.93 | 0.31 | $11 |
| Ablation: baseline prompt | 276 | 0.79 | 0.19 | $6 |
| Relaxer, with findings | 110 | 0.56 | 0.23 | $7 |
| Relaxer, no findings (both groups) | 199 | 0.86 | 0.25 | $8 |