Gilded Rose Refactoring Kata
summary
Refactors the Gilded Rose Kotlin kata using Kotlin and IntelliJ intentions and plugins, keeping tests green and doing tiny commits; project starts as four files and two tests, runs a 0–100 day regression printout, and shows 100% coverage but catches issues with mutation testing. Extracts and flattens nested ifs, lifts shared updates into one updateQuality function, converts mutations toward copies, and successfully adds conjured items degrade twice as fast with the regression updated and passing.
AI-written summary · about
chapters (18)
- 0:00Introduction to refactoring
- 1:26Setting up the project
- 3:09Understanding the requirements
- 6:40Analyzing code coverage
- 9:10Refactoring approach and heuristics
- 12:23Condensing and simplifying code
- 13:49Inverting conditions and splitting logic
- 17:20Flattening nested conditions
- 19:05Encapsulating quality updates
- 21:35Lifting function calls out of expressions
- 22:57Adding the Conjured item
- 24:47Reordering sell-in updates
- 26:55Refactoring in tiny safe steps
- 28:01Making code more functional
- 30:10Retrospective of the refactoring
- 31:56Refactoring shortcuts and tools
- 33:00Why refactor in the first place
- 35:30Closing and resources
