atlas

Research map / Large language models / Agents, code and math

SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents

NeurIPS 2024 · Large language models › Agents, code and math · approach: Software engineering agents

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces SWT-Bench, a benchmark transforming SWE-Bench into issue-reproducing test generation, and evaluates LLM prompting methods and adapted Code Agents, finding agents outperform specialized test generators and generated tests can filter fixes to double precision.

Problem

Automatic generation of tests that reproduce GitHub issues in Python is underexplored; existing test generation methods are limited in scale, language coverage, and are not designed for issue reproduction with Code Agents.

Approach

Repurpose code-repair tasks as test-generation tasks: a generated test counts as successful if it fails before the golden patch and passes after (fail-to-pass), with change coverage of golden-patch lines as a finer metric; adapt existing Code Agents (SWE-Agent, aider, AutoCodeRover) by changing their instructions to write tests, and introduce a fault-tolerant diff format.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace unified diff with the custom fault-tolerant diff format (ablation)ZeroShot test generation · SWT-Bench-Litesuccess rate: 3.6 -> 9.4Helped
Instruct the agent to execute generated tests before submitting (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9% to 18.5%Helped
Provide the test file to change instead of BM-25 retrieved files (ablation)ZeroShotPlus · SWT-Bench-Litesuccess rate: 8.1% to 15.1%Helped
Provide the golden code patch and its modified files (ablation)ZeroShotPlus · SWT-Bench-Litesuccess rate: 8.1% to 10.5%Helped
Provide an incorrect code patch and its modified files (ablation)ZeroShotPlus · SWT-Bench-Litesuccess rate: 8.1% to 10.5%Helped
Use Mistral Large 2 instead of GPT-4 (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9 -> 16.3Helped
Use Claude 3.5 Sonnet instead of GPT-4 (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9 -> 12.3Hurt
Use GPT-4o mini instead of GPT-4 (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9 -> 9.8Hurt
Use Claude 3.0 Haiku instead of GPT-4 (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9 -> 2.5Hurt
Use Mixtral 8x22B instead of GPT-4 (ablation)SWE-Agent · SWT-Bench-Litesuccess rate: 15.9 -> 0.7Hurt
Increase the number of libro samples (ablation)libro · SWT-Bench-Litesuccess rateHelped
Increase Code Agent interaction rounds (ablation)Code Agents · SWT-Bench-Litesuccess rateHelped

Surprising findings

Limitations

Experimental setup

Datasets: SWE-Bench

Benchmarks: SWT-Bench SWT-Bench-Lite

Metrics: success rate fail-to-pass rate fail-to-any rate pass-to-pass rate change coverage patch well-formedness precision

Baselines: ZeroShot ZeroShotPlus PassAtFive (oracle selection) LIBRO AutoCodeRover aider SWE-Agent

Builds on: SWE-Bench SWE-Agent LIBRO AutoCodeRover aider

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy