Test with Coverage.

Your unit tests aren’t as effective if you don’t use code coverage to measure how much of the code your tests are exercising. For development at home and work, I’ve been using NCover, which has worked wonders for my unit tests. When I started using NCover over a year ago, I wanted something that would integrate with VS so I wouldn’t have to do all this configuration work for every project. I started a project that held my interest for about three weeks. That fizzled (I blame TV).

What I resorted to was a batch file that ran NCover followed by NCoverBrowser. Add that as a solution item, and you can launch it from the IDE anytime. (I learned that last bit last week.)

Well, I no longer have to rely on batch files! Jamie Cansdale has taken TestDriven.net to a new level: testing with coverage. One of my favourite features Microsoft didn’t put in every version of Visual Studio 2005 is now present for Visual Studio 2003/2005, including Express Editions. Yes!

It does the exact same thing as my batch file, except I don’t have to write a batch file.

It requires NCover 1.5.1 Beta 2, a brand new version of NCover targetting .NET 2.0. It has some exciting features in its own right, including Attribute-based type exclusion.

Check it out.