Skip to main content

Refactoring Mistake Clinic

Module-Specific Mistake Radar​

SignalWhy it failsRepair
Green tests called a proofUntested inputs and observations remainState domain, oracle and transformation argument
Starter passing called completionIt already passes before editingReview intermediate diffs and process evidence
Loop replaced during extractionTraversal, holes or getters may differPreserve traversal first; test a second move separately
New validation hidden in wrapperAccepted inputs and error order changeDeclare an intentional repair/migration
Old/new APIs use separate storesMixed clients disagreeOne authority or an explicit synchronization design
Timeout triggers fallback writeOriginal effect may have committedPreserve uncertainty and define reconciliation
Alias removed after local searchExternal/delayed callers remainInventory 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.