Load Testing with Visual Studio Team Service

Even in the era of cloud computing when you can scale your infrastructure more easily, building and managing a software that can scale and support a large number of users is more than just putting more powerful hardware. In this article, Dmitro Kosenko discusses the main principles behind load testing and proposes a step by step process to perform load testing using Microsoft’s Visual Studio Team Service.

Author: Dmitro Kosenko, Testmatick, https://testmatick.com/

The Meaning of Load Testing

Before thoroughly analyzing the process of load testing with Visual Studio, let’s talk about some theory. What is the reason for performing load testing and what is its meaning? To thoroughly analyze this question, we can state that this process is very important for developing any web product that has huge assembly and multi-level functionality, which should be tested with the highest speed and response rates.

In most cases, such types of tests are performed in order to cover a maximum number of users who can visit a server. It is logical that all load tests are performed during the software development stage of a product before its final release in production. Nothing extraordinary, right? But such approach doesn’t answer two simple questions: What if a server get more users? How to qualitatively fix a software code that should be able to process a maximum number of requests in one second?

Of course, no one forbids to search the error in code for some days, optimize some things, try to fix the visible errors. This is however is not the best approach for system optimization, as it doesn’t take quite logical metrics into consideration. How will you understand that the improvements you made were absolutely efficient, to state that this application or website will work well under any circumstances? What is a higher level of this? And where to find the best example of it?

Permanently asking this questions in our mind, we will discuss the second important approach to load testing. Load testing must be performed at the end of every sprint. And also it must begin when you have a final framework of a future product. The results of load testing on a good server where you upload a framework of your product will be a perfect example of testing. The next improvements and changes in a product will show you qualitative changes of your example. And if changes are very serious, you have a good reason to do additional work on optimization of a code. It’s better to search for a failure on the first stages of work on a project than to test all parts before a release.

The Process of Load Testing with Visual Studio Team Service

We must create a special virtual environment to perform all tests with a load testing tool. We will use Visual Studio Team Services (VSTS), a cloud service provided by Microsoft for collaborating on code development.

For this you need to create an account in Visual studio or Visual Studio Enterprise. Usually we use the version that is currently free up to five users. Then we start. Right after you create a free account in Visual Studio Team Services, you need to create a new project where you should mention its name and used control system of a version which will be used. You don’t need something special and any version can be used for this.

Load Testing with Visual Studio Team Service

Then you need to link your account to Visual Studio. In order to do this, go to a section Team Explorer and mention actual information on your current project.

Load Testing with Visual Studio Team Service

After that, add our new user to the list of available accounts in the system environment of Visual Studio. Type in a login and a password. Then in Connect to Team Foundation Server window we will find all our connected projects, which we’d like to test for a possible client load. After that, create a new product. In a special section, choose parameters Web performance and Load Test Project and type in a name of your project.

Load Testing with Visual Studio Team Service

As soon as we confirm a name of a project, a web test will be available. Now our task is to properly record and save this test. On a desktop, a browser window will be opened which shows a site, the actions on which will be recorded by a system.

Load Testing with Visual Studio Team Service

We can return to Visual Studio and press the “Stop recording” button. If nothing happens after this, you need to manually switch a special add-on Microsoft Web Test Recorder Helper in “Properties” of your web browser. And finally, it must look like that:

Load Testing with Visual Studio Team Service

Now your first test is successfully recorded. Then, we should test its load, simulating a big number of clients, connected at the same time. To perform this, add our virtual test to Load Test (Solution Explorer – Add – Load Test).

Load Testing with Visual Studio Team Service

We will see “Wizard” which must be passed. Firstly, choose an option Cloud-based load Test with Virtual Studio Team Services.

Load Testing with Visual Studio Team Service

Then we need to choose a location of a center from which we’d like to virtually generate necessary load.

Load Testing with Visual Studio Team Service

And mention the length of the performed test.

Load Testing with Visual Studio Team Service

Next, go to “Load Pattern” option. Choose Step Load. The logic here is simple: we need stable and equal load. This means that the load of a test will be generated in direct proportion of a quality of mentioned “virtual” clients. You can also try more interesting method which will help you to state the parameters of growth of a number of users, depending on mentioned number of a template.

Load Testing with Visual Studio Team Service

Then add our tested project to “Test Mix”.

Load Testing with Visual Studio Team Service

You can additionally configure “a mix” of necessary browsers. Press the “Finish” button. Run a reproduction of our first load test. In a few minutes, we will see a charter which will show dependence of time on a number of users, connected at the same time.

Load Testing with Visual Studio Team Service

Load Testing with Visual Studio Team Service

After the test has finished, you can upload a detailed report in Visual Studio system and see how the product behaves under certain load. For example, everything can be good or some errors can happen, such as:

Load Testing with Visual Studio Team Service

Now we have a possibility to analyze every recording separately. You can also upload all information to Excel and thoroughly analyze obtained information.

Conclusion

On the basis of above method and technologies, you can easily check to what extent can a developed software product resist possible maximum load. You can accurately evaluate the web environment performance and also find out how many additional examples to use for optimal functioning of a product. Load testing is a very important practice, particularly when you develop an application or a software product which will have a high level of user availability.

A main benefit of using test automation with Visual Studio is that all necessary work can be customized and optimized according to certain tasks with the lowest costs and least time. In just one hour you will get multi-functional constructor of possible load tests which are very easy to use and have many useful functions. Stress testing services are very important and they must be performed by experts in a completely “technically right” environment, to make a client get a product which will resist to all possible load.

About the Author

Dmitro Kosenko has about more than 4 years of experience in automation testing using different solutions and practices, especially Selenium Webdriver, Ranorex, NUnit, Eggplant, UIAutomator, etc. His primary expertise is implementing structured automation test suites using Selenium Webdriver, NUnit and C# for Testmatick.