GUT’s - Good Unit Tests
GUT’s - Good Unit Tests. Yes, I think I like it!
The background of the debate is whether or not unit-test is considered GOOD if is written prior or post to the implementation of functionality it tests. Alistair Cookburn has some valuable input in the debate, go read his entry in the link I provided to catch up on the subject.
Regarding my own unit-test’s; I sometimes find that writing tests prior to implementing the class/function to test, leaves me with a different architecture/design then what I would have if I created the test after the class/function. Design and software architecture is more or less imposed on us from the circumstances that we develop under. Hence, unit-test can or can not impose a certain design on the classes and functions we create. Sometimes the design imposed from unit-test’s is a good thing, and sometimes its not. Sometimes a test-application approach is a good way of evolving a good design, not a unit -test. This issue requires Pragmatism! What is the potential value of Good Unit Tests?:
- Is it the road towards the unit-test (TDD or any other formal design paradigm)?
- Is it the the final unit-test itself that has potential value?
My vote goes to the second, but not without acknowledging the first.
GUT’s is a term missing in the vocabulary, that says something about unit-tests and their quality without emphasizing too much on the design paradigm used to get to the final result.