Refactoring Mistake Clinic
Module-Specific Mistake Radar
| Signal | Why it fails | Repair |
|---|---|---|
| Green tests called a proof | Untested inputs and observations remain | State domain, oracle and transformation argument |
| Starter passing called completion | It already passes before editing | Review intermediate diffs and process evidence |
| Loop replaced during extraction | Traversal, holes or getters may differ | Preserve traversal first; test a second move separately |
| New validation hidden in wrapper | Accepted inputs and error order change | Declare an intentional repair/migration |
| Old/new APIs use separate stores | Mixed clients disagree | One authority or an explicit synchronization design |
| Timeout triggers fallback write | Original effect may have committed | Preserve uncertainty and define reconciliation |
| Alias removed after local search | External/delayed callers remain | Inventory supported consumers and retention policy |
Practice Mistake Checks
For P02 and P06, preserve rounding location and the deadline equality case. For P07 and P11, record evaluation count and order. For P09, use two invalid tokens at once. For P16, interleave APIs on one instance. For P17–P19, separate routing recovery from persisted state and external effects.
When a check fails, retain the smallest witness, isolate the last change and state whether it is a regression, brittle test, fixture fault or intended repair. Do not manufacture a quota of mistakes. Recheck a changed case after correction.