4 ms·
Unit tests are time-consuming and tedious to write, and generally deliver poor effort-per-bug-found except for initial development (especially since they often
by senderista 6y ago
Unit tests are time-consuming and tedious to write, and generally deliver poor effort-per-bug-found except for initial development (especially since they often displace cross-component tests which tend to catch more bugs). And the cases they test simply reflect the prejudices and lack of imagination of the author. A far better alternative IME is to use generative testing (e.g. property-based testing), which automates the tedium of generating test cases, and finds far more bugs to boot. Bonus: you'll understand your code much better after you're forced to identify and formalize invariants ("properties") in order to write your tests!