Monday, June 12, 2006

Unit Testing with VSTS

I attended the MS Tech-Ed session on Unit Testing with Visual Studio Team System last friday. Unit testing .NET code is not something new. Developers have been doing unit testing of .NET code since .NET is out. To name a few .NET unit testing tools are :

With VSTS microsoft has integrated not only unit testing framework with .NET IDE but has added supports to other testing, such as functional and load testing. Code coverage and Static Code analysis tool (FxCop) are other tools which are available with VSTS.

There has been already a lot of talk about the pricing for VSTS and different flavours of Visual studio 2005. Professional version doesnot have any of the above mentioned tools, while VSTS for developers (VSTD) has unit testing, FxCop and Code Coverage but functional (web testing) and load testing tools are not available with this. To get functional (web) testing tool and load testing tool you will have to buy Visual Studio team suite or VSTS for testers.

Unit testing tool available with VSTS is very similar to NUnit with added features like you can right click on your method/class and create unit test. It will create a unit test and test project for you. You can go ahead and modify the unit test by setting proper values etc. Other features of this unit testing framework are that you can make your test data driven and can see the coverage of your tests using code coverage.

The thing I like about this unit testing framework integrated with .NET IDE is that I can use my unit tests for load testing and as well as for my subsiquent build verification tests. Since this unit tests are nothing but similar .NET projects I can store them in source safe and can have different versions of my unit tests.

Here is a good article on MSDN on unit testing walkthrough with visual studio team test .

No comments: