Roy Osherove is a leading expert in TDD – he had a brilliant podcast with Scott Hanselman recently and his blog makes for in-depth reading on TDD and Unit Testing. In particular check out the Test Reviews of publically released Unit Tests – including nerddiner, MVC, and Unity. This gives a much needed real world critique of tests that people are actually writing – in my experience developers find this sort of thing very informative and helpful. I would recommend spending some time watching these if you are at all interested in TDD (as more and more developers are…)
As a sample what is wrong with the following test:
If you got the fact that the EventDate will change every time you run the test, that’s good, but there are quite a few other problems here that Roy highlights – I’ll leave it up to you to watch the video and find out for yourself!
Cheers
Ian
Disclosure: bbits are hosting a TDD masterclass with Roy from September 21-25 here in the UK. Every delegate gets hands-on tutoring from Roy himself, together with a copy of his book, The Art of Unit Testing and other goodies. Spaces are strictly limited to 20 delegates, and there are a few early bird discounts available if you are quick here: http://amiando.com/TDDMasterclass ;-)