TestGRAD: Evolving Test Suites via Failure Pattern Momentum for SWE-Agent Ensemble
Pengfei He, Jiayuan Zhou, Shaowei Wang, Ruiqi Pan
Key points
From the paper's conclusion- We formulate this process as test-space optimization: evolving an executable repository test suite until it distinguishes competing patches.
Abstract
SWE-agent ensembles improve issue resolution by combining candidate patches from different agents with complementary strengths. The central problem is therefore test-based selection: generate tests, execute candidate patches, and identify the best patch. We formulate this process as test-space optimization: evolving an executable repository test suite until it distinguishes competing patches. Existing test-generation methods are limited optimizers. They usually lack an explicit loss for ensemble selection, optimize through incomplete directions that mostly create new tests or delete old ones, and perform one-off generation without feedback from repeated failures. Inspired by gradient descent with momentum, we introduce TestGRAD, a framework for automatic test optimization. TestGRAD centers on three concepts. Differential loss gives the optimizer an explicit execution-defined target: useful tests should separate candidate patches by behavior. Full CRUD gradients expand the update direction from merely creating or deleting tests to reading existing test infrastructure, creating new tests, updating stale assertions, and deleting only obsolete tests. Failure Pattern Momentum mines frequent failure sequences from memory, allowing the optimizer to avoid repeated non-discriminative directions while compressing the failure-history context. On SWE-bench Verified, TestGRAD achieves 84.2% Pass@1 with a 4-agent ensemble, outperforming the strongest baseline (80.6%) by an absolute improvement of 3.6 percentage points, while compressing failure-history context by over $100\times$.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- TestJack: Should you trust the results in coding benchmarks? Agentic Coding Benchmarks Auditing via Evaluator EvolutionarXiv · 2026
- Not All Correct Fixes Run Alike: An Empirical Study of Patch Performance in Repository-Level Issue ResolutionarXiv · 2026
- What Makes Good Data for Training Coding Agents? A Systematic Study on SWE-GymarXiv · 2026
- FC-SWE: Failure-Conditioned RL for Long-Horizon Software Engineering AgentsarXiv · 2026
- Maintaining Benchmarks Against Increasingly Capable Agents: Detection and Remediation of Unearned PassesarXiv · 2026
- Patch correctness in automated program repair: A five-dimensional evidence framework and cross-benchmark audit from classical repair to coding agentsarXiv · 2026