July 25, 2014

Agile Coaching Blog

Are your unit tests on FIRE?

Good unit tests are:

Fast – they run in no more than a few milliseconds on typical hardware

Isolated – they remove any dependencies using mocks which verify the way the dependencies are called and stub the return value.

Repeatable – they have no dependence on external state and can be run over-and-over with the same results (Unless the code changes.)

Examples – they demonstrate the way that the code is intended to be used and thus enable Coding By Intention (If you write them first.)

(note: due respect to the author of FIRST but I prefer my version.)

Share:

COMMENTS:

  1. Hello Adam,
    Good post! I’ve translated it in french : Vos tests unitaires sont-ils FIRE ?
    Regards, Fabrice

Trackbacks

  1. [...] already know that good unit tests are on FIRE. Here are some characteristics of good [...]

POST YOUR COMMENT

*