// Learning · 10
Tests that fail for the right reasons, and only then.
Many fast unit tests at the base, few slow end-to-end ones on top.
Set up, do one thing, check one outcome. Name what it proves.
Stand-ins for collaborators, chosen by what the test checks.
A valid default object; each test changes only what it is about.
Write the smallest failing test, make it pass, then tidy up.
Run the code against a real database, queue and web host.
Consumers record what they need; providers prove they still meet it.
Assert a rule that must always hold, across many generated inputs.
Break the code on purpose; good tests must notice every break.
Passes and fails on the same code: a hidden input is leaking in.