6 Safe Refactorings for Untested Legacy Code
summary
Six concrete refactorings (inline, rename, extract, change-signature, distill/extract, extend/override) are demonstrated with TypeScript examples and VS Code shortcuts to safely change untested legacy code. Each move follows the pattern create new code, replace occurrences, remove old so edits never leave the repository broken; tools include TypeScript types and an extension for automated refactors; use F2 and extract/inline shortcuts to compose safe multi-step changes and expose pure logic for unit tests.
AI-written summary · about
chapters (12)
- 0:00Introduction to refactoring
- 1:02What is refactoring
- 4:59Legacy code challenges
- 6:25Core refactorings overview
- 7:30Inline refactoring
- 10:21Rename refactoring
- 14:55Extract refactoring
- 20:59Composing refactorings
- 21:21Change signature refactoring
- 25:35Distill and extract for testing
- 32:25Extend and override technique
- 40:09Summary and resources
related talks
29m6 Safe Refactoring's for Untested Legacy Code
35mQuickly and Safely Refactoring Legacy Code
48mThree Principles To Bring Your Legacy Code Into the Future
06mLightning talk from Krzysztof Żuraw
01h 04mRefactoring Is Not Just Clickbait
32mFive Lines of Code
20mApplying Code Standards Retroactively
35mFive Lines of Codes
