Exercises to practice refactoring without breaking tests.
Run the tests with make test from the directory of the exercise you're trying. They will run until a test fails. When they do undo until the tests were last passing. This should be only a single change.
Can you refactor while making sure the tests always pass?
- GuidedExercise: A series of isolated exercises to learn IDE refactorings. Recommended.
- Tennis: A classic refactoring kata.
- GuildedRose: A very tricky refactoring task. This will be a challenge.
Each exercise is available in both JS and Ruby.
Tennis and Gilded Rose are taken from Emily Bache.