1. Are Your Teams Writing Quality
Code?
Ervin Loh
Microsoft MVP
Email: loh-chuanho@k365labs.com
Blog: http://ervinloh.spaces.live.com/
1
2. Scenario
You reached the final mile before facing the
real world. Learn how Visual Studio Team
System assist you in detecting potential
performance problems before you deploy
your application to the real world.
2
3. Agenda
Overview of Web Tests
Overview of Load Tests
Interpreting Test Results
Test Case Development
3
4. Overview of Web Tests
What Are Web Tests?
What Is the Importance of Web Tests?
How Web Tests Are Created
How Web Tests Are Run
What Are Validation and Extraction Rules?
Demonstration: How to Verify Web Tests
Demonstration: How to Create and Run a Web
Test
4
5. What Are Web Tests?
Web tests are used to test the functionality of
Web applications.
Web tests consist of a series of HTTP requests.
Requests are replayed by an agent, and not a Web browser.
The Web application being tested can be any
HTTP application, and not just an ASP.NET
application. It can also be based on the new
AJAX support.
Web tests can be run in parallel to create load
tests:
A load test simulates multiple users opening simultaneous connections
to a server and making multiple HTTP requests.
5
6. What Is the Importance of Web Tests?
Web applications are becoming increasingly
complex.
Many Web applications host business
critical functions.
Web applications must have both high
performance and be broadly scalable.
Consumers are expecting ever more
compelling and stable Web sites.
A single problem can lose the loyalty of millions of users.
6
7. How Web Tests Are Created
Recorded Web tests are:
Created by simply recording a browsing session.
Stored as XML.
Edited graphically in the Web Test Editor.
Coded Web tests are:
Generally created by converting a recorded Web test.
Stored as .NET Code (VB.NET or C#.)
Edited in a code editor.
Can easily access the full power of the .NET Framework.
Necessary for branching and looping.
7
8. How Web Tests Are Run
Web Tests can be triggered in the following ways:
• Web Test Editor
• Test View Window
• Test Manager Window
• Command Line
• Using the Web Test Viewer:
Web Test Viewer shows an overview of the status of individual requests.
View the details of each request in the Web test and the resulting
response to those requests.
8
9. What Are Validation and Extraction Rules?
Validation rules help verify if the Web
application is functioning properly. They
verify the:
Existence of text, tags, or attributes on the page returned by a
Web request
Time it takes a request to finish
Existence of form fields and their values
Extraction rules:
Extract data from the responses to Web requests
Store results in the test context as name value pairs
Can extract form fields, text, attributes, headers, regular
expressions, and hidden fields.
9
10. Demonstration: How to Create and Run a
Web Test
At the end of this demonstration, you will see how
to:
Record a Web test.
Edit a recorded Web test.
Run a recorded Web test.
View the results of a test run.
Convert a recorded Web test into a coded Web
test.
10
11. Demonstration: How to Verify Web Tests
In this demonstration, you will see how to
verify a Web test using the Web Test Viewer.
11
12. Overview of Load Tests
What Are the Functions of a Load Test?
Types of Load Tests
Considerations for Choosing Load Profiles
Considerations for Choosing Connection
Models
Demonstration: How to Create a Load Test
Using Load Test Wizard
How Load Tests Are Run
Demonstration: How to Run a Load Test
12
13. What Are the Functions of a Load Test?
The primary goal of a load test is to simulate many
users accessing a server at the same time.
Adding Web tests to a load test simulates simultaneous connections to a
server, and making multiple HTTP requests.
Adding unit tests to a load test is equivalent to testing the performance
of non-Web based server components, for example, an application of a
unit test under load is to test data access model components.
13
14. Types of Load Tests
Type of Test Description
Smoke Tests how your application
performs under light loads for short
durations
Stress Determines if the application will
run successfully for a sustained
duration under heavy load
Performance Determines how responsive your
application is
Capacity Planning Determines how your application
performs at various capacities
14
15. Considerations for Choosing Load Profiles
A load pattern defines the number and increase
rate of virtual users active during a load test. The
types of load patterns are:
Constant
Step
Goal-based
15
16. Considerations for Choosing Connection
Models
Connection Model Features Considerations
• Most closely simulates
the behavior of a real
Number of
browser
connections held
• Uses one or two
Connection Per open on the agent
connections per virtual
User computer may be as
user
high as twice the
• Same connections are re-
user load
used for subsequent
requests
• Connections to the Web
server are shared among
One Web test may
virtual Web test users
Connection Pool have to wait before
• Tests that are running on
issuing a request
by different virtual users
could share a connection
16
17. Demonstration: How to Create a Load Test
Using Load Test Wizard
At the end of this demonstration, you will see how
to create a load test using the Load Test Wizard.
17
18. How Load Tests Are Run
Load Tests can be triggered in many different ways
Web Test Editor
Test View Window
Test Manager Window
Command Line
Using the Load Test Viewer
Web Test Viewer shows an overview of the status of individual requests
View the details of each request in the Web test and the resulting response to
those requests.
18
19. Demonstration: How to Run a Load Test
At the end of this demonstration, you will see
how to
Run a Load Test
View the Load Test results
19
20. Overview of Interpreting Test Results
How Load Test Analyzer Is Used
What Is the Load Test Repository?
What Is a Test Rig?
Demonstration: How to Access Load Test
Results Using Load Test Analyzer
20
21. How Load Test Analyzer Is Used
Use the Load Test Analyzer to view Load Test
data from a completed test run.
Analyze the test run to locate bottlenecks,
identify errors, and measure improvements.
Load test data contains:
Performance counter samples from the computers under test, plus
any other configured performance counters.
Error and threshold rule violation information.
The test controller saves some performance
counter data for a test run; the amount
saved, and it’s location, is configurable
21
22. What Is the Load Test Repository?
Information gathered from load tests is stored in
the Load Test Results Store.
The Load Test Results Store contains
performance counter data and information
about recorded errors.
Load test run data from previous test runs can
be retrieved using Load Test Analyzer.
22
23. What Is a Test Rig?
A test rig is made up of a test controller and
one or more agents. A test rig:
Provides distributed, automated test execution.
Can simulate hundreds of thousands of users.
Can generate far more load than a single machine.
23
24. Demonstration: How to Access Load Test
Results Using Load Test Analyzer
At the end of this demonstration, you will see how
to access load test results using Load Test
Analyzer.
24