Testers around the world will have been involved in many types of performance tests in their career. These are primarily done for two reasons – to make sure the system doesn't break suddenly, and secondly that the system works as expected under normal circumstances.
However, you also need to consider what kind of performance test is needed under which situation, and to know the difference between one type of test and another, for example, load test compared to stress test. This will help you to judge which type of testing suits the requirements of the job you are on at that time. Below, we will help you to focus your questions and provide you with some answers.
Performance testing is a non-functional testing type used for studying a system’s behavior under a normal workload. Various factors such as the speed (response time), reliability (chances of failures/errors), resource usage (CPU/Network), throughput (data transferred in bytes per second) etc., will be monitored during a performance test, based on expected normal user behavior. In other words you are finding out if the system behaves abnormally when a single user accesses the system over a particular period of time.
In order to know how your website performs, along with databases, networks, servers, and more, a periodic performance check needs to be done prior to releasing each new version. The test is carried out to make sure that the growing numbers of users don’t affect response time, there is a low error rate and, consistent hits per second when a certain number of users access the system. In this test, it is never the intention to load the servers with heavy user requests. You are only expecting normal load, so the test will be in a ‘controlled’ environment.
Load Testing is a variant of Performance Testing in which the system’s behavior is monitored when a heavy number of users access the system over a particular period of time. How do you decide the number of users? It mainly depends on the business values and requirements of the system. For example, a retail website such as Amazon might expect hundreds of thousands of users at any one time, but there will be numerous other retail sites that won’t be expecting such heavy loads.
The process of testing, and the matrices to be monitored, will be similar to Performance testing but here, these matrices will be monitored for different sets of user loads and different iterations. For example, 1000 users in 5 minutes, 2000 users in 5 minutes, 5000 users in 10 minutes etc. It would also depend on the business values of the system, but the ultimate goal is to discover the speed (response time) for different user loads. The most common open source load testing tools are Jmeter and Gatling.
Stress Testing is another variant of Performance Testing, in which the goal is to discover the breaking point where a system collapses. In other words, at which user load will my system will fall down. Stress Testing is vital for any system where it is difficult to predict the load on your servers. It can also be called endurance testing because it monitors parameters such as security, memory leaks, speed, data accuracy etc.
The stress testing process is performed with the help of load testing tools that can define a test case with a high number of simultaneous virtual users. If a stress test is designed to present the system with a sudden ramp-up in the number of virtual users, it will be known as a Spike Test. If the stress test goes on a long period of time for the purpose of checking the system’s sustainability with a slow ramp-up, the process will be called a Soak Test.
Stress tests for websites and apps are essential before any major event is run. One common example will be a festive season shopping campaign run by some online retailers, where they expect a huge number of customers to come and shop. Another example will be the timed opening of ticket sales for big events that will be eagerly anticipated by millions of fans. It is, however, recommended that you perform stress tests every now-and-then to know how much the system can endure. This will help you cope up with sudden traffic spikes, and give you more time and resources for fixing any bottlenecks.
With the help of these different types of performance tests, you will become aware of all the problems you can face. Knowing what they are will help you to plan and deal with them in advance.