Saturday, March 28, 2009

Regression - A tester's nightmare, Unit tests - A boon to developer

One of the greatest challenges to any software product development is a defect-free release. The QA is the most under scrutiny, though every participant in the Software Development Life Cycle (SDLC) is collectively responsibile.

The major hurdle in a QA sign off is the regression testing. A regression is a defect introduced, affecting the application's feature, believed to be working in the past. There is no effective means to curb this regression other than unit testing.

So, What is unit testing?
Unit testing is also a piece of code written by the developer which has the following benefits:

1)A developer can safeguard his code so as to prevent regression by the introduction of another code.

2)It also acts as a means to prove that the code introduced is tested, for the functionality it is supposed to deliver.

How does the Unit tests achieve the stated benefits?

Since unit tests are also code developed parallely with the main application as discussed earlier, they can be integrated with the build process. So, whenever a build is made, the unit tests are run in a sequence and any regression would be identified by the failure of a unit test with a negative result.

Some popular unit test software platform are JUnit (for Java), NUnit (for .Net). Apart from these freewares, Resharper offers an integrated Unit testing platform. Thanks to Visual Studio 2008, which creates unit tests on click of a button, saving much of a developer's time and alleviating the fears of writing unit tests for complex GUI code.

No comments: