An Annotated Assortment on Mockist Testing

30 November 2011

Most of us read blog posts every day. We read them, take an idea out of
them and then, most of the time, forget about them. Some of them are stashed
away in the back of our minds, ready to jump out if we face a related
problem.

A precious few of them, however, we keep thinking back to without a specific
reason.

I’ve bitten by the “mockist” testing bug when I read this one a while ago. It expresses a contrarian opinion
about how to test Rails applications which struck me as odd at the time.
That’s probably the reason I read it several times.

Using that video as a starting point I then roamed Gregory’s blog for
more and felt like I was beginning to grasp it. Now, obviously, I’m at the
beginning of this journey and still have a lot of teeth-cutting to do.
Nevertheless, I want to share with you the gems I’ve found so far.

Gregory’s blog has a very good primer on the difference between stubs
and mocks: “Stubbing is Not Enough”. I’d even go
as far as to claim that it explains its subject better than Martin
Fowler’s classic “Stubs Are Not Mocks”, although that
latter goes into more detail and is a definite must-read, too.

Nick Kallen’s “Why I love everything you hate about Java” is clearly provocative
and definitely worth to contemplate on. It is also the only one of the bunch that
does not use Ruby (but Scala) for the code examples.

Please, also pipe in if there are any materials in the subject you’d
recommend. It would also be cool to see open source projects that extensively use mocks for testing, the only
one I found so far is friendly.