Project - Refactoring "Dirty" Code using TDD
Goal
Practice real-world refactoring:
- write characterization tests (what the code does today)
- refactor in small steps
- keep tests green
Approach
- find a messy function (long, many branches)
- write tests for current behavior
- refactor into smaller functions
Tips
- donβt change behavior while refactoring
- use coverage to find untested paths
- commit frequently
If this helped you, consider buying me a coffee β
Buy me a coffeeWas this page helpful?
Let us know how we did
