January 24, 2006

Unit Testing for customers

OK, here is an interesting thought. A new .NET Rocks is out today and they are interviewing Adam Cogan of SSW. He is known for having a long list of rules for developers working at his company.

This includes rules for writing rules that check dependencies like datasets, schemas, and web services. How to format code, how to respond to email. You just have to read some of them.

But there was one interesting rule that caught my eye: Menu - Do you have a standard 'Help' menu that includes a way to run your unit tests?

This is something that I haven't thought about. Letting users run your unit tests at any given time. How would this be a good thing. How many times have you had a "it works on my machine" moment, followed by a screen shot that apparently displays the problem -- but it doesn't.

But, if you can have your users run the unit tests on their machine, and you have written them in a logical fashion, you could game some valuable insight to what is wrong...without having to be on the users machine!

Now, what are the hidden requirements of this? You have to be able to distribute your unit tests, and the application that runs the unit tests as part of your executable. So NUnit is fine, but you will have some trouble with Team Systems.

I am going to have to think about this a bit more, but I am really liking the sound of this idea for many cases.

No comments: