4 ms·
> The "spec" for the unit tests is already there Ah, but the spec is often really poorly defined. That is all sorts of edge cases and uncommon code paths do n
by njharman 9y ago
> The "spec" for the unit tests is already there
Ah, but the spec is often really poorly defined. That is all sorts of edge cases and uncommon code paths do not work as imagined. And, of course, it is full of bugs.
I have found countless "bugs" and issues when writing tests for existing code. I also often have to refactor the code to make it clearer what it's doing or to make it testable.
Unit tests are a development tool more than they are a testing tool. They are a means to produce correct, well documented, well speced, cleanly separated code.