Web Performance Test Using Visual Studio - Part II

Ambily.raj
Posted by in Visual Studio category on for Beginner level | Views : 76126 red flag
Rating: 4.8 out of 5  
 5 vote(s)

Performance of an application is very important for a multi-user application. Performance is not only the speed of execution; it includes the load and concurrency aspects. Visual Studio is one of the tools used for Performance Test. Visual Studio Test edition or Visual Studio 2010 Ultimate provides the support for test automation.

Introduction

Performance of an application is very important for a multi-user application. Performance is not only the speed of execution; it includes the load and concurrency aspects. Performance Test is an answer for the following questions

  • How can we ensure that our new application will support the expected user load?
  • How to avoid the issues which will arise only in real load conditions?
  • How to find the response time?
  • How to plan the capacity of the servers?

Visual Studio is one of the tools used for Performance Test. Visual Studio Test edition or Visual Studio 2010 Ultimate provides the support for test automation.
 
This will be the second part of a series of articles.


Part I:  Web Test and Customization
Part II: Load Test, RIG and Load test terminologies.
Part III: Performance Counters, Load Test Result Analysis. 

Load Test

Load test is used for performing load test on an application. It simulates multiple users as virtual users and executes the test scripts to simulate the real user load on different servers like Application Server, Database server and Web server. Load test can be used with any of the test scripts.

Different Terminologies

 

Think Time

Think time is the time taken between two requests. This can be the time taken by the user to fill a form, view a page or reading some text etc. Think times are used for simulating the real user scenario; how the system will work with a real user.

Constant Load

Constant load means same number of users hit the site from the starting of the test till the end. It is like 25 users are using the system for a period of 1hr. All 25 users are hitting the system continuously. This type of testing is mainly used for stress testing.

Step Load

In step load, users will join in a step manner. This is the same as different users hitting the system in various times and the number of users in a system is not constant. Following parameter needs to be specified in step load pattern

Start user count :- How many user should hit the system at the time of test start
Step duration :- After how many seconds the next users should join the system
Step user count :- How many user needs to join the system after step duration
Maximum user count :- what is the maximum user count.

Test Mix

Test Mix specifies how different scenarios are executed or used in the system. Different test mixes are formed by studying the system’s usage.

For example, if we are doing a load testing on online marketing site; around 60% people will search for different products, 30% will buy few products and 10% bookmark the products. From this usage information, we can form a test mix as 60% simulated users will execute the script for search, 30% will execute the script for buying a product and remaining 10% will execute the script for bookmarking a product.

Load test Creation

Right click on the project and select Add -> New Test -> Load test template. It will open the New Load Test Wizard


Next, specify the scenario name like booking the ticket, searching a book, etc. Also specify the Think Time profile. We can either use the think times recorded as part of the web test recording or can use a normal think time distribution. We can also avoid the think times recorded in the web test using the third option.


Next, specify the Load Pattern. Specify whether we are going to use a constant load or a step load pattern. In constant load specify the user count. In case of step load specify the start user count, step duration, step user count and maximum user count. 
 

Next, specify the test mix model. The different options are
[Following definitions are from Visual Studio]

Based on the total number of tests
This model of test mix determines which test is run when a virtual user starts test iteration. At the end of the load test, the number of times that a particular test was run matches the assigned test distribution. Follow this model when you are basing the test mix on transaction percentages in an US log or in production data. 


 Based on the number of virtual users
This model of test mix determines the percentage of virtual users who will run a particular test. At any point in the load test, the number of users who are running a particular test matches the assigned distribution. Follow this model when you are basing the test mix on the percentage of users running a particular test

Based on user pace
Over the course of the load test, each test is run the specified number of times per user per hour. Follow this model when you want virtual users to run tests at a certain pace throughout the load test.

Based on sequential test order
Each virtual user runs the tests in the order that the tests are defined in the scenario. The virtual user continues cycling through the tests in this order until the load test is complete. 


Next, specify the Test Mix. In Test Mix, we are adding different web test scripts to the load test. If we have only one script, all the users are going to perform the same task. If we have 2 or more scripts, we can specify, how many user needs to perform a specific task.

For example, we have two scripts, one for searching a book and another for buying a book. In my load test, I can specify that 70% of users to do search and remaining 30% do the other operation.


Test mix is also for simulating the real user experience. Some of the features are used by many users and others may not be used that much frequently. Depends on the feature usage, we can test the system, which will give a real performance result. 




In the following example, we selected two web test scripts and specified the test mix as 65% of the users will execute Webtest1 and 35% will execute Webtest2. 




Next, specify the network Mix. Here we can simulate the network like LAN, WAN or internet and compare the performance of the system in different networks. 




Next, specify the Browser mix. This will be useful to find how the system is performing in different browsers. 



Next, add the systems used as web server, application server and database server for collecting the performance counters. Add the required performance counters for each system. 




Next, specify the duration of the test or how many iterations are required. If a warm-up period is set, the load test will automatically increase the load gradually during the warm-up period. 




Once, you finish the creation of the load test, it will create a .loadtest file like below. We can edit and add all the settings directly from the below screen itself.


Select the constant Load Pattern and select the corresponding properties. From the property grid, we can change the load pattern as Constant, Step or Goal based.


Goal based load test is used to find the maximum user load which satisfies the condition. Here, we are setting the goal like average response time should be 8min; once the system reaches the goal, it stops execution. Same way we can use goal based testing to find the maximum load which support a processor utilization of 70%. 

 

 

From the Run Settings properties, we can alter the run duration, web test connection pool size, web test connection model, warm-up duration, etc. 



 

We can specify the threshold value for counters. Once it reaches the warning level, it will start displaying warning. When it reaches the Critical threshold value, the requests will start failing. 

 

You can add custom counters and counter sets to the Counter Sets collection.




From the Scenario properties, we can alter the Think time profile and associated think time.


 

Execute Load Test

Execute the load test by selecting Run test. 




Once the test started, you can observe different performance counters and test status in the following screen. You can drag the counters from left side and drop it in the graph area, which will display the graph corresponding to the counter. Requests summary and tests summary can be observed under Overview section. 




We can observe the requests, errors, pages, transactions and the details like how many failed, response time, content length from tables option.




You can change the graph display options to only one graph, two vertical graphs, four vertical panels, etc.


Result

Once the load test execution completes, it display the summary report as follows.

 

 
We can export the report to Excel using Create Excel Report option. It creates an excel report with multiple sheets representing average response time, runs, page time, etc.
We can create two types of reports.
                Trend – create an excel report with the trends in the selected run result.
                Comparison - create an excel report by comparing two or more run results.


 
Detail option will allow us to study the result in granular format. We can select the time period from the bottom area and study the trend in that particular period. 


Rig

Sometimes, in performance test, we need to test the system with very high load.  Each machine is having limitation in generating the load. From one system we can go a maximum of 500 to 800 user load. If you need more load, we need to add multiple systems to perform the load test. If we are running it from multiple systems, then the analysis of test results and creation of a combined report will be difficult.

Rig is the solution for running the load test from multiple client systems. We need to install the Load controller on one system and Load agent on other systems. VSTS Rig means a group of systems, which consist of one controller and one or more agents. Controller will distribute the work among the agents and will collect the data from all agents and create a single report.

Load Controller and Load Agent installation and configuration, please refer http://blogs.msdn.com/b/edglas/archive/2007/02/17/load-agent-and-load-controller-installation-and-configuration-guide.aspx 

Conclusion

Load test can be used for performing different performance tests on a system. We can test the system by setting different test mixes, user loads, stress conditions, network mixes, browsers and load patterns. Load test will generate a detailed report, which can be queried from the LoadTest or LoadTest2010 database under SQLExpress. Also, from the result we can create an Excel Trend report or Comparison report. Summary report can be saved as HTML file.

In third part, we will look into the important performance counters and analysis of the performance test result.
 
 
Page copy protected against web site content infringement by Copyscape

About the Author

Ambily.raj
Full Name: Ambily KK
Member Level: Silver
Member Status: Member,Microsoft_MVP,MVP
Member Since: 5/18/2010 1:05:25 AM
Country: India
Thanks Ambily K K http://ambilykk.com/
http://ambilykk.com/
I have over 9 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Office Open XML, Azure, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.

Login to vote for this post.

Comments or Responses

Posted by: Msamarnath on: 2/14/2011 | Points: 25
Thanks for an excellent article.
I could not find the link to part-III of this article. Could you please provide me the link?

Thanks,
Amar
Posted by: Ambily.raj on: 2/14/2011 | Points: 25
Hi Amar

Thanks for the feedback.
Sorry, I didn't completed the 3rd part till now. Will publish it soon.

Thanks
Ambily
Posted by: Stuartsage on: 2/15/2011 | Points: 25
Hi Ambily,

Great work...loking forward for the 3rd part.

Keep up the good work

Cheers

Stuart
Posted by: Sambitkundu on: 5/20/2011 | Points: 25
Both the Part 1 and Part 2 articles are very much useful for me. Excellent work done Ambily..
Awaiting for the 3rd part egerly. When you are going to publish ?

Thanks & Cheers
Sambit
Posted by: Sambitkundu on: 5/20/2011 | Points: 25
I have one question ..
Do we need Ms Office 2010 to Create Excel Report ? Because I am getting an Object Reference Error while Creating the Excel Report and I am using Ms Office 2007.
Posted by: MadhaviS on: 9/22/2011 | Points: 25
Thanks Ambily. Is it that Load Testing can only be perfomed on Web Performance tests or can we also test it on Coded UI Tests? If so can you please help me in doing Load testing on Coded UI Tests.. And how useful is doing Load Testing on Coded UI Tests..
Posted by: Ambily.raj on: 10/3/2011 | Points: 25
Hi Madhavi

Load testing can be performed on any kind of test scripts like Unit test, Generic test, web test, etc. It can be used to load test the CodedUI test too. But Coded UI test is mainly to test the User interface of an application. Normally we will load test or performance test the functionality instead of the UI of an application.

Regards
Ambily
Posted by: Leelamanohar11 on: 12/22/2011 | Points: 25
Nice article.
Thanks Ambily
Posted by: kkalpana30-16869 on: 7/17/2012 | Points: 25
Thanks for giving excellent article.








Posted by: Sanjutronics on: 10/25/2012 | Points: 25
Hi Ambily,

A very well explained article. Loved it. You have kept it simple & neat. It's really good and is a very handy for someone like me who has just started working on the Load & Performance testing. Thank you so much.

I do have a question. I have reached a position where I can record a webtest and run the load test successfully with zero errors. I have been doing this for 2 weeks now and finding it very interesting. My question is that can we schedule load tests on Microsoft Visual Studio 2010 Ultimate version. All I want to do is schedule different load tests to start in the night so that when I come back to office next day morning the tests are done & ready to be exported to excel sheet?

Am struggling with this. Can you please help me if you can. Will appreciate any help from you.

Thanks
Sanjay
Posted by: Irshad.Ahmad on: 11/8/2012 | Points: 25
hi Ambily,

A well detailed explanation:) thanks alot... please if you have any plan writing more, plz do write about correlation and extraction rules in details.

Thanks
Irshad

Login to post response

Comment using Facebook(Author doesn't get notification)