ChainSWE: Benchmarking Coding Agents on Multi-Bug Software Maintenance
This paper introduces ChainSWE, the first benchmark designed to evaluate coding agents on sequential, dependent bug fixes within a shared codebase, revealing that agent performance drops significantly as the chain length increases compared to traditional isolated bug-fixing evaluations.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: From "One-and-Done" to "The Long Haul"
Imagine you are hiring a team of super-smart robot mechanics to fix a fleet of cars.
The Old Way (Current Benchmarks):
Every time you give a mechanic a problem, you hand them a brand-new, pristine car. They fix the flat tire, you check their work, and then you send them home. The next day, you give them a different car with a different problem.
- The Problem: This doesn't test if they are good at maintaining a car over time. In the real world, mechanics don't get a new car every day. They work on the same car, fixing a flat tire, then a squeaky brake, then a weird engine noise, all on the same vehicle.
The New Way (CHAINSWE):
The researchers built a new test called CHAINSWE. Instead of giving the mechanics new cars, they give them one car and a list of 304 problems that happened over several years.
- The mechanic fixes the first problem.
- Then, without resetting the car, they have to fix the second problem based on the state of the car after the first fix.
- Then the third, and so on.
The Two Main Ways Robots Fail
The paper found that when robots try to fix a long list of problems on the same code (the "car"), they make two specific types of mistakes that they don't make when fixing single problems:
1. The "Over-Decorator" Mistake (Overshoot)
- The Scenario: The robot is asked to fix a leaky faucet. It fixes the faucet perfectly. But, in its excitement, it also repaints the kitchen cabinets and changes the floor tiles, even though nobody asked for that.
- The Consequence: Later, a human comes in to fix a broken light switch. Because the robot changed the floor tiles and cabinets earlier, the instructions for the light switch no longer make sense. The robot's "extra" work broke the next task.
- In the paper: The robot changes files it wasn't supposed to touch, which breaks the tests for future bugs.
2. The "Half-Finished" Mistake (Undershoot)
- The Scenario: The robot is asked to fix a leaky faucet. It realizes the faucet needs a new pipe and a new valve to work. It only replaces the faucet handle (because that's what the note said) and leaves the broken pipe and valve alone.
- The Consequence: The faucet looks fixed, but it still leaks. Later, a human tries to fix the water pressure. Because the robot didn't fix the pipe earlier, the water pressure fix fails completely.
- In the paper: The robot fixes the specific file mentioned in the bug report but forgets to update the supporting files that the bug report didn't explicitly mention, leaving the code in a broken state for the next bug.
What Happened When They Tested the Robots?
The researchers tested 7 different "AI mechanics" (Language Models) using this new "Long Haul" test.
- The Results: When the robots worked on single bugs (the old way), they were pretty good (about 60% success). But when they had to work on a chain of bugs (the new way), their performance dropped by up to 70%.
- The "Chain Reaction": The deeper they got into the list of bugs, the worse they did. By the time they reached the 3rd or 4th bug in a row, they were failing almost constantly.
- Why? The robots were getting confused by their own previous work. They couldn't remember which files they had changed, or they forgot that their earlier "quick fixes" had broken the foundation for the next task.
Did "Memory" Help?
The researchers tried to help the robots by giving them different ways to remember what they did:
- Full Memory: Reading the entire history of everything they ever said.
- Summarized Memory: Asking the robot to write a short summary of what it did earlier.
- Helper Robots: Using a small robot to do the file editing while the main robot just gave instructions.
The Surprise: None of these tricks really helped much. In fact, asking the robot to summarize its work or use a helper often made things worse. The robots just couldn't handle the "mess" they created in the code, no matter how much they tried to remember it.
The Bottom Line
The paper concludes that we are currently testing AI coders like they are one-hit wonders (fixing one thing and leaving). But in the real world, software maintenance is a marathon, not a sprint.
To build AI that can actually maintain software, we need to stop testing them on isolated tasks and start testing them on chains of tasks where they have to deal with the messy, imperfect code they created themselves. Right now, even the smartest AI models struggle to keep a codebase clean when they have to fix bug after bug in a row.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.