3 ms·
I have a love-hate relationship with unit tests. They are great in theory but in practice not enough people do it to reach that "critical-mass". By that I mean
by jtchang 16y ago
I have a love-hate relationship with unit tests. They are great in theory but in practice not enough people do it to reach that "critical-mass". By that I mean very few projects you pick up (especially in the maintenance phase) will have tests.
And writing good tests is HARD. If you think it is easy then you are testing the wrong thing. A lot of people say refactoring without tests is pure danger. I disagree. Sometimes you don't know enough about the problem space to write good tests. However, refactoring forces you to understand the "micro" world of the code. And this gives you a leg up in order to understand what tests are actually needed.
- eru 16y agoDo you have experience with QuickCheck? It allows you to specify rules and the computer will generate the tests for you. That's very pleasant to work with in languages susceptible to this kind of reasoning (e.g. Haskell). (Edit: quicktest -> QuickCheck. Thanks!)
- jholman 16y agoI suggest that you're thinking of http://en.wikipedia.org/wiki/Quickcheck http://en.wikipedia.org/wiki/Quickcheck