Process
8 min read
A year of writing the test first, honestly
Twelve months of test-first development on real projects: where it helped, where it slowed me down, and what I kept.

I resisted writing the test first for a decade. Last year I tried it on everything for twelve months, and I kept a diary.
Where it helped
Small, well-understood functions and every bug fix. Writing the failing test first for a bug means I know I have really fixed it.
Where it did not
Anything exploratory. When I do not yet know what the code should do, a test is a guess written in advance, and I end up rewriting both.
What I kept
Test first for bug fixes and libraries. Test after for prototypes, then throw the prototype away. It is less pure than I hoped and it works.
Written by
Iri Halvorsen, software engineer in Bergen
More / ls -t ./writing


