Tend to be small: fast
, deterministic
.
Tend to be easy to write
at the same time as the code they’re testing
.
Promote high levels of test coverage: make changes with confidence
.
Serve as live document
: key spec by example, show how to use the system and how system is intend to work
.
80%
unit tests and 20% broader-scoped tests.maintainability
Just work: no need to think about them again until it fails
.
Failure indicates a real bug
with clear cause.
Safety net when refactoring.
A test fails in the face of an unrelated change
to production code that does not introduce any real bugs
.
Make tests more robust to change
. (Resilient to change)
It never needs to change
unless the requirements change.