← Latest papers
💻 computer science

Beyond Fail-to-Pass: Iterative Hardening of Co-Generated Bug Reproduction Tests and Fixes

This paper introduces CoHarden, an iterative co-generation framework that hardens bug reproduction tests and fixes against lax, incorrect patches to overcome the limitations of standard fail-to-pass criteria, thereby significantly improving automated program repair success rates on benchmarks like SWE-bench Verified.

Original authors: Yuhao Tan, Zhibang Yang, Fangkai Yang, Yuan Yao, Yu Kang, Lu Wang, Pu Zhao, Xin Zhang, Xiaoxing Ma, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang

Published 2026-07-23
📖 3 min read☕ Coffee break read

Original authors: Yuhao Tan, Zhibang Yang, Fangkai Yang, Yuan Yao, Yu Kang, Lu Wang, Pu Zhao, Xin Zhang, Xiaoxing Ma, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang

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

Imagine you are a detective trying to solve a crime, but the only clue you have is a blurry, incomplete witness statement. In the world of computer science, this is the daily struggle of Automated Program Repair (APR). For years, we've taught super-smart AI detectives (called Large Language Models) to fix broken software just by reading these vague "bug reports." The problem is, the reports are often missing details, and the AI can come up with a solution that looks perfect on paper but actually makes the crime worse or leaves the real culprit at large. To fix this, researchers realized the AI needs a "crime scene test"—a specific, executable script that proves the bug exists and confirms when it's truly gone. This is called a Bug Reproduction Test (BRT). But here's the twist: just because a test can catch the bug doesn't mean it's a good test. Some tests are like a security guard who only checks if a door is locked but doesn't care if the thief is still hiding in the closet. They let the wrong fixes slip through.

This paper, titled "Beyond Fail-to-Pass," dives into the messy reality of teaching AI to write these tests and fix bugs at the same time. The researchers discovered that the standard way of judging these tests—checking if they fail on the broken code and pass on the fixed code (a metric called Fail-to-Pass or F→P)—is actually too easy. It's like grading a math student only on whether they got the final answer right, without checking if they used the right formula. They found that many AI-generated tests are "lax": they catch the bug, but they also accidentally accept "fake" fixes that look good but don't actually solve the problem. Worse, when the AI writes the test and the fix together in one go, the two often get "coupled," meaning if the AI misunderstands the bug, it writes a bad test and a bad fix that perfectly match each other's mistakes, tricking the system into thinking everything is solved.

To solve this, the team built a new framework called COHARDEN. Think of it as a tough-love training camp for AI detectives. Instead of letting the AI write the fix and the test simultaneously, COHARDEN forces the AI to write the test first, ensuring it's based on the actual crime scene and not a guess. Then, it enters a "hardening" loop. In this loop, the AI's fix is pitted against a swarm of "mutant" code—deliberately broken versions of the fix designed to look like solutions but aren't. If the test lets a mutant slip through, the system knows the test is too "lax" and forces the AI to rewrite it until it's "rigorous" enough to catch every fake fix. The results are impressive: on a major benchmark of real-world software bugs, COHARDEN solved 69.4% of the issues, beating the previous best methods by a significant margin. It proved that by making the tests stricter and breaking the bad habits of AI writing tests and fixes together, we can get much closer to truly fixing software automatically.

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 →