Mocks, Stubs and Fakes: it's a continuum

Highly recommended reading: Fowler's article Mocks aren't Stubs.

Generically called (by Gerard Meszaros's xUnit patterns book) Test Doubles, all three kinds of test aids are intended to replace real implementations of dependencies of the object under test. From Fowler's article, we learn the difference between them as explained by Meszaros:

  • Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists.
  • Fake objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an ...

Read full article

No Comments