Thursday, November 02, 2006

Unit Testing

Are you using unit testing as an active part of your development? We have been advocates of unit testing and test-driven development for some time, and more clients are actually requiring this as part of the development process.

A unit test verifies that a function or set of functions "honors its contract" -- in other words, that the function(s) under test meet the requirements.

We've used NUnit in some of our projects, with great success. NUnit is a unit-testing framework for all .Net langauges and was initially ported from JUnit (a regression testing framework for Java).

While unit testing is not the holy grail, it should be another important tool in your toolbox. If you're interested in learning more about unit testing, Marc Clifton has written a good series of articles called Advanced Unit Testing. Marc does a great job of explaining the pros and cons of unit testing, and he shares our framework development style. Take a look.