If I want to learn TDD on my own, where would I start apart from the usual Google Search?

Are there any books that you would recommend or any method that you followed to learn it on your own?

I am a C# Developer if in case that made a difference.

5 Answers 5


It uses Java and Python, but a good book to learn TDD from is Test Driven Development: By Example.

Quite simply, test-driven development is meant to eliminate fear in application development. While some fear is healthy (often viewed as a conscience that tells programmers to "be careful!"), the author believes that byproducts of fear include tentative, grumpy, and uncommunicative programmers who are unable to absorb constructive criticism. When programming teams buy into TDD, they immediately see positive results. They eliminate the fear involved in their jobs, and are better equipped to tackle the difficult challenges that face them. TDD eliminates tentative traits, it teaches programmers to communicate, and it encourages team members to seek out criticism However, even the author admits that grumpiness must be worked out individually! In short, the premise behind TDD is that code should be continually tested and refactored. Kent Beck teaches programmers by example, so they can painlessly and dramatically increase the quality of their work...

  • 2
    +1 this is THE book for learning TDD. Wish I could +10. Kent has also recently done a screencast demonstrating TDD for Pragmatic Programmers that I highly recommend. It's one thing to read it, it's another entirely to watch a master do it step by step. Apr 13, 2011 at 18:31

Have a look at The Art Of Unit Testing. It has a lot of examples in .NET, but using Rhino Mocks rather than Moq, which I prefer.

It covers TDD and Unit-Testing in general very well.

Microsoft also has a book: Test Driven Development in .NET (Microsoft Professional), but I have yet to read it.

  • 1
    I have only read the Test Driven Development in .NET. I thought it was cool that it implements a full application with different layers rather than just demonstrating separate examples.
    – simoraman
    Apr 14, 2011 at 7:00
  • 3
    I like "the Art of Unit Testing" too - but that book has nothing to do with TDD - as per author's own words. The book is an excelent source for unit testing - kind of prerequiste for TDD - but it is not the source to learn about TDD per se.
    – ratkok
    Jun 30, 2011 at 4:37

All of the previous answers are great starting points, but to be honest you should start trying to do TDD. To start with accept that any tests are better than no tests and slowly you should start see patterns in your own development. Things that work really well, things that are harder to test and resistant to change. When you encounter the later take a step back and see what is different / impedes the change. Slowly you should feel things changing. For me, the "hump point" was realising that when I did TDD properly I could got to lunch or even go home for the weekend and when I got back, know exactly where I was at. The measureable metric was that I felt so much more relaxed. To answer some of the critics of TDD, it does take a measure-able more amount of time up front, but if you expect your system to last then you should see pay back in the long term.


Since you're asking about c#, Pragmatic Unit Testing in C# with NUnit Might be a good choice. I have not read the others though so I cannot compare.

One thing I dislike is that it uses NUnit Mocks. I much prefer Moq personally. That's a nitpick though, it's not about the language or framework, it's about the practice and process.


Find a coding dojo which uses TDD as part of the exercise. Alternately, start one :) or you can start trying out the katas with TDD yourself.

Else, find somebody who has been using TDD a lot and ask him what his/her workflow is. I have found having someone talk and discuss ideas with you is very important when you are trying out a new process.

Not the answer you're looking for? Browse other questions tagged or ask your own question.