arXiv:2610.18004cs.SEOct 2026

Manuscript Offprint

arXiv:2610.18004

SWEPatchTest: Evaluating Software Tests Beyond Reproduction

Hua Lu, Pengcheng Wang, Han Li, Zichen Tian, Yanyu Chen, Huang He, Bingjin Chen

ABSTRACT

Coding agents use generated tests to decide whether a proposed patch satisfies an issue’s requirements. A suite that fails on the buggy program and passes after applying the reference patch can still accept an incorrect patch or reject a correct patch. We introduce SWEPATCHTEST 1^{1}, a test-generation benchmark with 619 tasks from SWE-bench Pro, SWE-bench Multilingual, and DeepSWE and 82,579 candidate patches collected from coding-agent trajectories. By replaying each suite on the buggy and patched codebases, SWEPATCHTEST jointly measures issue reproduction, acceptance of correct patches, and rejection of incorrect patches. Joint Validation Rate (JVR), which requires all three criteria on the same task, exposes failures hidden by single-reference evaluation: the best-performing configuration achieves only 9.21% JVR despite reproducing the reference transition on 59.29% of tasks. We further use validation scores to select and scale demonstrations for supervised fine-tuning (SFT). The resulting training recipe approximately triples JVR and improves downstream repair across three SWE-bench benchmarks. Patch discrimination thus provides both a diagnostic measure of test quality and an execution-based signal for curating agent training data.

1 INTRODUCTION

Large language model (LLM) coding agents address software issues by exploring repositories, editing code, and using execution feedback to revise their patches (Yang et al., 2024; Xia et al., 2024; Wang et al., 2025b; Li et al., 2026b). SWE-bench and SWE-bench Pro assess the resulting patches with executable test suites (Jimenez et al., 2024; Deng et al., 2025). During repair, however, agents generate their own tests to distinguish correct patches (passing official evaluation) from incorrect patches (Pan et al., 2026).

Limitations of existing benchmarks. Table 1 contrasts the scale, language coverage, and evaluation criteria of test-generation (TestGen) benchmarks. Pool sizes exclude reference patches and include mutants as negative candidates; checks denote unreported sizes, and crosses denote no pool in the main evaluation. SWT-Bench and TDD-Bench Verified evaluate generated suites through a fail-to-pass (F2P) transition: failure on the buggy program followed by success on the reference patch (Mündler et al., 2024; Ahmed et al., 2024). This establishes reference recognition but leaves two complementary requirements untested: (i) accepting correct patches and (ii) rejecting incorrect patches. We refer to implementation-dependent rejection of correct patches as solution bias and insufficient checking of required behavior as weak specification; either can coexist with a successful reference transition.

Test-suite overfitting lets patches satisfy available tests while retaining faults (Smith et al., 2015). Evaluating both candidate classes reveals whether a test captures the issue’s requirements beyond one reference patch. Prior work already uses generated tests for patch filtering and evaluates suites

∗^{*}These authors contributed equally to this work.

†^{\dagger}Corresponding authors: Huang He and Bingjin Chen.

1^{1}Our data are available at

https://huggingface.co/datasets/anonymous-swepatchtest/SWEPatchTest.

against multiple patches or mutations (Mündler et al., 2024; Sonwane et al., 2026; Sun et al., 2026). We ask how reliably these tests accept correct patches and reject incorrect patches drawn from diverse coding-agent trajectories.

Table 1: Comparison of test-generation benchmarks.

BenchmarkF2PCorrect poolIncorrect poolJoint ValidationTasksTest scaleMultilingual
TestEval✕✕✕✕210Function✕
TestGenEval✕✕✓✕1,210File✕
CLOVER✕✕✕✕845Block/file✕
MultiFileTest✕✕✕✕60Multi-file3
SWT-Bench✓✕✕✕1,983Repo.✕
TDD-Bench Verified✓✕✕✕449Repo.✕
OmniCode✕✕1,109✕396Repo.3
SWE-Mutation✓✕2,636✕800Repo.10
SWEPATCHTEST✓27,74954,830✓619Repo.10

SWEPATCHTEST: from one reference to a patch distribution. SWEPATCHTEST pairs 619 tasks from SWE-bench Pro, SWE-bench Multilingual, and DeepSWE with candidate patches (Deng et al., 2025; Yang et al., 2025b; Huang et al., 2026). We select tasks with suitable reference tests and nontrivial reproduction difficulty, then collect and deduplicate patches from diverse model and agent configurations. The benchmark contains 82,579 candidate patches, split into correct and incorrect pools; Section 2 reports the class counts.

Each generated suite is replayed on the buggy codebase and codebases obtained by applying the reference or each candidate patch to check (i) issue reproduction, (ii) correct-patch acceptance, and (iii) incorrect-patch rejection. Gold Recognition Rate (GRR), Correct Patch Acceptance Rate (CAR), and Wrong Patch Detection Rate (WDR) measure these requirements, respectively. Complete-task rates require success on every candidate in a class; we propose Joint Validation Rate (JVR) to require both complete acceptance and complete rejection together with reference recognition on the same task. Figure 1 summarizes these measures and their harmonic means, separating recognition of the reference patch from discrimination over candidate patches. The radar axes start at zero and scale linearly to the labeled percentage limits; all panels share model IDs and colors, with abbreviations listed in Appendix C.3.

Takeaways. We evaluate 12 coding-agent configurations and investigate whether patch-discrimination scores can guide supervised fine-tuning (SFT), yielding three takeaways. ① Joint validation exposes failures hidden by reference recognition. Even the strongest configuration achieves JVR of only 9.21%, compared with its 59.29% GRR, revealing weaknesses that single-reference evaluation leaves unexamined. ② Rejecting incorrect patches does not ensure reliable validation. The configuration with the highest WDR (88.57%) accepts only 50.20% of correct patches, revealing why test quality must account for both failure detection and acceptance of correct patches. ③ Validation-guided test-generation improves both testing and repair. Selecting and scaling test-generation supervision approximately triples JVR on SWEPATCHTEST and achieves competitive performance across downstream repair benchmarks.