Although writing a unit test is easy, it's much harder to write reliable, readable, and maintainable unit tests without much experience. To aid the less experienced developers and even the more experienced ones, Roy Osherove the chief architect at Typemock and author of "The Art of Unit Testing" wrote down many of the common problems he's seen in his lengthy experience with unit testing. All of that knowledge was then compiled into a VS 2010 extension called Test Lint. The program is especially helpful for unit testing newbies. It's a lot like having Roy Osherove as your own personal coach helping you in real time.
Test Lint gets its name from a type code-flagging program for C. Lint-like tools are generally ones that perform static source code analysis. Test Lint parses your code as you type it and you are notified about a possible issue with a visible queue in the right margin every time the program sees a problem. As the beta progresses, more rules will be added and users will be able to write their own rules within Test Lint's parsing infrastructure once the documentation is complete.
Test Lint currently searches for these problems:
- Missing asserts
- Multiple asserts or verifications on different objects within the same test
- Tests invoking other test methods
- Logic mistakes such as loops, Ifs, Switches, etc.
Test Lint supports these testing frameworks:
- Microsoft Test Framework
- .NET BDD releated frameworks such as SpecUnit
To install and use Test Lint you simply unzip the package and install it on VS 2010 while the program is not running. After that, you just start coding a new test or open up existing test code and Test Lint will begin parsing and coaching you. You will be asked to update after 30 days so that you aren't running the least stable version.
Other Typemock tools:
- Typemock Racer - Makes it easier to locate, reproduce, and debug deadlocks.
- Typemock Tracker - Measures the ROI of unit testing and collects implementation productivity statistics for graphical analysis.
- Typemock Isolator 2010 - Works as a guide with intelligent code completion and discoverable APIs. It isolates code without any restriction and without setting up any complex configuration. It also helps set the behavior for entire hierarchies in a single line with test-writing help for complex scenarios.
You can see Test Lint in action by viewing this video. The Typemock developers are considering a GA release of Test Lint around the VS 2010 release.