A perfect application performing effortlessly and offering optimized performance within the least time… Haven't you been dreaming about this? Well, you can make dreams come true, following the crucial steps of performance testing.
The performance testing lifecycle starts while a software product is still in development. Because of its diversified toolkit, we have an excellent opportunity to measure metrics under varied scenarios such as load over a long period, traffic increasing, etc.
Depending on the characteristics we need to test, performance testing is divided into the following subtypes: load-testing, stress-testing, volume-testing, etc. Let's dwell on the load-testing process.
The principle objective of software testing is to give confidence in the software
What is Load Testing: Goals and Benefits
Are there any performance bottlenecks in your app? Where is the most likely place to fall over first when a certain number of users would come in? Is your application able to perform well both at baseline usage levels and at peak levels? If you don't know that for sure, load testing is an imperative item on your to-do-list.
Load testing is aimed to make us sure that our system hits its performance goals. We can measure scalability, speed, reliability, or resource usage of the system since test responses under varying load conditions by simulating multiple users accessing concurrently.
Just the same way pieces of furniture from Ikea are repeatedly punched by machines to test how well they cope with repeated use, load-testing will involve sending a bazillion requests and see what the server says.
—Codeidoscope, author on Medium.com
Armed with load testing tools you can:
Catch performance bottlenecks
Minimize downtime and risk related to performance requirements
Improve app's scalability and deployment
Provide tangible statistics to developers\project managers
Finally, improve UX and increase customer satisfaction
Load testing directly helps to make performance much faster and smoother performance. It's clear that slow server response time leads to lost users because people prefer fast sites. For example, according to Google research 54% people feel frustration increasing as the load time for a brand's mobile site increases. So proper load tests improving server response time will save your valuable resources, such as money and time.
Test-design thinking can discover and eliminate bugs at every stage of the software creation, from conception to specification, to design, coding and the rest.
—B. Beizer, software engineer
Configuring a Load Test
Imagine that PM tells us that customer requirement is to develop a web service that must withstand with 50 concurrent users. Well, challenge accepted.
The customer is in a hurry to get information about the correct instance to withstand a proper load. PM is in a hurry to get this information from you. Well, so where to start?
First and foremost, let's check all project descriptions and requirements. After intent analyzing it's time to choose the right tool to measure the load functional behavior of our web app. We've chosen Apache JMeter, a "king" among load testing tools, that can be used to simulate loads of varied scenarios and output performance data.
- an open-source app designed for performing varied testing activities, in order to get accurate metrics. The following quick overview of the load test configuration will help us understand how it works.
Quick steps to create a load test using JMeter and confirm requirements
Define the basic business process scenarios fusers will make use of while working with the app
Describe test scripts using valid/tweak values and let's set up scenarios with the usage of Variables vs Properties. That gets us one step closer to real data while using app.
Launch the first test scripts to check their correctness and control server performance. Let's analyze the key indicators:
- whether requests are sent to the server (status/body)
- are requests processed properly by the server (response body)
Combine cases in the Test Plan and enable Capacity of the test. Next, asses the system capabilities due to the PM/Owner/Developer information. We will set:
Number of Threads - the total number of users connecting simultaneously. Our number of Threads = 20
Ramp-up (in seconds) - amount of time for starting the execution of all the threads. Our Ramp-up Period = 200
Duration (in seconds) - desired execution time for each Thread Group Our Duration=5 minutes (300 seconds)
Configure Load monitoring to present a performance reporting and beautiful real-time graphics for managers (we use open-source tools Graphana and InfluxDB)
Run Capacity Test in non-GUI (non-graphical) mode, i.e. from the console. It's time to determine the safety margin to find out a performance degradation and approximate stress number of users.
Run our tests in Load Mode for a couple of hours for analyzing the hardware behavior.
Сonsider what instance is the most preferable (by RAM / cores / SSD) taking into account the received values.
Choosing the proper instance parameters
Designing engaging report with actionable next steps personalized for key stakeholders PM\Customer
Withstanding the load app demo
...Everybody's happy :)
Our testing results were conveyed to the developers and DevOps team for debugging. During the examination of the potential bottlenecks we have identified:
out of memory allocated for the node.js
database performance problem
Fixing these issues we've achieved the application has successfully withstood the claimed number of users.
Happy Testing! And get up to speed on quality-driven development with Freshcode's blog.
Freshcode team keeps up the most relevant software testing tools . Contact us to be confidence in your software!