4fc0d851e7c0f2053fc0a53e18d45ad26d7e7399
refactor-kata
Practice drills for refactoring, especially with ideas from Working Effectively with Legacy Code by Michael Feathers and Refactoring by Martin Fowler.
Repository layout
kata/<example-name>/original/- the frozen messy starting point
- copy from here when creating a new drill scenario
kata/<example-name>/scenarios/<scenario-name>/code/- the working copy for a specific drill attempt
kata/<example-name>/scenarios/<scenario-name>/drill-prompt.md- instructions and success conditions for that drill
kata/<example-name>/scenarios/<scenario-name>/notes.md- notes on seams found, tests added, techniques used, and lessons learned
notes/- cross-kata notes and recurring patterns
Intended workflow
- Start with code in
original/. - Copy that code into a scenario's
code/folder. - Do the refactor only inside that scenario copy.
- Record what you observed and learned in
notes.md. - Reset by making a fresh scenario from
original/.
Current starter kata
kata/example-seam-drill/- a placeholder kata for practicing:
- characterization tests
- breaking one dependency with a seam
- extracting one pure decision from mixed logic
- a placeholder kata for practicing:
Goal
The point is not to build a production app. The point is to practice:
- finding seams in messy code
- adding characterization tests safely
- making small reviewable refactors
- separating decisions from mechanics
- gradually moving code toward stronger boundaries
Languages
JavaScript
100%