rgoussu@goussu: ~/library/engineering-practice/exercises
~/library/engineering-practice/exercises cat gilded-rose-technical-debt-workout.md

Gilded Rose: a technical-debt workout

# Emily Bache's legacy-code kata run as a full debt-management cycle — estimate, characterize, refactor, extend, then write the debt records and the business case.

Exercisesaved 2026-08-08source #exercise#technical-debt#refactoring#legacy-code#estimation

Goal

Take the Gilded Rose kata (a small, deliberately awful inventory system, available in ~40 languages) and run it not as a refactoring finger-exercise but as a complete debt-management cycle: put numbers on the interest, pin the behavior, pay the debt in visible steps, ship the feature, and write the artifacts a well-run team would keep. It proves you can manage debt, not just complain about it.

Subject: full brief & instructions

Practices

  • Technical debt — quadrants, interest vs. principal, the debt registry, and the business framing, all produced for real.
  • Estimation & planning — estimates made before and after cleanup, with actuals to audit them against.
  • Code review — the work ships as a chain of small, reviewable commits with honest descriptions.
  • Refactoring techniques — the repayment mechanics under test coverage.

Milestones

  1. Size the interest — read the code cold and write down two range estimates: adding the "conjured items" feature now, and adding it after cleanup. Seal them; they're your before/after evidence.
  2. Pin the behavior — build a golden-master/approval test harness (the repo ships text-based test support) until coverage of the existing rules is total, bugs included. Shippable: any behavior change, however small, fails a test.
  3. Pay the debt in micro-commits — refactor toward an honest design in the smallest possible steps, tests green throughout, each commit message naming what debt it retires. Shippable: a reviewable commit chain, not one "refactor everything" blob.
  4. Ship the feature — implement conjured items on the cleaned code, recording actual time spent. Shippable: feature done, plus your two sealed estimates vs. two actuals — the interest rate, measured.
  5. Write the retro — classify the original mess by Fowler quadrant, write ADR-style debt records as if you'd inherited the codebase mid-loan, and draft the one-page business case ("this debt cost N; the cleanup cost M and paid back at feature time") you'd use to ask for capacity.

Stretch goals

  • Repeat in a second language from the same repo and compare which debts were language-shaped and which were design-shaped.
  • Run milestone 3 as a mob/ensemble session with colleagues.
  • Turn the method on a real repo of yours: hotspot-analyse it, find its true Gilded Rose, and run milestones 1–5 there.

Related