Making Legacy Code Your Friend
summary
Migrates an AngularJS ES5 app into a hybrid Angular + TypeScript codebase, reaches ~60% unit test coverage, cuts tech debt by ~60% and bugs by ~43% while making time to market 2.7× faster. Uses Angular Upgrade, Code Forensics and import-counting to find hotspots, applies sprout technique and wrap technique to move logic into small files, uses mergeable to cap PRs at 500 lines, adopts TypeDI, characterization/snapshot tests and feature flags to verify changes safely.
AI-written summary · about
chapters (13)
- 0:00Introduction to legacy code
- 1:38Why rewrite isn't the answer
- 3:05Incremental improvements strategy
- 4:29Prioritizing refactoring efforts
- 6:16Divide and conquer approach
- 8:45Controlling PR size with mergeable
- 9:48Managing dependencies with TypeDI
- 10:30Migrating to TypeScript benefits
- 11:54Testing pyramid vs testing trophy
- 13:18Characterization tests for legacy
- 14:20Refactoring with feature flags
- 15:45Clean code during incidents
- 17:08Results and key takeaways
