Igor Sobreira

Mocks, Stubs, Fakes and Spies

Reading the Continous Delivery book I found a good definition of mocks, fakes, stubs and spies:

This terminology was taken from xUnit Test Patterns book.

I've already seen cases where people write lot's of unit tests, abusing from mock objects, but without good integration and acceptance tests you can't really guarantee that each scenario is really working as expected.

"It’s very easy to misuse mocks to write tests that are both pointless and fragile, using them simply to assert the specific details of the workings of some code, rather than an assertion of interactions with collaborators."

A couple links if you want to read more about it:

blog comments powered by Disqus