Revert Residue Check Tests Whether a Small Refactor Leaves Hidden State Behind
A developer argues that passing golden-output tests does not prove a refactor is clean, since a patch can still leave lasting side effects such as cache entries or registry changes. The proposed fix adds a step after characterization tests: apply the patch, revert it, and confirm the original files are byte-identical. Tests are configured to write their outputs to disk through an environment-variable-based fixture so that artifacts can be hashed. A driver script runs the suite before the patch, after it, and after the revert, then compares SHA-256 fingerprints and git status. Any difference after the revert is reported as residue, indicating the change was not truly small.
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