Adopting TDD has been an enlightening experience. I have found that doing things the right way usually seems to be the hard way. Or at least you have to take your lumps when applying TDD to an application that was initially developed without TDD.
I have been reading a book that could quite possible have the worst title I have ever heard. This book cannot stand on its title alone. The only reason I am reading it is because it was recommended to me by someone who I trust. I believe this is a book that will sell only by word of mouth. Working Effectively with Legacy Code is a book that explains how to get existing code into a test harness. You might be reading this and thinking I must need help tying my shoes in the morning as well. If I need a book to teach me how to create a unit test, then I obviously must be unable to function in society, right? Not true when it comes to existing applications which were written before applying Test Driven Development principles. The honest truth is that doing Test Driven Development on a new project is much easier than trying to apply it to an existing project. I have found that most of our existing architecture (which is based on commerce server and its horrible starter solutions) have been extremely difficult (almost impossible) to get into a unit test. So much of the base objects have such deep dependencies on commerce server and the System.Web.HttpContext, that we have had to take some drastic steps to break our existing design and refactoring code just so that we can start to add tests to our system. I believe it will be well worth it, but it is not for the mild or the meek. It will be a long, hard road for us but ultimately we will be better off making the change. If you are adopting TDD and do not have the luxury of only working on new code, then go to Amazon and buy this book: Working Effectively with Legacy Code .