Re:The evil unit test.
by ramblerman on Tuesday January 31, 2012 @05:42AM
(#3532681)
Categorization exists so we can communicate. Labelling abstractions enables us to grok more in our head, and communicate faster. Your second paragraph demonstrates this:
"My "what" was too slow and I need a new "what", but unit testing the "what" helped..."
If only there were higher levels of abstractions to say what you mean.
There are higher labels of abstraction to say what I mean. In fact I could describe it in great detail. My boss may not particularly appreciate me using that level of detail. For that matter you probably wouldn't either, it isn't that interesting to the core point here.
My explicit point in this case was about how the labels are actually bad, get in your way, and shouldn't be used because they hurt more than they help.
Personally, I've given up on categorization entirely. It's just "automated tests". People seem to be very prone in getting caught up in the question of whether it's a "unit" or "acceptance" or "integration" test when that's a completely uninteresting question.
Even "Test what, not how" is only a rule of thumb; if I've got a complicated "what", I'll sometimes at least probe the implementation to be sure I'm on the right track during development. Of course, if I change the "what" I just nuke them. I say this having done this entire cycle over the last week. My "what" was too slow and I need a new "what", but unit testing the "what" helped me get it to the point where I could benchmark it much faster than if I had tried to "not test the what". (Sometimes, you can also nuke the "what" tests before putting them into long-term storage.)
If you can avoid getting caught up in attaching goodness and badness to the terms, unit/acceptance/integration can still be useful communication terms, but I resist using them for anything else, and I don't personally use them at all.
(Also, to be clear, I consider this amplification or reflection upon your post, not disagreement.)