Software testing can be divided into two main categories – Functional and Non-functional. Functional deals with the business logic and functional requirements of the application. On the other hand, non-functional validates the overall behavior of the application. Similarly, it also looks into how the system operates under varying conditions. Performance testing comes under non-functional testing.
What is Performance Testing?
IEEE definition of performance testing states it as,
“Testing conducted to evaluate compliance of a system or component with specified performance requirements.”
The mechanism used by performance testing is to check the response time of a request from a client to the server, and based on that make an analyzis on the performance of the software.
Factors which Impact Performance
There are multiple factors which impact the performance of any software.
Network: Network speeds, firewall inefficiency, making queries to non-existent DNS server are examples of network-related performance issues.
Code Quality: Inefficient algorithms, memory leaks, deadlocks, incorrect code optimization are some of the code quality issues. Along with that, in data-centric applications, the choice of database and incorrect schema design can impact performance issues.
Traffic Spike/ Load Distribution: Sudden traffic spikes can bring down applications if care is not taken to handle the surge in data. Similarly, incorrect implementation of load distributions when such traffic spikes occur can also give similar results.
Objective of Performance Testing
Objective of performance testing is to simulate such behaviors ahead of a production release, and find such issues and spend time in resolving them. Thus, early detection of performance issues can, in fact, save companies of any unwanted crash of website, customer retention and consequently any revenue loss.
Types of Performance Testing
Performance testing can be of the following main types:
1. Load Testing
It assists in checking the expected load that can be handled by the system. Thus, the load is added in the form of concurrent users, which is gradually increased till software’s capacity, based on the product requirement.
Objective: To test system behavior during its peak capacity and monitor that its performance does not degrade with its maximum anticipated users.
2. Stress Testing
It helps to test the breaking point of the software. This is done by increasing the load in the form of concurrent users, well above and beyond its anticipated load and hardware capacity.
Objective: To test the recovery mechanism of the system in case of a failure due to heavy user load or traffic.
3. Spike Testing
Spike testing in many ways is like stress testing. It is done to mimic sudden traffic increase to software applications or websites due to a promotional offer, special occasion or other such events which can cause sudden high traffic to a website.
Objective: To test the software’s capacity to handle a sudden spike in traffic without breaking down or performance degradation.
4. Soak Testing
It is a subcategory of load testing. It is done by simulating a load in the system, for an extended stipulated period of time (for example an hour) and then observing the behavior of the system for performance degradation.
Objective: To uncover software deterioration that may happen due to prolonged use of the software. Moreover, it can find problems like memory leaks, errors in closing database cursors, connections between the multitier system and so on.
5. Volume Testing
Just as the name suggests, volume testing is to test for large volumes of data. Moreover, volume testing is mainly used for testing and monitoring database performance to read/write of data in applications which are data-heavy.
Objective: To identify the capacity of the system with an increasing volume of data in the database. It also helps to know that point where the stability of the system is lost due to large inflow of data.
How to plan performance testing?
These are seven common steps for creating a performance test plan. They work as a guideline for not missing out on essential details, which may be crucial for the test strategy.
This is the first and most critical step. Understanding the hardware-software requirement of the product along with the infrastructural needs. The test environment should mimic the production environment for a successful test run.
Metrics that will be used for testing the software have to be identified early along with their acceptance values while the system is on load. Moreover, stakeholders will mostly drive the acceptance criterion based on what comes as an acceptable performance. Metrics measured can be response time, throughput, time to first byte and so on. Identification of the metrics can help design the performance tests.
It is important to understand the usage pattern of the application to test. So, identifying and designing performance testing scenarios which take into consideration the user variability, test data and target metrics really matter in this.
Prepare the Test Environment:
Setting up the test environment is an equally crucial part of the performance test plan. So, the environment has to be set up in such a way that it allows monitoring and then mimics the production environment as closely as possible.
Record the Test Plan:
Using a performance tool to record a test plan based on the test cases created from test design is crucial. The recorded plan should be reusable.
Tests should be initially executed with small data load in order to validate the accuracy of the results, and subsequently, with the data load that is specified in the plan. Also, at this point it is paramount to watch for warnings and errors, and what may be causing them, to gather results for the metric.
Analyze the Results:
This is the final but crucial step. It is necessary to analyze the results properly to narrow down the part of the application, endpoint, or resource, which may be causing the degradation. The full benefit of the performance test will be attained only with proper result analyzis.
This gives a brief overview of what is performance testing, its impact and types of performance testing. This will be a series on the topic of performance testing. In future, a tool will be taken up, where we will walk through the steps of using it and improve our understanding of performance testing. Meanwhile, you can read about BaaS here.