Characterization Tests
In his excellent book Working Effectively with Legacy Code [Fea04], Michael Feathers talks about two different types of tests, which he calls specification tests and characterization tests.
Specification tests are the ones we’ve been talking about throughout this book. They check that the code does what it’s supposed to. Ideally you write them before you write the code itself and use them as a guide to help you get the code into the right shape.
Characterization tests are different. You can think of them more like a science experiment, where you test the properties of a mysterious substance by boiling it or mixing it with other substances to see how it reacts. With characterization tests, the aim is just to understand ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access