There are many types of performance testing techniques, one of them is stress testing. It refers to the testing of the software in determining whether its performance is satisfactory under extreme load conditions or not.
Most systems are developed for normal operating conditions, therefore if operating conditions become abnormal (for example: if load of simultaneous users visiting the website goes beyond the maximum limit) but your system has undergone stress testing then errors would be negligible even under abnormal conditions.
Even though stress testing is important, most projects do not perform stress testing until the end of their software development life cycle (SDLC), which can have serious consequences, if there are performance issues in the application.
Table Of Contents
- What is Stress Testing?
- Purpose / Importance of Stress Testing
- Stress Testing Example
- Types of Stress Testing Techniques
- Methodology – How To Do Stress Testing
- Stress testing tools
- Stress Testing Memory Leaks
- Stress Testing Metrics
- Difference Between – Stress Testing Vs Load Testing
- Stress Testing Interview Questions
What is Stress Testing?
- It is a type of non-functional testing
- It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results
- It is a form of software testing that is used to determine the stability of a given system
- It put greater emphasis on robustness, availability and error handling under a heavy load, rather than on what would be considered correct behavior under normal circumstances
- The goals of such tests may be to ensure the software does not crash in conditions of insufficient computational resources (such as memory, disk space, network request etc)
- Stress testing is also called fatigue testing
Spike testing is also a type of stress testing which is performed when the application is loaded with heavy loads (within maximum limit allowed) repeatedly and sometimes the load on the application is increased beyond the maximum limit allowed for short duration.
Purpose / Importance of Stress Testing
Stress testing tries to break the system under test by overwhelming its resources.
The main purpose of stress testing: Make sure that the system fails and recovers easily, this quality is also known as recoverability.
Stress testing can also be used to uncover data corruption issues, hardware issues.
Stress Testing Example
Let us assume that the performance testing team has been asked to stress test an ecommerce application that sells Camping Gears.
- In order to perform stress testing of the ecommerce application, an extremely large number of visitors hitting the application is simulated using a stress testing tool (listed later in this article).
- The number of visitors being simulated would be exponentially higher compared to the average number of visitors expected to visit the website on a day to day basis.
- These virtual users are programmed to execute common activities like viewing products, adding, removing items from cart and purchasing the product etc.
- The number of users are increased suddenly to the point of failure, until the website crashes and is not longer able to handle additional traffic.
- Additional points that are noted are – How the website behaves at this time and if it recovers gracefully
- The results of the tests are used to identify bottlenecks, performance improvement areas, recovery / failover mechanisms etc.
Below screenshot shows Target.com website when it was down during CyberMonday.
During holidays / promotions, an ecommerce website might witness sudden increase in the number of visitors.
Stress testing of the website is very important in order to handle such sudden increase in number of visitors. Failure to handle such sudden increase could lead to the loss in revenue and reputation.
For stress testing to be successful, system should display an error message while it is under extreme stress conditions and should be able to recover once the load becomes normal.
Types of Stress Testing Techniques
1. Distributed Stress Testing
In distributed stress testing, all the clients linked with the server are tested. Distribution of a group of stress tests to each one of the clients and follow up on their status, is the server’s role and responsibility.
From the above diagram, server is able to communicate with client 1 and 2 but it is unable to communicate with client 3 and 4, when there is stress on the client-server system.
2. Transactional Stress Testing
As the name suggests, Transactional Stress Testing is used to perform stress testing taking place on the transactions that occur between the applications. The purpose of the transactional stress testing is to fine tune and optimize the system.
3. Application Stress Testing
Stress testing of applications typically used in order to uncover defects linked to bottlenecks in performance, network issues, data blockages and locks .
4. Exploratory Stress Testing
In Exploratory Stress Testing, the system is tested under abnormal conditions which will not likely to come up in real time scenario. Few examples of Exploratory Stress Testing where such abnormal conditions are used:
- Extremely large numbers of concurrent users try to log into the application
- Database linked to the website shuts down when the website tries to reach it from the front end
- Data in added in extremely large quantity in the database
5. Systematic Stress Testing
Systematic stress testing is used to test many systems that run on a server. It enables the testing team to detect defects where data of one software blocks another software.
Methodology – How To Do Stress Testing
Steps used to conduct stress testing are more or less similar to the steps used to conduct performance testing because stress testing is a type of performance testing.
Below mentioned are seven steps used to conduct any type of performance testing whether it is load testing, volume testing or stress testing.
1. Identify the testing environment
Pinpoint the hardware, software, network configurations and tools available to perform the stress test.
2. Identify performance acceptance criteria
Classify the metrics used to analyze the performance of the application under stress. Also pinpoint the success criteria for stress test (maximum load put on the application for it to fail and so on).
3. Plan and design stress tests
This step includes creating a stress test plan, identifying test scenarios etc.
4. Configure the test environment
Prepare the test environment, tools and resources necessary to execute each strategy as features and components become available for test.
5. Implement test design
Develop the stress tests in accordance with the test design best practices
6. Execute tests
Run and monitor the tests. Validate the tests, test data and results collection.
7. Analyze the results
Consolidate and share the results data. When all the metric values are within acceptable limits, none of the set thresholds have been violated, and all the desired information has been collected, you have finished testing that particular scenario on the particular configuration.
Stress testing tools
Normally all the performance testing tools that are used for load testing could also be used for stress testing. Below mentioned are the ones that are most commonly used:
1. Loadrunner
Loadrunner from HP is the widely used tool to perform stress testing and the results provided by Loadrunner are considered as a benchmark.
2. Jmeter
It is an open source tool that is available free of charge. It is a Java application and is intended to conduct all performance testing types including stress testing.
3. NeoLoad
This tool is used to perform stress testing on web as well as mobile applications. It has numerous advantages like it supports all major servers available in the market, could be used to conduct stress testing on ERP, CRM, and Business Intelligence type applications etc.
Stress Testing Memory Leaks
Memory leak is a type of resource leak that happens when a software incorrectly manages memory allocation in such a way that the memory which is no longer required is not released. Memory leak can also happen when an object is stored in memory but cannot be accessed by the running code.
A dynamic analysis tool that can track memory leaks generally monitors both the allocation and deallocation of memory.
When a dynamic allocated block of memory goes out of scope without getting released, the tool notes the location of the leak.
Most tools then write that information to a log, some might stop the execution of the code immediately and go to the line of code where the allocation occurred.
Example – How to perform stress testing of memory leaks
Stress Testing of Memory Leaks is performed by triggering large volume of activity that results in creation, storage and removal of data in memory and loading the system to the point of failure to see if the system recovers gracefully.
In case of an ecommerce application, a stress testing tool or script can be used to simulate a extraordinary number of users adding a very large number of items to their cart, adding and removing items from their cart and trying to checkout. This is one of the tests that will help identify if there are memory leaks in the shopping cart module or the checkout process.
Stress Testing Metrics
Metrics are basically key performance indicators. Most commonly used metrics are mentioned below:
1. Average transaction response time
It is the Average time taken to perform transactions during each second of the scenario run.
2. Total transactions per second
The total number of transactions that passed, the total number of transactions that failed and the total number of transactions that stopped during the scenario run.
3. Transactions per second
For each transaction, the number of times it passed, failed or stopped during each second of the scenario run.
4. Transaction response time (under load)
Transaction times relative to the number of vusers at any given point during the scenario run.
5. Errors per second
Average number of errors that occur during each second of the scenario run.
6. Hits per second
Number of HTTP requests made by Vusers to the web server during each second of the scenario run.
There are lot of other metrics for stress testing of database, streaming media, ERP/CRM server and so on.
Difference Between – Stress Testing Vs Load Testing
Load Testing | Stress Testing |
Load testing is used to find the limit of the load which the application / system can withstand, the performance levels at the limits | Stress testing is used to find out if / how the application recovers after it fails. It’s also used to study how the application responds under unusually heavy loads |
The system is tested by loading it to its peak capacity and recording its response | The system is loaded beyond its peak capacity to the point of failure and its behaviour is recorded |
Checks for parameters and metrics like response time at peak load, transactions per second, throughput etc | Apart from metrics like throughput, transactions per second etc, other metrics like Errors per second, number of failed transactions, users with errors, server recovery time etc are recorded |
Load on the application is increase slowly over a period of time | Load on the application is increase suddenly |
Stress Testing Interview Questions
- What is Stress Testing?
- Why should we do stress testing?
- What is the difference between stress testing and load testing?
- How is stress testing done, what are the steps involved?
- How would you perform stress testing of an ecommerce application?
- What are the different types of stress testing techniques?
- What are memory leaks?
- How are memory leaks related to stress testing?
- How can you perform stress testing for memory leaks?
- What is the benefit of stress testing?
- What tools can be used for stress testing?
- What is exploratory stress testing?
Other popular articles:
- What is Performance testing, Load testing and stress-testing tools in software testing?
- What is Load testing in software testing? Examples,How To Do,Importance, Differences
- What is Non-functional testing (Testing of software product characteristics)?
- What is Endurance testing in software testing?
- Difference between Volume, Load and stress testing in software
Shuja Uddin says
Thank you for your on-going co-operation with me.
Shuja Uddin says
I am student of Master of Science in Business Administration with subject Credit and Risk Management. So I need to know the practical meaning of various words used during study of the subjects.
diego says
thank you for the information, is very useful