WitnessGym: Benchmarking Coding Agents on the Construction of Bug Witnesses
Haomin Qi, Xiangzhe Xu, Yiming Huang, Jingbo Shang, Chengpeng Wang
Abstract
Bug validation asks a coding agent to produce an executable witness for a reported bug. The witness combines a concrete input with a testing harness and exposes faulty behavior during execution. Such evidence makes audit findings actionable, yet benchmark evaluation is difficult when cases reuse public historical bugs and witnesses or require manual construction. We present WitnessGym, an automated framework for constructing bug-validation benchmarks through bug injection. It injects bugs into test-reached paths of real projects, rebuilds each project, and retains cases exposed by a construction-time witness. Bug specifications and execution adapters allow extension to additional bug types and languages. Bug-preserving transformations vary the surrounding structure while preserving the witness behavior. Based on real-world Java projects with test suites, WitnessGym automatically constructs 1,300 benchmark cases. The injected patches resemble historical bug patches and are difficult for the two evaluated models to distinguish in blinded comparisons. We evaluate four coding agent frameworks in six framework/model pairings across bug types, execution contexts, and transformation depths. Witness construction remains difficult even when the bug pattern is known. Our framework, benchmark cases, and evaluation scripts are available.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- 30 pages, 8 figures, and 12 tables, including appendices
Related papers
SheetCraft: Fine-Tuning Code Agents for Execution-Guided Spreadsheet Reasoning and Construction
Shared title terminologycs.SEZuowei Zhang, Xiaotian Li, Siyuan Li et al.
TestJack: Should you trust the results in coding benchmarks? Agentic Coding Benchmarks Auditing via Evaluator Evolution
Shared title terminologycs.SEShuangjie Yao, Hao Wang, Koushik Sen et al.
Correct Code, Broken Contributions? SWE-CC: Benchmarking Repository Policy Compliance for Coding Agents
Shared title terminologycs.SEHai Dang Truong, Rayner Goh, Thanh Le-Cong et al.
WebUIProof: Benchmarking WebUI Code Generators with UI-Agent Execution Harness
Shared title terminologycs.SEYun-Yun Tsai, Yuning Mao, Shiqi Wang et al.
Identical Runs, Different Results: Benchmarking AI Coding Agents on Open-Weight Models
Shared title terminologycs.SEEduardo Ariño de la Rubia, Szilard Pafka
Compact Documentation for Coding Agents: A Benchmark, an Optimizer, and Why It Does Not Transfer
Shared title terminologycs.SEMd Shohel Arman, Igor Molybog