# Spec-Test Coverage Gap: Detecting Overspecified Tests in SWE-Bench-Style Benchmarks

> Overspecified tests in SWE-bench-style benchmarks reject functionally correct fixes in 23-35% of tasks, deflating agent leaderboard scores by up to 12 percentage points.

- **Source:** [arXiv](https://arxiv.org/abs/2611.31839)
- **Published:** 2026-11-28
- **Permalink:** https://picx.dev/p/6KPx3V
- **Whiteboard:** https://picx.dev/p/6KPx3V/image

## Summary

# Spec-Test Coverage Gap: Detecting Overspecified Tests in SWE-Bench-Style Benchmarks

## Summary (Overview)

- **Core contribution**: The paper introduces the **Spec-Test Coverage Gap (STCG)**, a 1–4 scale for measuring test overspecification in SWE-bench-style benchmarks, where evaluation tests reject functionally correct fixes because they enforce details the task specification never states.

- **Detection method**: A two-judge LLM panel (Claude Opus 5.5 and GPT-6.1 Sol) scores each task from only the specification and test patch, flagging a task as overspecified when both judges rate it 3 or higher.

- **Key findings on prevalence**: The panel flags **23% of SWE-bench Verified** (117/500) and **35% of public SWE-bench Pro** (258/731) tasks as overspecified.

- **Impact on agent performance**: Flagged tasks are dramatically harder for agents—top 30 Verified submissions resolve only **31% of flagged tasks** on average versus **88% of unflagged tasks**.

- **Executable confirmation**: After relaxing flagged tests, **61% of 2,186 failed patches** pass, suggesting that counting these as resolved would add 33–60 tasks to each top-30 submission, raising resolve rates by up to 12 percentage points.

## Introduction and Theoretical Foundation

### Background

SWE-bench-style benchmarks (SWE-bench [1], SWE-bench Verified [2], SWE-bench Pro [3]) evaluate coding agents by running tests derived from the pull request that originally fixed each GitHub issue. The fundamental problem: these tests were written to confirm that *one specific fix* works, not to accept *every* correct fix. When a test checks details the specification leaves open—exact error message wording, sentinel return values, private helper behavior—an agent can correctly resolve the reported problem yet still be graded as failing.

### Two Directions of Test-Based Grading Errors

| Direction | Problem | Prior Work |
|-----------|---------|------------|
| **Too weak** | Accepts wrong patches, inflates scores | UTBoost [4], SWE-ABS [5], PatchDiff [6]—generating adversarial/additional tests |
| **Too strict** | Rejects correct patches, deflates scores | Human audits only; no automated detection |

### Why Overspecified Tests Are Hard to Detect

1. **No executable proof**: A wrong patch passing exposes a weak test, but a failing patch proves nothing alone—it may be wrong or correctly rejected.
2. **Scarce labels**: Expert review is expensive, so few labeled tasks exist for validation.
3. **Repairs can weaken tests**: Loosening a strict test may also let wrong patches through.

### Key Examples of Overspecification

> **django-16667**: The issue asks that SelectDateWidget not crash with OverflowError on large years. The test requires `value_from_datadict` to return exactly `"0-0-0"`—a detail the issue never specifies. A fix returning the submitted values stops the crash but fails the test.

> **django-13794**: The issue asks that the `add` template filter concatenate strings with lazy strings. The test requires two lazy integer proxies to be addable with `+`—a different feature entirely.

### Prior Human Audit Evidence

- OpenAI reports **at least 59.4%** of the 138 Verified tasks its o3 model fails have tests rejecting functionally correct submissions [7].
- **~30%** of public Pro tasks are estimated broken, with overly strict tests among main causes [8].
- SWE-Bench Pro Verified found 75 tasks repaired for overly narrow tests among 119 reported problem tasks [9].

## Methodology

### STCG Definition

A task consists of a **specification** (everything the agent is told) and two test sets:
- **Evaluation tests (FAIL_TO_PASS)**: Must fail before the fix and pass after—STCG rates only these.
- **Regression tests (PASS_TO_PASS)**: Must pass both before and after.

The core question posed to judges:

> *Picture competent developers who work in this repository, have read the specification, and have seen neither the tests nor the original fix. Each writes a correct fix. Would every such fix pass the evaluation tests?*

### The STCG Scale

| Score | Meaning |
|-------|---------|
| **1** | **Directly specified**—tests check behavior the specification describes near-verbatim |
| **2** | **Reasonably specified**—tests add only what a careful reader would infer (standard exception types, existing patterns, related inputs) |
| **3** | **Mildly overspecified**—tests pin one valid choice among several (exact message, order, specific value) |
| **4** | **Significantly overspecified**—tests check *how* the fix was written (sentinel values, internal state, private methods, new names) |

### Judge Design

**Input**: Only what an agent sees plus tests—the issue text (plus requirements/interface fields for Pro), evaluation test names with Python definition locations. The judge does **not** see the repository or reference fix.

**Prompt**: States the core question, defines "reasonable fix," provides the 4-point scale with examples and tie-breaking rules. The judge must:
1. Enumerate requirements imposed by evaluation tests
2. Classify each as *specified*, *established by convention*, or *left open*
3. Describe a reasonable correct fix violating each open requirement

**Panel aggregation**: Both judges must flag (score ≥ 3) for a task to be flagged. The final score is the **lower** of the two. Tasks with score spread ≥ 2 are marked "uncertain."

### Validation Protocol

Validation sets built from existing annotations (no new manual labeling):

| Set | Label | Source | Tasks |
|-----|-------|--------|-------|
| `openai_excluded` | overspecified | SWE-bench tasks excluded from Verified (all 3 annotators said tests reject valid fixes) | 112 |
| `pro_narrow_original` | overspecified | Pro tasks later repaired for overly narrow tests (original versions) | 75 |
| `agent_consensus` | fine | Verified tasks all 3 annotators rated fine, ≥90% of top submissions resolve with differing patches | 157 |

**Split**: 40% dev (138 tasks) for prompt development, 60% test (206 tasks) scored once with frozen prompt. Pre-registered targets: recall ≥ 70%, false-flag rate ≤ 15%.

### Executable Confirmation Methodology

1. **Candidate patches**: Failed patches from top 30 Verified submissions with ≥1 failing evaluation test and **no** failing regression test (2,186 candidates on 108 flagged tasks).
2. **Relaxer** (Claude Opus 5.5): Edits flagged tasks' tests to accept other reasonable fixes, constrained to test-patch edits only, never seeing agent patches.
3. **Checks**: Relaxed tests must (a) still fail on unfixed repo, (b) pass reference fix, (c) pass original resolving patches. Up to 3 retry attempts.
4. **Controls**: Same procedure on 296 unflagged tasks (79 with candidates, 417 candidates) using forced-loosen and no-findings prompts.

## Empirical Validation / Results

### Validation Accuracy (Test Split, 206 tasks)

| Scorer | Recall (overspecified) | False-flag rate |
|--------|------------------------|-----------------|
| **Panel (both judges)** | **89%** (100/112; 82–94%) | **4%** (4/94; 2–10%) |
| Claude alone | 89% (100/112) | 4% (4/94) |
| GPT alone | 94% (105/112) | 18% (17/94) |

- Judge agreement: **91%** of test tasks (κ = 0.82)
- Recall by source: **97%** (65/67) on `openai_excluded`, **78%** (35/45) on `pro_narrow_original`
- The panel's "both must flag" rule removes most false flags at little recall cost

### Prevalence Results

| Metric | Verified | Pro (public) |
|--------|----------|--------------|
| **Flagged by 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 |
| Uncertain (spread ≥ 2) | 11% (57/500) | 10% (71/731) |

### Agent Performance Gap on Verified

- Flagged tasks: **31%** mean resolve rate among top 30 submissions
- Unflagged tasks: **88%** mean resolve rate
- Flag rate falls from 85% (tasks no submission resolves) to 5% (tasks ≥90% resolve)
- **At every difficulty level**, flagged tasks have mean resolve rates >50 percentage points below unflagged tasks

### Executable Confirmation Results

| Condition | Flagged tasks | Control (unflagged) |
|-----------|---------------|---------------------|
| **Prompt** | with findings | forced | no findings |
| Valid relaxations | 93/108 | 76/79 | 0/79 |
| Declined | 15 | 1 | 79 |
| **Flip rate (all candidates)** | **61%** | **29%** | **0%** |
| 95% CI | 52–69% | 13–45% | — |
| Tasks with no flip | 22/108 | 60/79 | 79/79 |

Key observations:
- Control flips concentrate in just 5 tasks (96 of 120 flips); inspection shows these are cases where patches miss related cases, not missed overspecification.
- On flagged tasks, flip rate is stable across relaxation sizes (77%, 74%, 66% for 1–5, 6–15, 16+ lines).
- Score impact: each top-30 submission would gain 33–60 tasks (median 45); 28 of 30 would change rank by up to 10 places.

### Ablation Results (Dev Split)

| Prompt variant | Recall | False flags | κ | Flags changed |
|----------------|--------|-------------|-----|---------------|
| Full prompt | 81% (61/75) | 3% (2/63) | 0.78 | — |
| Identical rerun | 80% (60/75) | 5% (3/63) | 0.77 | 6 |
| + reference fix | 87% (65/75) | 5% (3/63) | 0.87 | 5 |
| One-paragraph baseline | 72% (54/75) | 6% (4/63) | 0.78 | 9 |

## Theoretical and Practical Implications

### Theoretical Significance

- **Formalizes a previously informal concept**: STCG provides the first operational definition of test overspecification with a measurable error rate, moving beyond expert-review-only identification.
- **Demonstrates detectability from text alone**: The judge needs only the specification and tests—no repository, no reference fix, no execution—yet achieves 89% recall with 4% false flags.
- **Quantifies benchmark quality at scale**: The finding that roughly a quarter to a third of tasks in leading benchmarks are overspecified challenges the validity of leaderboard comparisons, especially at the top end where agents are differentiated by their handling of these tasks.

### Practical Implications

- **Benchmark maintenance**: Provides a cheap, automated screening tool for detecting overspecified tests before they enter benchmarks, complementing human review.
- **Leaderboard interpretation**: The 33–60 task gains per submission (up to 12 percentage points in resolve rate) suggest current leaderboards systematically understate agent capability.
- **Agent evaluation fairness**: The 61% flip rate on flagged tasks indicates a substantial fraction of "failures" are actually correct solutions rejected by overly narrow tests.
- **Repair guidance**: The 1–4 scale distinguishes mild (score 3) from significant (score 4) overspecification, informing how much repair effort is needed.

## Conclusion

### Main Takeaways

1. **Overspecified tests are detectable**: The two-judge panel flags 89% of known-overspecified tasks and only 4% of known-fine tasks on held-out data.
2. **Overspecified tests are common**: ~23% of Verified and ~35% of Pro tasks are flagged.
3. **Flagged tasks are much harder for agents**: 31% vs. 88% resolve rates on flagged vs. unflagged tasks.
4. **Execution confirms the flags**: 61% of failed patches pass relaxed tests on flagged tasks vs. 29% on forced-loosened controls.

### Future Directions

1. **The other repair**: Adding missing requirements to the specification (rather than loosening tests) and measuring how much agents improve when told what tests expect.
2. **Contamination analysis**: Since flagged tests require unstated details, agents passing them must guess, infer from repository, or recall from training—comparing models' ability to reproduce these details across release dates would separate recall from inference.
3. **Coverage expansion**: Confirming flags by execution on Pro, running the panel on other benchmarks, and comparing with SPICE on identical tasks.

### Key Limitations

- No known-fine Pro tasks exist, so false-flag rates on Pro are unmeasured.
- Validation sets contain clear cases; borderline accuracy is unknown.
- A flip is not proof of correctness—score changes are upper bounds.
- Checks validate relaxations from only one side (may be looser than warranted).
- The relaxer shares a model with one judge, introducing potential dependence.

---

_Markdown view of https://picx.dev/p/6KPx3V, served by PicX — AI-generated visual whiteboard summaries of research papers._
