Skip to content

Project - Refactoring "Dirty" Code using TDD

Practice real-world refactoring:

  1. write characterization tests (what the code does today)
  2. refactor in small steps
  3. keep tests green
  • find a messy function (long, many branches)
  • write tests for current behavior
  • refactor into smaller functions
  • don’t change behavior while refactoring
  • use coverage to find untested paths
  • commit frequently

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading