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.)












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