A moment’s epiphany in a highly caffeinated brain; a metaphor:
a unit test suite is a spiderweb!1
- It’s lightweight
- It’s sufficiently robust
- It catches a casual bug passing by
- It’s most useful if the maintainer reacts to a bug catch immediately
- It needs occasional maintenance
- It’s not watertight, but good enough
- Some are beautifully designed, some look like a tight cloth, some are a mess
- …insert your analogy…
There is an already established XP metaphor of a safety net for the people and the business, to which I fully subscribe. This “lightweight net” metaphor, I hope, adds another flavor to the test-suite-as-a-net analogies, especially, to lightweight unit test suites, by describing which qualities unit test suites can have.
We now know that small (biological) bugs and other small creatures can cause a lot of harm, just as tiny software bugs can and do. 2
The analogy might have been a cheap trick of my brain. Nonetheless, it is now externalized, and I can go to sleep.