Shaun Abram
Technology and Leadership Blog
Test Doubles: mocks, dummies and stubs
Most classes have collaborators. When unit testing, you usually want to avoid using real implementations of those collaborators to avoid test brittleness and binding/coupling, and instead use Test Doubles: Mocks, Stubs and Doubles.
This article references two existing articles on the subject: Mocks Aren’t Stubs, by Martin Fowler and The Little Mocker, by “Uncle” Bob Martin. I recommend them both.
Tags: doubles, dummies, fakes, martinfowler, mockito, mocks, spies, tdd, testdoubles, Testing, unclebob, unittesting