Bilkent University
Department of Computer Engineering
CS 590/690 SEMINAR
ADAPT: Agentic Diff-Aware Patch Testing for Pull Requests
Vahid Haratian
Master Student
(Supervisor:Assoc.Prof.Eray Tüzün)
Computer Engineering Department
Bilkent University
Abstract: Modern software development increasingly relies on pull requests (PRs), where developers introduce small, targeted code changes. Once merged, these changes should be protected by focused tests that exercise the specific behavior the PR introduces. In practice, however, developers often submit PRs without such tests, leaving the new behavior unguarded against future regressions. Most of the existing techniques do not close this gap: they target entire software units and optimize broad objectives such as code coverage, rather than the behavior a change introduces. Also, prior work on diff-aware testing has achieved only limited success in generating tests that capture this behavior. We propose ADAPT (Agentic Diff-Aware Patch Testing), a diff-aware regression test generation approach that introduces an autonomous code generation agent to produce change-focused tests for PRs. Given a PR, the agent analyzes the diff between the base and head versions to identify the modified functions and their context, then plans and generates candidate unit tests for the modified functionality. To direct these tests toward the intended change, ADAPT uses a dedicated fail-to-pass (F2P) verification tool that runs each candidate test on both the base and head versions; guided by this feedback, the agent iteratively refines its tests. We evaluate ADAPT on the same 426 real-world PRs used by the prior state-of-the-art baseline, with GPT-4o and GPT-5-mini. ADAPT+GPT-4o reaches an F2P rate of 62.0% (264/426), compared with BLAST's reported 35.4% (151/426), an absolute improvement of 26.6 percentage points, while ADAPT+GPT-5-mini reaches 89.9% (383/426). A manual evaluation further confirms that the F2P-valid tests genuinely target each PR's intended behavioral change, reaching mean scores of up to 4.89/5 for importance, 4.63/5 for assertion strength, and 4.83/5 for readability, and often covering behavior beyond the developer-written tests.
DATE: November 09, Monday @ 14:10 Place: EA 502