To ensure that any application works and performs as per the requirements, it is imperative to do testing.
During testing of an application, we try and find if there are any defects remaining in the application. There are many types of testing like unit testing, functional testing, acceptance testing, as well as integration testing. We write Functional and UI tests to find out if the application is working as desired.
Many of the applications under development are web applications or web services. Most of these application now-a-days run for a long duration, for many concurrent users, over many networks and across many browsers. While testing the app, we need to find out the application’s performance by taking it to a real world scenario where there are any number of users, networks, as well as different browsers. This type of testing is called Load Testing.
Load testing helps us give an analysis of performance counters on servers when loaded to the point of actual load and beyond.
Load Testing is similar to Performance Testing which analyzes the application’s performance in real time scenario. This helps in finding out the behavior of an application under different load conditions like multiple users (constant or variable load), multiple browsers, multiple networks. When any user uses the application, he/she may take some time before clicking on any button or link. We can specify this behavior as think times while load testing is performed. We can specify the number of minutes for which the test needs to run.
Visual Studio 2017 offers Load Testing feature with its Enterprise version. It comes in two flavors – Cloud-Based Load Test and On-Premises Load Test. There is indeed one more option with Performance Test feature which is provided by Azure.
In this article, I will discuss how to create a Performance Test using an Azure Account, how to associate it with VSTS account to store history and how to observe the data.
I will discuss the Load Test feature from Test hub for Visual Studio Team Services (VSTS) in an upcoming article.
Load Testing with Azure - Pre-requisites
1. Azure Account. Get a free trial.
2. Use your existing VSTS account or a new one will be created on the fly
3. An Azure app service or application which you can test
4. A Web Performance Test which you can test for additional testing
Azure Account based performance testing can be done in two ways - one is a manual test which will automatically take the url for the running app and the other is by using Web Performance Test file. This Web Performance can be created using Visual Studio 2017 Enterprise.
I have an Azure App Service which runs a small EMS (Employee Management System) application which I am going to use for Performance Testing. Let us see a step-by-step walkthrough of how to perform a Load test on it using Azure.
If you have yet created a new Azure account, please visit this link.
Go to the portal of your Azure Account and select the application to create a Performance test.
Create Performance Test
Select Azure App Service for which you need to create Performance Test and Select ‘Performance Test’ from the menu.
Select VSTS Account
You can either create a new VSTS account or select an existing one by selecting the Set Account.
The subscription and the location are selected for existing accounts.
Run Performance Test
Once the VSTS account is selected, we will first select manual test as performance test.
The URL gets automatically selected based on the Azure App Service you are using. We can select the duration for the load test to run, as well as the user load. The load is being simulated based on the virtual users which will visit the application you are testing at the same time. This will help us in determining if any requests are failing or are being slowed. Depending on the license you have for Azure Account, you will get number of minutes for different simultaneous uses. Refer this link for more information.
Once the User Load and Duration is selected, click on Run test. The Performance Test will be automatically queued.
Select the test and you will see that the resources are being acquired before the execution of the test.
Once the wait is over, the test starts its execution and continues for the duration specified. It also takes care of the number of users which you have already set. We can see from the diagram that the test is in progress and capturing all relevant data.
The performance will be displayed while the test is getting executed.
View Test Data in VSTS account
Once the test has completed execution we can find all the analytics (charts, summary and logs) in the VSTS account which was set before the execution of the Performance Test.
These are the charts which are generated during the Performance Test. As you can see there were no errors generated.
Following is the summary for the test:
If there are any warnings or errors, these charts will help in finding out the problems.
Multiple URLs can be tested by associating the test with the web test and not using manual test. (You will have to create a Web Performance Test first using Visual Studio 2017 Enterprise)
Observe that the URLs are automatically selected depending on the web test.
Select the User Load and Duration and click on the Run test button. You will get a similar chart for the new performance test. Later when you select the VSTS account, you can observe the two tests shown under Load Test.
In this article I have discussed how a performance test can be created and executed using an Azure Account. In the next upcoming article, I will be discussing in details about the Load Test tab and available features.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce the pre-order of The Absolutely Awesome Book on C# and .NET. This is a concise technical eBook and will be available in PDF, ePub, and mobi.
Organized around concepts, this eBook aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core. Use these concepts in your next .NET Project or to crack your next .NET Interview.
Click here to Pre-Order this eBook at a Discounted Price!