views:

1117

answers:

8

What is a quality real world example of TDD in action? What small-to-medium open source projects in .net are out there that show off best practice in TDD and might work as a reference for doing TDD right?

+2  A: 

If you are looking into this for personal usage of TDD, I don't think browsing other projects will really help you. Instead, you should dive in and just do it, and learn as you go.

To get started, check out this article about testing and how to get started, and this book about TDD by Kent Beck (very simple, easy to understand and insightful).

Mike Stone
A: 

I am looking more for an example of a living breathing project(s) that serves as a good example of TDD. Something that would supplement the books and references which explain and demonstrate the process in isolation.

Something that would be helpful for an aspirational developer who want to level up from beginner/intermediate TDD practitioner...

Andrew Rimmer
@Andrew, I believe this should be posted as a comment to your question, and not its own "answer."
ShaChris23
+1  A: 

I haven't gotten through all the webcasts myself, so I can't attest to how well Rob Conery has implemented TDD, but his MVC Storefront series is supposed to be using TDD.

Kevin Pang
+1  A: 

This may or may not be what you're after, but the MS Enterprise Library has a full set of unit tests (NUnit) as part of the source code distribution, I'd regard that as pretty real world.

Kev

Kev
A: 

About a week ago IT Conversations posted a very interesting talk given by Kent Beck that focused on TDD (but also touched on patterns and extreme programming). Nothing 'meaty' as far as detailed instructions on TDD, but informative anyway. Definitely worth a listen if you're ramping up your TDD skills.

Andrew
+4  A: 

Here's some examples:

  • NUnit
  • CodeCampServer Any of the
  • Rhino tools from Ayende (e.g. Rhino Mocks)
  • ASP.NET MVC
  • Cuyahoga (CMS system)
  • Fluent NHibernate
Kevin Dente
+1  A: 

Ron Jeffries has a lot of good articles on xprogramming.com. If you are doing C#, look for "Adventures in C#". Or buy the book.

His writing style covers most of the aspects of doing TDD, even the wrong turns we are destined to take. I have learned a lot of his articles over the years, even those on the more exotic languages.

Thomas Eyde
+1  A: 

TDD is a process that mostly happens in between commits to the repository.

When looking at open-source projects you will only see snapshots of the code that are taken when a developer commits.

There should be no practical difference between the commits made by a developer that makes good design and implements lots of unit-tests and a good developer that practices TDD. The difference is that the TDD-process applies pressure on the developer to make a clean design and implement lots of unit-tests.

Looking at a Test-Driven open-source project will only allow you to see the result of the TDD-process, not how to be Test-Driven yourself.

To really learn it, you really need to watch someone do TDD. A book can help, but it is difficult to show the process in a book. Much better to see it done in real-time. The best way would be to pair-program with someone who is test-driven. The next best would be a live demonstration at a conference or gathering - perhaps you have a local user group?

Failing that, there are some online video-demos. Here are two:

Rasmus Faber