On 19 Sep 2006, at 10:36, David Cantrell wrote:
Adrian Howard wrote:
Yeah - it's something I've noticed over the last year or so. I'm
talking to people less about "you should write tests", and much
more about "you should write /good/ tests".
What do people think are *good* tests?
[snip]
Belated response. For me good tests suites:
* are good code (i.e. DRY, well factored, intention revealing, etc.)
* encourage good design (ala TDD)
* fail for bugs, but not refactoring
* only fail for bugs in the thing they're testing
* don't depend on the order the tests are run in
The antithesis of good test suites are when I come across people
taking a big bad ball of mud, and then spends three months adding
copy 'n' paste tests until they have 100% statement coverage.
Because they know tests are good - and 100% statement coverage is
extra double plus good!
Unfortunately what they end up with is a test suite that is as
brittle as fuck. Change any damn thing - even if you're fixing stuff
- and half the test suite falls over. Their wonderful test suite
either ends up being completely ignored, or making change for the
better harder.
Cheers,
Adrian