6 Safe Refactoring's for Untested Legacy Code
summary
Demos six concrete refactorings using VS Code shortcuts (F2, alt+enter, multi‑select) and an author‑made VS Code extension to decouple IO from domain: extract variable, split declaration and initialization, slide statements plus inlining and renaming. The concrete claim is that applying only automated refactor moves extracts domain logic from an Express controller so tests shrink from a dozen slow end‑to‑end checks to fast isolated cases — twelve slow tests become a suite running in about 6 ms — enabling safe bigger refactors.
AI-written summary · about
chapters (9)
- 0:00Welcome
- 3:06What refactoring is
- 6:31Core refactorings
- 9:00Situational refactoring moves
- 12:58Why legacy code resists testing
- 15:54Separating domain logic from IO
- 16:36Live coding distill and extract
- 27:21Riskiest refactorings
- 28:02Closing








