How PatchProof chooses tests
PatchProof does not map production files to tests or guess what bug is being fixed. It starts from changed test files in the Git diff.
- Resolve immutable base and head commits.
- Compute added and modified line ranges.
- Parse pytest, Jest, or Vitest declarations.
- Compare each changed range with the test's complete source span.
- Select overlapping cases.
- Fall back visibly to file-level targeting when syntax is dynamic or ambiguous.
text
test("rejects zero volume", () => { line 18 ┐
const queue = createQueue(); │ complete source span
expect(() => queue.add(0)).toThrow(); line 20│ changed line
}); line 21 ┘The result records:
- Changed ranges.
- Test source span.
- Selection reason.
- Case-level or file-level granularity.
- Fallback reason, when present.
Added tests are selected directly. Deleted tests are reported but cannot be evaluated. Explicit tests.support files may be transplanted with tests; production files are blocked.