Do Coding Agents Catch Their Own Bugs? (They Don't.)
Abstract
Foresight-SWE is a benchmark that evaluates whether coding agents can anticipate and prevent unstated defects introduced by code changes, revealing that current models perform poorly on this foresight task.
In software development, engineers need to foresee and fix potential problems with their code that are not explicitly specified in requirements---such as pre-emptively considering vulnerabilities or other bugs from a code change. But current benchmarks often do not measure these future-looking consequences. We introduce Foresight-SWE, a benchmark for measuring whether coding agents can anticipate and address unstated problems during software engineering tasks. Foresight-SWE consists of 212 samples spanning 4 languages and 35 popular open-source repositories. Each sample contains two pull requests (PRs), the second of which resolves defects the first one introduced. To measure whether agents exhibit foresight, we define the foresight resolve rate (FRR) as the fraction of instances where an agent fully resolves the original task while also avoiding the defect identified by a later PR. We evaluate eleven large language models and find that FRR ranges from only 6.13% to 24.53%, indicating that models largely fail to address problems introduced by the first PR change. This raises important questions about how models are trained and aligned in coding contexts, as well as how code review tools should be improved for more fail-safe coding. Foresight-SWE shifts evaluations in this direction.
Get this paper in your agent:
hf papers read 2611.01181 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 2
LocalLLaMA/foresight-swe-mini
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper