Developer Testing

Sample code that illustrates three advanced developer testing techniques as they apply to the Gilded Rose Kata.

The three testing techniques are:

Refactoring Practice

To practice your own refactoring supported by a hash-based characterization test:

git checkout tags/ready_to_refactor -b practice_characterization

To practice your own refactoring supported by an approval test:

git checkout tags/ready_to_add_conjured_item -b practice_approval

My Refactoring

If you want to follow along with how I chose to perform the refactoring you can see each stage in a separate branch:

  1. git checkout preparatory_refactoring
  2. git checkout item_adaptor_refactoring
  3. git checkout replace_case_with_polymorphism

Recommended Reading

Michael Feathers
Working Effectively with Legacy Code

Gerard Mezsaros
xUnit Test Patterns

Nat Pryce
Can Approval Testing and Specification by Example Work Together?

Emily Bache
The Coding Dojo Handbook

Martin Fowler
Workflows of Refactoring