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

My name is Igor Sobreira and is my website. I'm a software developer working at Real Geeks. I currently live in Hawaii doing the two things that I like most: windsurfing and writing software.

See more about me and get in touch.