OdeToCode IC Logo

Test-Driven Prose (TDP)

Tuesday, May 18, 2004

When I work on an article, or a newsgroup answer, I often find myself writing little bits of code to tinker with the framework. Sometimes I just want to try out a scenario before I write up a theory as fact. Other times I just want to see what happens in edge cases through observation instead of digging into a spec or decompile code with Reflector. I’ve found this is a good way to clarify grey areas of documentation.

Many times these little code snippets live inside a project in a temp directory with the name of ConsoleApplication9 or something along those lines, and they eventually end up in the recycle bin. Then tonight it finally hit me on the head with a thud – I should use NUnit, and formalize these snippets into something useful - an ongoing work of tests and experiments.

Now, whenever a new version of the framework arrives, be it a major release or a maintenance / bug fix release, I can execute the tests and see what has changed or been fixed.

I can see a potential benefit for authors who will want to update a work for future versions of the framework. By codifying a book’s descriptions of framework behavior into unit tests, an author can spend less time reading the “What’s new” section of the framework documentation. When combined with unit tests for all the sample code, the turnaround time for revision could be much quicker, which makes both author and editor happy people.

In this community of bright people, I’m sure someone has already thought of this. Maybe there is already a book out about TDP and I just don’t know about it.

Speaking of books, I’ve also been eyeing the book ‘TDD in Microsoft .NET’ as a potential purchase. Steve Eichert has a positive review, and I’m wondering what Marcie Robillard thinks of the book. All of my TDD knowledge has been built from conference and magazine material, so it would be nice to have a more comprehensive and detailed source of information.

Anil John Tuesday, May 18, 2004
Scott, I have both the "TDD in.NET" book as well as the the "Pragmatic Unit Testing in C#" and would recommend both. I definitely got a lot out of the TDD book in the areas of using NUnit to test a layered application. BTW, the Pragmatic Starter Kit (The C# book is part of it) @ "http://www.pragmaticprogrammer.com/developers/starter_kit/index.htm" is great and recently won the Jolt Award as well..
<br>Remind me and I'll bring it to the next UG meeting if you want to check them out before buying..
Marcie Robillard Wednesday, May 19, 2004
So far so good, I'd highly recommend it. I'm about half way through it right now.
Comments are closed.