Recently on the
Test Driven Development Yahoo Group, James Carr initiated a discussion on TDD Anti-Patterns for a paper he's writing to submit for consideration to be published in
IEEE's Software Magazine TDD Special Issue.
It's certainly been an interesting discussion, and he catalogued several of the anti-patterns on
his blog.
I think it's a good idea to have names for these smells, since I've noticed a couple of them in my own tests - and it helps remind me to fix them. In particular, I didn't like a few tests in cfrails, which seemed only to test that "such and such works," without asserting anything really. This falls under The Secret Catcher:
A test that at first glance appears to be doing no testing due to the absence of assertions, but as they say, “the devil’s in the details.” The test is really relying on an exception to be thrown when a mishap occurs, and is expecting the testing framework to capture the exception and report it to the user as a failure.
I don't recall if I fixed them yet or not, but you can be sure I'll be paying more attention to my tests now!
Hey! Why don't you make your life easier and subscribe to the full post
or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate
wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!
Leave a comment
There are no comments for this entry yet.
Leave a comment