Green Test Suites Can Miss Agent Patches: Gating on Diff Coverage
A passing test suite after an AI agent's patch only shows that nothing crashed, not that the changed lines actually ran. File-level coverage percentages are averages and can hide a newly added, entirely unexecuted branch. The article proposes a diff-coverage gate that intersects each patch hunk's changed lines with the lines the suite executed, verdicting each hunk rather than relying on percentages. It provides a Python script that extracts changed line ranges from git diff against the merge base, along with coverage commands that enable branch tracking and scope measurement to source files. The approach also addresses the case where a quarantined flaky test can make the signal misleading.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in