Testing Guides

What is Stress Testing?

Published on
October 19, 2022
Sneha Christall
Product Marketing Manager

This guide provides an overview of stress testing, how it is performed, stress testing types, metrics, advantages, and disadvantages as well as best practices.

Stress Testing- An Overview

As we have discussed in the Types of Software Testing guide, stress testing, or endurance testing, is a type of performance testing that is used to ensure that an application is robust, secure, and capable of handling extreme workloads while providing effective error handling in the case of system failure. It is also a means to check if the system is capable of saving data during a crash. 

Here, the application is made to endure extreme conditions for a regulated period of time until it causes a crash. In this manner, the application’s limit of withstanding ‘stress’ can be evaluated while also ensuring that the system is capable of recovering from failure. For example, consider the spike in activity on an e-commerce website during its Black Friday sale. Stress testing helps ensure that the website is capable of handling such a spike, protecting the business from potential loss of revenue and customer loyalty. 

How is Stress Testing Different from Load Testing?

While stress testing involves testing the application under extreme conditions until it fails, load testing tests its behavior under normal conditions or expected workload. 

Why Stress Testing?

Stress testing is of crucial importance in several scenarios, which are listed below:

  1. To ensure that the application works smoothly under abnormal conditions such as traffic spikes. 
  2. To avoid loss to business in case the system crashes in extreme conditions. 
  3. To analyze the behavior of the system after a failure and verify if an appropriate error message is displayed in such situations. 
  4. To be prepared with contingency plans in the case of system failures. 
  5. To ensure that the system recovers after failure. 
  6. To verify if the system saves data before it crashes.
  7. To verify that system failures do not cause security breaches. 
  8. To detect hardware and/or data corruption issues. 

How to Perform Stress Testing?

The stress testing process takes the following 5 steps:

  1. Planning the Test: This step involves gathering system data and building stress test goals. 
  2. Creating Automation Scripts: This step involves the creation of stress test automation scripts and the generation of test data. 
  3. Executing the Script: Here, the stress automation test scripts are run and their results are stored for further analysis. 
  4. Analyzing Results: Here, the stress test results are analyzed to identify possible concerns. 
  5. Optimizing for Efficiency: This step involves further fine-tuning to ensure the system works as intended. 

Types of Stress Testing

The following are the main types of stress testing:

  1. Server-Client Stress Testing: Server-client stress testing is performed across all clients from the server. It is also known as distributed stress testing. 
  2. Product Stress Testing: In product stress testing or application stress testing, testers try to identify possible defects such as data and network connectivity issues. 
  3. Transactional Stress Testing: Here, stress testing is performed on transactions between two or more applications. 
  4. Systematic Stress Testing: Systematic stress testing is used to carry out tests across multiple systems on the same server in order to detect issues when one application blocks another. 
  5. Analytical Stress Testing: In analytical or exploratory stress testing, the system is tested under abnormal conditions, which are not expected to happen in reality. 

Stress Testing Metrics

Here are a few metrics by which stress testing is measured:

  1. Transactions Per Second: The number of successful (and failed) transactions per second. 
  2. Transaction Response Time: The average time taken to load or perform transactions.
  3.  Connection Failure: The number of times a connection failure occurs in the system. 
  4. System Attempt Failure: The number of failed attempts by the system. 
  5. Rounds: The number of test or script conditions executed successfully and the number of failed rounds. 
  6. Pages Per Second: The number of pages requested and loaded per second.
  7. Pages Retrieved: The average time taken to retrieve all information from a page.
  8. Byte Retrieved: The average time taken to retrieve the first byte of information from a page.

Advantages of Stress Testing

  1. Ensures System Recoverability: With stress testing, system behavior after failure can be determined, and testers can ensure that it recovers quickly post failure. 
  2. Troubleshoots Security Concerns: Stress testing helps ensure that system failures do not cause security breaches or concerns. 
  3. Makes the System Adaptable in any Situation: By stress testing the system under normal and abnormal conditions, testers can ensure that the system is capable of functioning under any situation. 
  4. Improves System Scalability: Stress testing helps develop system scalability and performance. 
  5. Identifies Bottlenecks: System bottlenecks can be easily detected and testers can check if the system stores all data before crashing. 
  6. Prevents Loss to Business: Stress testing helps to identify if the system will crash under situations such as traffic spikes, helping prevent loss to business in such scenarios. 
  7. Identifies Memory Leaks and Resource Loss: Stress testing is best suited to identify issues such as memory leaks and loss of resources, which cannot be as easily detected by other modes of software testing.

Disadvantages of Stress Testing

  1. Manual stress testing is a complex and time-consuming process. 
  2. Testers are required to have good command over scripting in order to implement script test cases. 
  3. There is a need to set up a load testing environment that is as close to the production environment as possible. 
  4. Stress testing requires additional resources that will cost both time and money. 
  5. If the test scripts are implemented incorrectly, it can cause further chances of failure and loss of time and resources. 

Stress Testing Best Practices

  1. Set clear objectives for your stress tests at the outset. 
  2. Work to identify both common and uncommon user workflows that can affect system performance. 
  3. Leverage real data insights and scenarios to understand how your system will perform in real-world scenarios. 
  4. Perform stress tests catering to different user types.
  5. Monitor the system closely, track key performance indicators, and be prepared for any system inefficiencies or failures. 
  6. Constantly assess results and optimize system performance based on this data. This process should operate as seamlessly as possible, with the proper flow of information between testing, development, and business teams. 

Subscribe to our Newsletter