jakub holý

building the right thing, building it right, fast

Economics of Coding

Our resources are always limited. We must always be aware of the cost and benefits of whatever we do to spend them wisely.

Claims such as that code should have 100% test coverage are therefore misguided. What are the benefits of those tests (better design, safety net for refactorings, documentation), what is the cost of writing and maintaining them? Does the cost of testing a setter overweight its cost? Hardly.

Therefore never forget that all resources are limited and be aware whether the benefits of your effort are higher than its short- and long-term costs.


The Economics of Developer Testing – a very interesting reflection on the cost and value of testing and what is enough tests. Tests cost to develop and maintain (and different tests cost differently, the more complex the more expensive). Not having tests costs too – usually quite a lot. To find the right ballance between tests and code and different types of tests we must be aware of their cost and benefits, both short & long term. Worth reading, good links. (Note: We often tend to underestimate the cost of not having good tests. Much more then you might think.)