Difference Between Performance Testing, Load Testing, and Stress Testing – With Examples
Our previous tutorial in this series will be the best Performance Testing Guide for any beginner.
In the software testing field, we come across terms like performance testing, load testing, stress testing, etc. These terms are often misunderstood and interpreted as the same concepts.
However, there is a significant difference between these three testing types and it is important for a tester to understand the same.
In this tutorial, we will discuss each of these testing types to understand the exact differences between them.
What You Will Learn:
Difference Between Performance Testing, Load Testing, and Stress Testing
#1) Performance Testing
What is Performance Testing?
Performance testing is the testing that is performed to ascertain how the components of a system are performing under a certain given situation.
Resource usage, scalability, and reliability of the product are also validated under this testing. This testing is the subset of performance engineering, which is focused on addressing performance issues in the design and architecture of a software product.
The above image clearly explains to us that Performance Testing is the superset for both load & stress testing. Other types of testing included in performance testing are Spike testing, Volume testing, Endurance testing, and Scalability testing. Thus, Performance testing is basically a very wide term.
Performance Testing Goal:
The primary goal of performance testing includes establishing the benchmark behavior of the system. There are a number of industry-defined benchmarks that should be met during performance testing.
Performance testing does not aim to find defects in the application. It also does not pass or fail the test. Rather, it addresses the critical task of setting the benchmark and standard for an application. Performance testing should be done very accurately. Close monitoring of the application/system performance is the primary characteristic of performance testing.
The benchmark and standard of the application should be set in terms of attributes like speed, response time, throughput, resource usage, and stability. All these attributes are tested in a performance test.
For instance, you can test the application network performance through the ‘Connection Speed vs. Latency’ chart. Latency is the time difference between the data to reach from the source to the destination.
A 70kb page would not take more than 15 seconds to load for the worst connection of 28.8kbps modem (latency=1000 milliseconds), while the page of the same size would appear within 5 seconds for the average connection of 256kbps DSL (latency=100 milliseconds).
A 1.5mbps T1 connection (latency=50 milliseconds) would have the performance benchmark set as 1 second to achieve this target.
Another example would be that of a Request-response model. We can set a benchmark that the time difference between the generation of request and acknowledgment of response should be in the range of x ms (milliseconds) and y ms, where x and y are the standard digits.
A successful performance test should project most of the performance issues, which could be related to database, network, software, hardware, etc.
#2) Load Testing
Load testing is meant to test the system by constantly and steadily increasing the load on the system until it reaches the threshold limit. It is a subset of performance testing.
Load testing can be easily done by employing any of the suitable automation tools available in the market. WAPT and LoadRunner are two such famous tools that aid in load testing. Load testing is also famous by names like Volume testing and Endurance testing.
However, Volume testing mainly focuses on databases. Endurance testing tests the system by keeping it under a significant load for a sustained time period.
The sole purpose of load testing is to assign the system the largest job it can possibly handle to test the endurance of the system and monitor the results. An interesting fact here is that sometimes the system is fed with an empty task to determine the behavior of the system in the zero-load situation.
The attributes which are monitored in a load test include peak performance, server throughput, response time under various load levels (below the threshold of break), adequacy of H/W environment, how many user applications it can handle without affecting the performance.
Load Testing Goal:
The goals of load testing include:
- Exposing the defects in an application related to buffer overflow, memory leaks and mismanagement of memory. The issues that would eventually come out as a result of load testing may include load balancing problems, bandwidth issues, the capacity of the existing system, etc.
- To determine the upper limit of all the components of an application like a database, hardware, network, etc. so that the application can manage the anticipated load in the future.
- To set the SLAs for the application.
Let’s consider to check the email functionality of an application, that could be flooded with 1000 users at a time. Now, 1000 users can fire the email transactions (read, send, delete, forward, reply) in many different ways.
If we take one transaction per user per hour, then it would be 1000 transactions per hour. By simulating 10 transactions/users, we could load test the email server by occupying it with 10000 transactions/hour.
Another Example of a load test is shown in the image below:
The above image depicts a load test done in the tool called JMeter. This test is done to identify how many users a system can handle. In this test, 100 users are added after every 30 seconds until the load reaches 1000 users. Each step takes 30 seconds to complete and JMeter waits for 30 seconds before kicking off the next step.
Once the load reaches 1000 threads, all of them will continue running for 300 seconds (5 mins) together and then finally stops 10 thread every 3 seconds.
#3) Stress Testing
Under stress testing, various activities to overload the existing resources with excess jobs are carried out in an attempt to break the system down. Negative testing, which includes removal of the components from the system is also done as a part of stress testing.
Also known as fatigue testing, this testing should capture the stability of an application by testing it beyond its bandwidth capacity.
Thus, basically, stress testing evaluates the behavior of an application beyond peak load and normal conditions.
The purpose of stress testing is to ascertain the failure of the system and to monitor how the system recovers back gracefully. The challenge here is to set up a controlled environment before launching the test so that you can precisely capture the behavior of the system repeatedly under the most unpredictable scenarios.
The issues that would eventually come out as a result of stress testing may include synchronization issues, memory leaks, race conditions, etc. If the stress test is checking how the system behaves in the situation of a sudden ramp-up in the number of users, then it is called a spike test.
If the stress test is to check the system’s sustainability over a period of time through slow ramp-up in the number of users, it is called as a soak test.
Stress Testing Goal:
The goal of stress testing is to analyze post-crash reports to define the behavior of the application after failure.
The biggest challenge is to ensure that the system does not compromise the security of sensitive data after the failure. In a successful stress testing, the system will come back to normality along with all its components even after the most terrible breakdown.
As an example, a word processor like Writer1.1.0 by OpenOffice.org is utilized in the development of letters, presentations, spreadsheets, etc. The purpose of our stress testing is to load it with excess characters.
To do this, we will repeatedly paste a line of data, until it reaches its threshold limit of handling a large volume of text. As soon as the character size reaches 65,535 characters, it would simply refuse to accept more data.
The result of stress testing on Writer 1.1.0 produces the result that it does not crash under the stress and it handles the situation gracefully which makes sure that the application is working correctly even under rigorous stress conditions.
Another Example of a load test which depicts a spike test through sudden ramp-up of 7000 users is shown below:
Having had enough discussions about performance testing, stress testing, and load testing, let us now look into some related frequent questions for which testers seek for an answer.
Q #1) Is Load testing and Performance testing the same?
Answer: The answer to this is ‘No’. They are not the same.
By now you must have clearly understood the difference between performance testing and load testing. You can refer to the tabular summary below to see how performance and load testing have different objectives, scope attributes to study and issues to uncover.
Q #2) Is it an unfair test to perform Stress testing at the same time when you perform load testing?
Answer: This is also a common question in many software testing interviews and certification exams as is it unfair to do stress testing and load testing parallelly? The answer to this is ‘No’. It is not unfair to do stress testing at the same time when you are doing load testing.
No test is ever unfair. As a tester, your work is to find issues. However, the actualities of software testing may apply and any issue that you detect in this situation may not be fixed.
Q #3) Is Recovery testing a part of Performance testing?
Answer: Yes, recovery testing is categorized under performance testing and at times it is also conducted with load testing. In recovery testing, it is accessed as how well an application is able to recover from faults, crashes, hardware failures, and other similar issues.
In this activity, the software is forced to fail and then it is verified if it is able to recover properly. For Example, restarting the system suddenly when an application is running and then verifying the data integrity of the application.
Q #4) Does Performance testing require coding?
Answer: Performance testing does not require you to know the advanced level of coding. However, having a fundamental knowledge of programming is an added advantage.
For Example, if you are using JMeter, then it is good for you to know the fundamentals of Java. It can help you to debug certain things and you can also write your own script if required.
Q #5) What is Spike testing in Performance testing?
Answer: In spike testing, the load is abruptly increased or decreased by a huge number of users and later the system behavior is observed. Spike testing is mainly done to check if the system is able to handle sudden changes in the load.
Difference Between Load and Stress Testing
To summarize, let’s observe the major differences between load testing, stress testing as well as performance testing in the below table:
|Performance Testing||Load testing||Stress testing|
|Domain||Superset of load and stress testing||A subset of performance testing.||A subset of performance testing.|
|Scope||Very wide scope. Includes - Load Testing, Stress Testing, capacity testing, volume testing, endurance testing, spike testing, scalability testing and reliability testing, etc.||Narrower scope as compared to performance testing. Includes volume testing and endurance testing.||Narrower scope as compared to performance testing. Includes soak testing and spike testing.|
|Major goal||To set the benchmark and standards for the application.||To identify the upper limit of the system, set SLA of the app and see how the system handles heavy load volumes.||To identify how the system behaves under intense loads and how it recovers from failure. Basically, to prepare your app for the unexpected traffic spike.|
|Load Limit||Both – below and above the threshold of a break.||Till the threshold of break||Above the threshold of break|
|Attributes studied||Resource usage, reliability, scalability, resource usage, response time, throughput, speed, etc.||peak performance, server throughput, response time under various load levels (below the threshold of break), adequacy of H/W environment, the number of user app can handle, load balancing requirements, etc.||Stability beyond bandwidth capacity, response time (above the threshold of break), etc.|
|Issues identified through this testing type||All performance bugs including runtime bloat, the scope for optimization, issues related to speed, latency, throughput, etc. Basically – anything related to performance!||Load balancing problems, bandwidth issues, system capacity issues, poor response time, throughput issues, etc.||Security loopholes with overload, data corruption issues at overload situation, slowness, memory leaks, etc.|
Difference Between Load, Stress and Volume Testing
By now we already know about the load and stress testing along with the differences between the two. Let us now explore what is volume testing and how is it different from load testing and stress testing.
Volume testing is also a kind of performance testing that majorly focuses on the database.
In volume testing, it is checked as for how the system behaves against a certain volume of data. Thus, the databases are stuffed with their maximum capacity and their performance levels like response time and server throughput are monitored.
To keep it very simple, the difference between load, stress and volume testing is shown below:
|Volume testing||Load testing||Stress testing|
|A huge amount of data||A huge number of users||Too many users, too much data, towards system crash.|
In this tutorial, we have seen and understood through examples as to how performance testing, load testing & stress testing are different from each other and what is the scope of each testing type.
We also had a brief look at many categories under performance testing like spike testing, recovery testing, volume testing, etc. and understood how each of these is different from one another.
We hope this tutorial would have been of immense help for you to understand the practical difference between performance, load and stress testing.
Check our upcoming tutorial to know more about Functional Testing Vs Performance Testing.