Agentic AI
AI agents now generate bug fixes and their test cases together, cutting engineering overhead
A new approach to automated program repair shows that AI can produce both patches and validation tests in tandem, matching the efficiency of separate pipelines.
Researchers at Google have identified a gap in how automated program repair agents work: while human developers submit bug fixes alongside tests to verify them, current AI repair systems typically generate the two separately. A new study published on arXiv explores whether agentic systems can close that gap by cogenating fixes and tests in a single operation.
The cogeneration approach#
The research explores cogeneration, a strategy where an automated repair agent is instructed to generate both a bug fix and a corresponding bug reproduction test (BRT) within the same patch. This mirrors how developers typically work in practice—combining the solution with evidence that it solves the stated problem. The team evaluated different cogeneration strategies across 120 real bugs reported at Google, examining how various approaches influence agent behavior and patch quality.
Matching dedicated pipelines without the overhead#
A key finding: agentic cogeneration produces bug reproduction tests for roughly as many bugs as a system using a dedicated test-generation agent, while maintaining the same rate of plausible fixes. This matters because it eliminates the need to maintain and coordinate separate generation pipelines for fixes and tests in production environments. Engineers can rely on a single system instead of managing two parallel workflows.
The researchers also developed patch selectors that account for test changes, allowing them to identify patches with both plausible fixes and plausible tests. By analyzing where cogeneration failed, the team identified root causes of unsuccessful repair trajectories, providing insights for future improvements.
Implications for developer confidence#
Deploying agentic repair systems at scale revealed that developers are more confident in AI-generated patches when they include matching test cases. This real-world signal motivated the research; cogeneration directly addresses the expectation that automated patches should be validated by automated tests in the same submission.

