views:

311

answers:

5

I really want to get into TDD development but I have no point of reference where to start.

I think that looking at code and seeing how they write tests and make classes testable that it'll be easier for me to digest and start using myself.

Is anyone aware of any sample or small open source C# applications that include unit tests?

+4  A: 

For shakalpesh,

I would recommend the ObjectMentor katas.

  • One is to create a bowling game scoring algorithm
  • Another is to convert infix expressions to postfix. (The shunting yard algorithm)

Bolwing Game

Shunting Yard Algorithm

daveb
+3  A: 

I highly recommend "Test Driven Development: By Example (Addison-Wesley Signature Series)" by Kent Beck.

Far, far better than any other resources I've found on the net or elsewhere. Well worth the $40 - $50.

James Hugard
It's very short for the price. Most of the info can be had from programming blogs.
Daniel Straight
The book is indeed very nice. The two step by step examples are good introductions to the TDD process and the patterns presented in the last chapter are useful too. Besides, I certainly enjoyed K. Beck's writing style - it looks as if he's right besides you doing the stuff. A great introduction to TDD for a novice, highly recommended. The only thing I thought was missing was a deeper discussion on mocks.
Ree
A: 

If you're looking for a real-life open source application where the unit tests are critical to evaluating correctness, I'd suggest BouncyCastle C#, the source is available here. It's an open source crypto API for .NET, has loads of tests and obviously the tests help establish whether things are working or not. Great if you like jumping into the thick of things.

sigint
A: 

I personally believe it's better to see web / screencasts for this than reading sample source code.

I'd go watch Rob Connery's MVC storefront series here. He covers most of what you are looking for.

Also, look at DnRTV episodes w/ JP Boodhoo. Find it here.

Jimmy Chandra
A: 

Microsoft Press has the book, "Test Driven Development in Microsoft .NET", by Newkirk and Vorontsov, two members of the NUnit development team. It's a few years old now, but it'll show you a more complete view of the process.

John Deters