Automate .NET Assembly Unit Testing
by Ken Cox
|
Quick Facts
.TEST 1.0
Parasoft Web: www.parasoft.com
Phone: 626-256-3680
Price: $3,495 per single user (machine locked)
Quick Facts: Automates unit testing of classes in .NET assemblies by analyzing coding standards and probing functions.
Pros: Handles the mind-numbing testing that developers don't do well; exercises code thoroughly; creates customizable tests and reports.
Cons: Expensive for individual use; license tied to one computer; somewhat sluggish; avoidable installation glitches. |
|
Enterprise Application Lifecycle Management 2003
.TEST 1.0 is a sophisticated automation tool for unit testing .NET assemblies. Its purpose is to allow you and your manager to root out poorly written code and errors that could cause crashes. This automated error-prevention application takes you directly to the troublesome source code and even suggests a fix before the assembly gets off your hard drive.
You can point .TEST to a .NET assembly (DLL or EXE) and generate two types of reports. The static analysis shows violations of coding rules (drawn from Microsoft's Design Guidelines for Class Library Developers). This feature evokes visions of a Dilbert cartoon where the boss uses .TEST's charts to show the number of times Dilbert used "mysterious acronyms in property names." Fortunately, you can delete annoying rules, such as the one that flags the parameter name "e" in VS.NET-generated code.
The dynamic analysis shows .TEST's real strength. It creates stubs (in C#, not VB.NET) and test cases that exercise your functions with bad data, such as a Null where you expect a string. You can drill down into reports that reveal the code's weaknesses and failures (see Figure 1). For example, you can see the test values, the expected result, and the actual result for each call. You can edit these scenarios and retest for regression errors. A valuable .TEST feature for Web developers would be a dynamic scan to ensure that user input is validated to thwart scripting and overflow attacks.
Parasoft boosts .TEST's performance by prescanning your .NET assemblies, but the tool seems sluggish, especially on startup, perhaps because it uses the Java runtime. The documentation is usable but could go further to teach developers what makes their code accident-prone.
Installation of .TEST wasn't smooth. The VS.NET toolbar add-in failed, because .TEST wanted Visual C++ .NET—and the older 2002 version at that—installed on my machine. Parasoft support incorrectly diagnosed a failure to shut down VS.NET before the installation. (The setup should check for that condition anyway.) The final hurdle was a license key that disabled most product features. After all that, .TEST's VS.NET integration turned out to be somewhat shallow, consisting mainly of launching the standalone GUI and displaying troublesome source code.
However, this valuable tool handles the mind-numbing drudgery of testing and retesting every line of code in every assembly in a project. If you're an independent developer, you might dream of automated bug hunting with .TEST at your workstation before a daily check-in. However, at .TEST's steep price—with the license tied to a single machine ID—a common build machine is a more likely installation location.
About the Author
Ken Cox is a VB.NET developer in Toronto building e-commerce Web applications and XML Web services. Ken is a former broadcast journalist and a Microsoft MVP for ASP.NET. Reach him at .
Back to top
|