Test Doubles are Not To Be Mocked

6b767d8a4c9910e007c122d81eb4de73?s=47 Noel Rappin
November 11, 2016

Test Doubles are Not To Be Mocked

Test doubles (which you may know under the alias “mock objects”) are the most misunderstood and misused testing tools we've got. Starting with the fact that nobody can agree on what to call them. Contrary to what you may have heard, test doubles do not inherently lead to fragile tests. What they do is hold up a harsh mirror to the assumptions in our code. They are the light saber of testing tools: a more elegant weapon for a more civilized age. But be careful not to cut your code in half, so to speak. Herein: a guide to using test doubles without losing your sanity.


Noel Rappin

November 11, 2016