Scott Hanselman

Hanselminutes Podcast 31 - Test Driven Development

August 30, 2006 Comment on this post [4] Posted in NUnit | Podcast
Sponsored By

My thirty-first Podcast is up. This episode is about Test Driven Development.

We're listed in the iTunes Podcast Directory, so I encourage you to subscribe with a single click (two in Firefox) with the button below. For those of you on slower connections there are lo-fi and torrent-based versions as well.

Subscribe: Feed-icon-16x16 Subscribe to my Podcast in iTunes

This show was FULL of links, so here they are again. They are also always on the show site. Do also remember the archives are always up and they have PDF Transcripts, a little known feature.

Links from the Show

NUnit
NSPEC
TestDriven.NET
NCover
Fowler's Refactoring
MBUnit
NCover Explorer
Intro to TDD
Peli's original article on MBUnit
Guidelines for Test-Driven Development (Psyche!)
TDD Interview with Fowler
CSUnit
Unit Testing in .NET Projects
Resharper
Jay Flower's Doubler
Write Naive Test Code
RoyO - The Art of Unit Testing
Guidelines for Test-Driven Development
Apoorva Muralidhara Essay on TDD
Refactor! from DevExpress
Software Tester Team Center
Refactor Ruthlessly
CodeRush NUnit Templates

NEW COUPON CODE EXCLUSIVELY FOR HANSELMINUTES LISTENERS: The folks at XCeed are giving Hanselminutes listeners that is Coupon Code "hm-20-20." It'll work on their online shop or over the phone. This is an amazing deal, and I encourage you to check our their stuff. The coupon is good for 20% off any component or suite, with or without subscription, for 1 developer all the way up to a site license.

Our sponsors are XCeed, CodeSmith Tools, PeterBlum and the .NET Dev Journal. There's a $100 off CodeSmith coupon for Hanselminutes listeners - it's coupon code HM100. Spread the word, now's the time to buy.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
August 31, 2006 11:12
Great Show! But regarding fixing bugs: Ideally, you write a test first that fails because of the bug, then fix the code and watch your test pass. It is very satisfying and not tedious at all. ;)
August 31, 2006 19:55
If you use Boo then check out Specter: http://specter.sourceforge.net/
It's an open source behavior/spec-driven development library I created.
Basically, it is a set of Boo syntactic macros to create specs that actually run under NUnit.

For example:
[Test]
public void StackCountMustEqual42()
{
Assert.AreEqual(42, stack.Count)
}
Becomes simply:
specify stack.Count.Must == 42

Using Boo means you can write specs for any .NET assembly.
September 05, 2006 22:54
Another resource I found helpful when trying to understand test-first development is chapter 2 of Test-Driven Development in Microsoft .NET by Jim Newkirk and Alexei Vorontsov.

Anyone can download that chapter from the GotDotNet workspace for the book, http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=348dd896-50b5-42b8-8ff6-9621bd4feff9
September 08, 2006 9:53
Just to add to the various tools and techniques, there's a pretty interesting tool called the "Thycotic.DatabaseScripter" which lets you script your database for unit testing. You essentially create a definition and write a stored proc. The tool will setup (and tear down) the entire db using your schema and then run your stored proc to setup your test data. The really cool thing is that you can set the scripter to preserve the original primary key values in the database, thus making testing easier (important rule of TDD/unit testing is testing from a known state).

You can check out the tool here:
http://www.thycotic.com/dotnet_dbscripter.html
(sad times, only supports SQL 2000 but I'm sure they're working on 2005)

And there's a great blog entry here by Dan Bunea on doing a sales report using TDD (which uses the tool).
http://danbunea.blogspot.com/2005/12/tdding-sales-report.html

Enjoy!

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.