A comment says what you meant.
A test proves it.
One drifts out of date in silence.
The other fails the moment
the code stops agreeing with it.
Write the test first
and you're forced to say,
in plain terms,
what "working" even means.
Half the time
that's where the bug was —
you didn't know yet
what you were trying to build.
A good test suite
is a specification
that runs itself,
checks itself,
and complains when reality slips.
It's the one form of documentation
that can't lie to you,
because the build goes red
the day it does.
Don't write tests to hit a number.
Write them to pin down the meaning
before it slips away.
The test is the spec.
The rest is just hoping.
– Serguey Asael Shinder
Top comments (0)