Hard to Write Unit Tests Are a Code Smell

Complex test set up and brittle tests can make you hate unit tests. Especially when writing tests takes a lot more time than writing code.

Anything in your code that makes it hard to write unit tests is something that should be changed.

Terms

From Martin Fowler’s TestDouble post referencing Gerard Meszaros’s book.