The time has finally arrived. The coding is finished and
everything has been tested as thoroughly as possible, so the next step is
rollout, right? Well, you may want to take a step back and evaluate the
application’s performance under expected conditions before the unveiling.
Microsoft provides its own tool for Web applications with
the enterprise edition of Visual Studio .NET (VS.NET) in the Application
Center Test (ACT). Let’s take a closer look at putting this tool to work.
What is ACT?
ACT’s purpose is
to stress test Web servers, as well as analyze the performance and
scalability of Web applications. It allows you to simulate a large group of
users by opening multiple connections to the Web server and sending HTTP
requests. It supports various authentication schemes, so you can easily test
secure and public sites. It was first developed for ASP-based sites, but may be
used with ASP.NET sites (or other languages) as well. While it is a Microsoft
product, it may be used to test any Web server.
Making it work
ACT is available as an optional feature when installing
VS.NET. You must specify that it is installed to make it available on a
workstation. There are no server components that must be installed.
Once it is installed, Application Test Center projects are
listed under Other when creating a new project in
VS.NET. It includes only one project type called ACT Project, which contains three
item types that you may add to the project:
- Browser-recorded test: A user’s
browser session is recorded. The recorded session is used to simulate a
user session during testing. In fact, multiple instances of the session
may be opened for numerous connections. In addition, multiple sessions may
be recorded, and tests may be executed to use the sessions from various
workstations. This allows you to simulate multiple users. - JScript test: Tests may be developed
using the JScript language. You can specify your
own path through a site by loading various pages. There are various ways
to call Web pages. - VBScript test: Tests may be
developed using the VBScript language. It is the same approach as JScript.
The result of each test is the same: a script for testing an
application. The only difference is the browser recorded test generates the
VBScript automatically. A test has various properties that let you control
certain facets of testing. They include the following:
- Iterations: The number of
iterations to run the test. - RunTime: The time (in seconds) to run the
test. - WarmupTime: The time (in seconds) to run the
test before statistics are compiled. - Connections: The number of
simultaneous browser connections to use during the test.
I created the following simple test via VS.NET:
Test.SendRequest("http://www.techrepublic.com/")
You can gain a better understanding of the syntax used when
developing ACT tests by recording a session and viewing the resulting code.
Basically, it opens the home page of the TechRepublic
site. I ran the test within VS.NET (right-click on Test and select Start Test).
The output in Listing A was
generated.
The results tell us a request for the site was made every
second, and there were no errors of any kind. While VS.NET is a great tool for
developing tests, the installation of ACT includes its own client.
The ACT client
The ACT client is a more robust way to work with tests. It
lets you create new tests with JScript or VBScript as
well as record new tests. In addition, test results are available in the test
area of the interface, and you can manage the various users that may be used in
the tests. There are additional test properties as well.
The properties window provides three tabs: general, users,
and counters. The general tab allows you to specify the number of simultaneous
browser connections as well as how long the test should run (or how many
times). The users tab allows you to specify users for the test or automatically
generate users. You would create users on the fly for non-secure sites, but
specific users with passwords (set up in the ACT client) would be necessary for
a secure site. The counters tab allows you to add performance counters to the
test. They follow the same setup as Windows operating system performance
counters.
A great feature of the ACT client is the test results are
presented graphically. Words and numbers are great, but nothing is better for
presentation than a graph. Multiple performance counters are displayed on the
graphs using different colors. While the graph is good, more detailed
statistics are available as well.
Listing B contains the results that were generated for our sample test.
Third-party tools
While ACT is a great testing tool, it isn’t the only option
available. Various third-party products, such as Mercury
LoadRunner and the ANTS Bundle,
are available and may provide features not found in ACT and vice versa.
See how your app performs
Microsoft ACT provides a simple way to test your Web
applications before rolling them out to the target user group. It allows you to
pinpoint any bottlenecks or problem areas that may cause problems during usage.
While there are a number of tools on the market that make it easy to stress and
load test an application, ACT is freely available with the enterprise edition
of VS.NET, thus making it an appealing choice.
Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.
Miss a column?
Check out the .NET Archive, and catch up on the most recent editions of Tony Patton’s column.