← Latest papers
💻 computer science

Can Old Tests Do New Tricks for Resolving SWE Issues?

TestPrune is a fully automated technique that strategically minimizes large regression test suites to enhance LLM-based bug reproduction and patch validation, significantly improving issue resolution rates on SWE-Bench benchmarks with minimal API cost overhead.

Original authors: Yang Chen, Toufique Ahmed, Reyhaneh Jabbarvand, Martin Hirzel

Published 2026-05-12
📖 4 min read☕ Coffee break read

Original authors: Yang Chen, Toufique Ahmed, Reyhaneh Jabbarvand, Martin Hirzel

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 Problem: Too Much Noise, Not Enough Signal

Imagine you are a detective trying to solve a crime in a massive, chaotic city (a large software project). You have a giant notebook of "rules" (the regression test suite) that says, "If you walk down Main Street, you shouldn't get hit by a car." These rules are great for making sure the city doesn't fall apart when you make small changes.

However, when a new, weird crime happens (a new bug), the detective (an AI agent) needs to figure out exactly where and how to fix it. The problem is that the city has thousands of rules. If you try to read all of them to solve one specific crime, you get overwhelmed. It takes too long, costs too much money, and the detective gets distracted by rules about "Main Street" when the crime actually happened on "Elm Street."

In the world of software, these "rules" are tests. Current AI tools try to fix bugs by reading the whole library of tests. This is slow, expensive, and often confusing because most of those tests have nothing to do with the specific bug at hand.

The Solution: TestPrune (The Smart Librarian)

The authors of this paper created a tool called TestPrune. Think of TestPrune as a super-smart librarian who knows exactly which books you need for a specific research topic.

Instead of giving the detective the entire library, TestPrune looks at the description of the crime (the issue report) and the city map (the codebase). It then asks a smart AI (a Large Language Model) to guess which parts of the city are suspicious. Once it knows the suspicious areas, it scans the library of rules and pulls out only the 9 to 11 rules that are actually relevant to that specific crime.

It throws away the thousands of irrelevant rules. It's like going from reading a 10,000-page encyclopedia to reading a single, perfect 3-page cheat sheet.

How It Works (The "New Tricks")

The paper shows that these "old tests" (the ones already written by humans) can do "new tricks" if you just pick the right ones. TestPrune uses two main strategies to help AI fix bugs:

  1. Recreating the Crime Scene (Reproduction):
    Before fixing a bug, you need to prove it exists. The AI tries to write a new test that fails on the broken code but passes on the fixed code.

    • Without TestPrune: The AI guesses blindly or tries to read too many old rules, getting confused.
    • With TestPrune: The AI is handed the specific "old rules" that cover the broken area. This gives the AI better context, helping it write a perfect "crime scene recreation" test.
    • Result: The AI gets better at proving the bug exists (a 6.2% to 9.0% improvement).
  2. Checking the Fix (Validation):
    Once the AI proposes a fix, it needs to make sure the fix didn't break anything else.

    • Without TestPrune: The AI runs thousands of tests. If a test fails, the AI might panic and think the fix is bad, even if that test was irrelevant to the fix.
    • With TestPrune: The AI only runs the small, relevant set of tests. If they pass, the fix is likely good. If they fail, the AI knows exactly what to tweak.
    • Result: The AI fixes more bugs correctly (8.0% to 12.9% improvement) and does it faster.

The Results: Faster, Cheaper, and Smarter

The paper tested this on real-world software projects (using benchmarks called SWE-Bench Lite and SWE-Bench Verified). Here is what they found:

  • Massive Reduction: They reduced the number of tests the AI had to run by over 1,000 times. Instead of running 10,000 tests, they only ran about 9.
  • Speed: Running the full library took about 24 minutes. Running the TestPrune list took only 52 seconds.
  • Cost: It costs almost nothing extra to use TestPrune. It adds only about $0.02 to $0.05 per bug fix (using standard AI models).
  • Success Rate: By using this "smart filter," the AI agents solved significantly more bugs than they did before.

The Bottom Line

The paper answers its own title question with a resounding Yes. Old tests can do new tricks, but only if you stop treating them all as equal. By using AI to intelligently select the tiny, perfect subset of old tests that matter for a specific problem, we can make software repair faster, cheaper, and much more accurate.

Key Takeaway: You don't need a bigger library to solve a problem; you just need a better librarian to find the right book. TestPrune is that librarian.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →