Recently, I needed to do a quick bit of load testing on some code that was about to be deployed to a heavily loaded production environment. I used Visual Studio team system to do this, and this mini-article has a few notes about my experiences.
Obviously you'll need a copy of Visual Studio that has the testing components in it, such as Visual Studio Team System, or Visual Studio 2005 Team Edition for Software Testers (this might not be the full / correct name of the Testers version). I had a separate machine to install this on, which was something I was pretty grateful for later as you'll see. In the past I've seen some people have a preference for using virtual machines to do testing on. This has obvious advantages in terms of being able to move / reset your test environment, but I wasn't comfortable with this approach for my load testing, due to concerns about creating an additional potential bottleneck.
Once Visual Studio was loaded on my test box, I created a new test project and went about creating some simple web tests against the application. At this point I noticed a fairly major problem. The URLs were being recorded successfully, but all the postback parameters were missing. For me, no postback parameters meant no meaningful requests and no generated load. After a lot of googling, I came across this link which shed a bit of light on the issue. Apparently, there's a known bug due to be fixed in the upcoming Service Pack 1 for VS2005. The issue occurs when a page has "enctype=multipart/form-data" and doesn't perform a file upload. In my case, I was attempting to test DotNetNuke modules, and DNN uses this enctype across all of it's pages.
Next I tried to find the service pack. At the time of writing, the service pack has not yet been released, although it is in beta. I couldn't find any information about a release date, although that might have changed by now. Initially it seemed like you needed to be registered for the beta program in order to get access to it, however after a fair amount of googling I stumbled onto this download link. A short 380mb download later, I installed the beta of the service pack (at which point I was glad to be doing all this on a seperate machine), and my web tests were recording postback paramaters against my DotNetNuke modules. Yay! Only a waste of about 6 hours, but hey, that's life.
From here on in, things went pretty smoothly. Creating basic web tests is pretty simple and self explanitory, as is the next step of adding your web tests into a load test profile. The load test "Wizard" gives you control over a lot of options and different modes of behaviour. Luckily I was simply trying to hurt our servers and application as much as possible, so I didn't need to think too much about many of the options, even though it was nice to know that they were there should I have needed them.
There's a lot of material on MSDN about testing. The content here should enable Testers with no Visual Studio experience to get up and running with the product pretty quickly. Most of it can be found from the Visual Studio Team System: Team Edition for Testers page. It covers the basics of unit tests, web tests, load tests, as well as going into deal of manual tests written using code instead of the UI, and also touches on data driven testing for people who need to be a bit more thorough than I was.
Summary
Visual Studio has some nice tools to make testing a lot easier. The tools are pretty simple to use, which is going to be a great bonus for people like myself who don't do a lot of testing. The enctype bug was pretty annoying - and that's most of the reason why I'm writing this. It took me a long time to stumble across the reason for my postback parameters problem, so hopefully this article will save time for anyone else out there who's experiencing the same issue. Despite all that, once the Service Pack was applied everything went very well.
Additional Resources
Link: Web tests don't record postback parameters
Link: Download Details - Visual Studio 2005 Service Pack 1 Beta
Link: MSDN: Test Types
Link: MSDN: Working with Load Tests
Link: MSDN: Working with Web Tests
Link: Visual Studio 2005 Team System Learning Guide
Link: Team Test and the Load Test Agent
Link: Visual Studio Team System - Testers Forums