Gilding the Rose: Refactoring Legacy Code
summary
Uses the Gilded Rose kata and characterization tests with 100% coverage to add conjured items that decay twice as fast, implemented without rewriting the system. Uses RubyMine refactorings, SimpleDelegator wrapper, a wrap factory and polymorphic subclasses to push name-based logic into classes. Quality bounds get enforced via a new quality= clamp, and flog metrics drop from ~179.5 to ~67.1 (worst method 155.1 → 9.5). Tests pass after one targeted test change.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:01The System
- 4:08Fight the urge to rewrite
- 8:04Eliminate Feature Envy
- 20:21Express Important Ideas
- 27:50Final Code
- 28:58Slow and Steady Wins the Race
- 29:20Make Simple Mechanical Changes First








