Don’t Fear Build Failures

We tend to fear the red marks, the little indications of something wrong, the failures.  We try to do our due diligence to avoid them wherever they are, whether on the paper for school, our IDE’s compiler output, or in our build pipeline.  Why are we so afraid of those little failures?  These failures help … Read more

Mocking in Groovy

In unit tests, sometimes you just need to do some simple work with a mock.  Something like setting an identifier on an argument that is passed in to the mock. Imagine a service interface where this is one of the methods: Now imagine that on that same interface there are many other methods that you … Read more

Stubs, Mocks, Fakes, Dummy

What is the difference between a Stub, a Fake, and a Dummy?  Well, as a refresher from Gerard Meszaros’s Test Double Patterns and Martin Fowler’s Mocks Aren’t Stubs: Mock – Sets expectations on how it is used by the sut Stub – Provides canned responses Fake – Has a real, but light-weight ‘shortcut’ implementation Spy – Records information about … Read more