Testing

Tests that actually catch bugs: doubles, boundaries, mutation testing and what coverage hides.

  1. Functional Core, Imperative Shell: the end of mocks everywhere

    Gary Bernhardt's 2012 talk Boundaries is still some of the best testing advice around: separate decisions from actions, and pass only values between them.

  2. Your tests are green, but that proves nothing: mutation testing

    Coverage measures lines run through, not lines verified. Mutation testing measures whether tests detect bugs, essential once agents write the tests.

  3. Dummy, stub, spy, mock, fake: five test doubles, one question

    The five kinds of test doubles are easy to mix up. One question asked of the double, borrowed from Meszaros, is enough to tell them apart for good.

  4. Three questions to pick the right tool for your next test

    Pure unit test, integration test, a Fake, or a double that records calls: a simple three-question strategy for choosing without hesitation.