How to do load testing

Posted By :Nidhi Ojha |27th September 2019

Planning and execution of a load test:
Planning and execution of a load test need several activities to be performed, these activities are common to every load test irrespective of the tool we use. In this blog we will cover all of these activities in detail, giving the example of the applications that we normally use.

 

1. Create user scenarios-
Before creating user scenarios, one requires to understand the application completely. Different from functional test user scenarios, the load test scenarios cover only the scenarios that are most likely to happen at large concurrent load or the frequency of occurrence of which is high. Let's take an example of any mailing website, a functional user scenario will cover each and every aspect of that website like user registration, a user login - log out, a user reading unread mails, compose mail, delete mails, creating/saving as draft, settings configuration, archive mail, manage labels, restore from trash, prioritize mail and several others.

 

Whereas, load test scenario will include scenarios like reading unread mails, composing emails, deleting emails, user registration, and some others as per the client's request. The basic fact includes only the scenarios that will be performed by a relatively large group of people. So, in GMail scenarios like setting configurations, manage labels, restore from trash, etc will not be included unless otherwise explicitly specified by the client.

 

PS - Don't do a load tests on any live application unless you are allowed to or paid to, the application owner may block your IP address and can take even severe actions. Also, the example quoted here are just for reference purposes, to make you understand the concepts, they are nowhere related to how actually their load testing was/will be done.

 

Mock of a user scenario(Read unread mails)-

User launch the application
Wait Time/Think Time
User enter valid credentials and click on the Login button
Wait Time/Think Time
User click on the links of unread mails
Wait Time/Think Time
Click on Log out button
Wait Time/Think Time
Exit the application

 

The wait time or think time covered here is the time user takes in going through the web page once it loads, time taken to fill the forms like login form, user registration form, entering data in search fields etc. This time is variable depending on the underlying step like in step 2 wait time can be 1 or 2 seconds which is the average time a user takes in filling the credentials, comparably step 4 can have a wait time of 5-6 seconds- the time taken to read mail(s). The wait time in step 8 can be removed as the time taken to exit out the application after log out is negligible.

 

2. User Distribution-
Once the scenarios are recognized and stated, the next step is user distribution. In this step, user count will be assigned to the scenarios identified. Like user reading unread mail scenario we can have 50% of users, compose mail 30% users, deleting mail 15%, user registration 5%. All this means is our load test tool will make scripts simulating the user scenarios and throughout the load test, these scenarios will be executed as per the user distribution specified e.g. for 100 user load test the user reading unread mail scenario will be made to execute coincidently for 50 users, compose mail 30 users, deleting mail 15 users and user registration 5 users.

 

3. Scripting-
Scripting is finished with a load test tool like - Load Runner, JMeter, Silk Performer, etc. Basically, these tools replicate the actions performed by users. We script the scenarios identified and allocate users to them as per user distribution is done.
Scripting will be explained in detail using JMeter.

 

4. Dry run of the application-
Before factually starting the load test with the predefined number of users, we do a dry run of the application assigning 1 or 2 users to each scenario and check whether everything is working fine or not like the script is able to replicate user or not. A dry run is basically done to check the accuracy of the script.

 

5. Running a load test and analyzing the result for the test-
Once all the scripting is done and verified, it's time for a factual load test. The load test can be made to execute for predefined time or specified iterations e.g. we can run a load test for 30 minutes duration or for 50 iterations per user. Afterload test, the results are investigated, most of the tools have very good inbuilt controls for results display, one may need to use plugins or another tool to include even further detailed result interpretation. 

 

These were the activities performed during the planning and execution of the load test.


About Author

Nidhi Ojha

Nidhi is certified in Manual Testing and SQL. She has done B.tech in Electronics and Communication branch, apart from this she loves to travel to different places.

Request For Proposal

[contact-form-7 404 "Not Found"]

Ready to innovate ? Let's get in touch

Chat With Us