Testing Visual Basic .NET with NUnit
NUnit is a testing framework for all .NET languages. The basic idea is that you create a class library that calls into your code, sending test values and evaluating responses automatically. The big payoff is that NUnit can run these tests automatically and be integrated as part of your build, test, and deployment lifecycle.
Let me take a moment or two to describe how you can integrate NUnit into your software development lifecycle, and in so doing, offer good arguments for integrating NUnit into your development lifecycle.
I have long subscribed to the idea first promoted by others (like Grady Booch) that testers and programmers should be involved as observers during the analysis phase. At this juncture the programmer's role is to begin prototyping things that represent the riskiest aspects of software development, and the tester's role is to begin recording necessary tests to validate these business rules. By integrating NUnit all players—the customer, analysts, programmers, and testers—have a common frame of reference for recording these tests. Because NUnit tests are written in .NET the testers can write tests without knowing the inner-plumbing details of the code; testers simply need to know how to interact with the business rules. And, because the customers and analysts are involved in defining these tests from the outset, they are more likely to get tests that validate the business rules from the customer's and analyst's perspective, rather than all-positive tests defined by the programmer.
The net effect is that everyone knows in advance what the tests must be, the platform in which those tests will be captured, and NUnit can be used as part of an automated development lifecycle. Because the NUnit GUI uses a simple go, no-go means of indicating whether tests have passed or failed, the fudge factor is eliminated. A positive benefit is that even if you cannot afford full time testers, you do not have to leave test definitions up to the programmers alone. Everyone can participate in the test-definition process, even if the programmers are actually codifying the tests.
In this article I will demonstrate how to use some aspects of NUnit and hopefully convey the powerful benefit incorporating NUnit into your product's lifecycle can have.