Darrell Norton's Blog [MVP]

Sponsors

The Lounge

News

  • Darrell Norton pic

    MVP logo

    View Darrell Norton's profile on LinkedIn

    Currently Reading:

    weewar.com

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov

I recently finished reading Test-Driven Development in Microsoft .NET. What with both authors working on the open source NUnit project and James Newkirk being the lead, this book had a lot of hype to live up to. I’m satisfied to say that it lived up to most of it.

The first few chapters introduce Test-Driven Development and why you should use it. There is a detailed example of both developing new code using TDD and refactoring existing code. The examples are good because they are different, but I personally don’t think it is enough for someone new to TDD. For that I would recommend Test Driven Development: By Example by Kent Beck.

The heart of the book is the example that is carried through the book, developing access to a music database through web services. This allows the authors to tie in difficult testing concepts such as using TDD with a database and web services, as well as a short chapter on UI testing. James and Alexei also cover using the Fit program for creating end-user tests. While I think it is important to test the system as a whole, I’m not sure if Fit is the way to go, and that would be my only complaint with the book. But they do provide a good introduction to using it.

The authors also show the use of patterns fairly heavily. The classic Design Patterns and the Patterns of Enterprise Application Architecture are covered. This helps to integrate solid software development practices with TDD and show how and when introducing patterns is appropriate during the process.

Another thing to remember is that while the examples in the book are certainly a very good way to use Test-Driven Development, they are not the only way. There are other approaches and methods to testing. For example, in the book James Newkirk avoided all use of mock objects due to personal preference. The book is a guide, not the gospel.

If you have some experience using TDD, this book will take you to the next level. It covers the hard stuff that all previous examples have skipped. If you’re brand-spanking new to TDD, do yourself a favor and read Kent Beck’s book and follow along with the examples first.


Posted 06-02-2004 2:08 PM by Darrell Norton

[Advertisement]

Comments

JosephCooney wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-02-2004 12:01 PM
I am glad somebody else has made a comment on FIT. I have been meaning to post a rant on it, but wanted to do a bit more research on it first. I found the use of FIT to be very distracting in what was otherwise a good book.
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-02-2004 3:39 PM
Joseph - I'd look forward to the research if you can spare the time for it!

Fit just doesn't "fit" with me, but I've no hard data to back it up other than it is just a way for the user to verify the system without a UI.
JosephCooney wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-03-2004 2:49 AM
FIT grates me on a number of levels...first the "HTML table" syntax. Yikes. FIT would have to be a fairly easy language to write a parser for, why not just do that rather than rely on the end-user creating the tables properly. If a user can't write code then writing HTML tables by hand is going to be just as foreign, and writing FIT scripts in a HTML WYSIWYG editor is bound to be painful. Also the fact that you have to write those "adapters"...For most users I know the GUI _IS_ the application, and I think I would have a hard time convincing them that there was any value in testing anything else. There has got to be a better way to do user-driven integration testing.
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-03-2004 3:30 AM
User-driven integration testing... sounds interesting. Hmmm... I'll have to think about that, especially in regards to my current project.
Mack D. Male wrote RE: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-03-2004 10:25 AM
Thanks for the review Darrell, very helpful!
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-03-2004 4:11 PM
Glad you enjoyed it!
Jeff Key wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-04-2004 3:17 AM
I've been looking at this book, but haven't read much about it. You've delivered the goods once again. Thanks!
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-04-2004 3:26 AM
Sure thing Jeff!
Yazid Arezki wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-16-2004 12:38 AM
I am using FIT and it is a great idea. HTML Tables, I create them on fly for the user. Most often clients are not happy with the application not because the developers are not good but the requirements have been misinterpreted. Ward's new framework offers a new way for tackling the problem.

Check Fitness.

Dr Y Arezki
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 06-16-2004 1:14 AM
Ok, maybe I'll give it another try. :P
Alexey Kouzmitch wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 01-05-2005 3:55 PM
I am only starting my research into Fit, but I'd say that Fitness could be a good way to go, although there is not much structure to a WIKI. There is an article in the January (maybe December) MSDN Mag with an example of creating Fit tests in Excel and then parsing them into Fit. THat seems like a much better approach than any so far. Excel is the #1 tool of a business user and they would be able to model all their business logic in it. THrow on top of that a simple tag (e.g. $TEST$) and you have a way to define tables with calculations and more... It seems to me that Action tests are the biggest stretch in Fit and require most time to create good tests for, but Excel as a test generation tool is a great idea. THe author even wrote a tool to parse multiple Excel files into test suites. And the tool itself is written using TDD with Unit tests provided.
Great article in my opinion.

Alexey.
Darrell wrote re: Review of Test-Driven Development in Microsoft .NET by James Newkirk, Alexei Vorontsov
on 01-05-2005 4:00 PM
Yes, much has changed in the 6 months since I wrote this.