Load Testing, KPI, and Why We Need Them
What is load testing?
Load testing is the process of putting demand on a system and measuring its response. The purpose of load testing is to identify performance bottlenecks and address them before the system is put into production.
Types of load Testing
Each test type is designed to give you different insights about your system.
- Smoke test — A smoke test determines if a system can handle the minimal load without any problem. The smoke test can be used as a Sanity test. The origin of the term: The phrase smoke test comes from electronic hardware testing. You plug in a new board and turn on the power. If you see smoke coming from the board, turn off the power. You don't have to do any more testing (Source: Wikipedia).
- Load test — A load test determines if a system can handle a specific load.
- Stress test — A stress test determines how a system responds to increased demand. This type of test is often used to find breaking points within a system.
- Spike test — A spike test determines how a system responds to sudden spikes in demand. This type of test is often used to find issues that may occur during peak usage periods.
- Soak test — A soak test determines how a system responds to sustained demand. This type of test is often used to find issues that may occur when a system is used for extended periods. This test can also be used to find memory leaks.
Why do we need load testing?
Confidence — Load testing gives you confidence that your system can handle the demand when it goes live. This is important because if your system cannot control the demand, it can lead to poor performance, downtime, and unhappy users.
Reliability — Load testing allows you to find and fix issues within your system before it goes live. This is important because it can help you avoid downtime and ensure that your system is reliable.
Capacity planning — Load testing can also be used for capacity planning. This is important because it allows you to determine how much demand your system can handle and how much capacity you need to add to your system to meet the needs of your users.
Identifying the bottlenecks — Load testing can also help you identify performance bottlenecks within your system. This is important because it allows you to address these bottlenecks before your system goes live.
Bottlenecks are performance issues caused by system components that cannot keep up with the system's demand. Here are some common bottlenecks.
- External Resources
Where to do the load test?
Load testing can run in different environments. The most important is to have a realistic environment. That could be your staging environment or a test environment that simulates your production environment.
It's highly recommended to avoid running the test in the production environment. The main reason is that you might impact your users' experience if something goes wrong. Additionally, you don't want to overload your production servers.
When do we start testing our software?
There is no absolute answer to that. It depends on the project, the company, and the team. In general, you want to start load testing as early as possible. This way, you can avoid potential issues or future defects and ensure that your system can handle the demand that will be placed on it.
Some people advocate for performance shift left, which means that performance testing is done early in the development process. Others advocate for performance shift right, meaning performance testing is done closer to the production date.
The best approach is to do both. This way, you can ensure that your system can handle the demand placed on it early in the development process. Additionally, you can ensure that your system can handle the demand placed on it closer to the production date.
What is KPI?
If you're not familiar with the term KPI, here is a quick summary
KPI stands for Key Performance Indicator. A KPI is a metric used to measure a system's performance. KPIs can measure various things, such as throughput, response time, and error rate.
How to choose the right KPI?
There is no one-size-fits-all answer to this question. The best approach is to sit down with your team and decide what is essential to measure. Once you have decided what is important to measure, you can choose a KPI that will help you measure that.
There are a few performance KPIs that you can track. These KPIs can help you determine if your system is performing well.
Performance KPI metrics
Here are some examples of performance metrics that you can track.
- Response time (ms)
- Throughput (KBytes/second)
- Error rate (%)
- Resources utilization (%)
- Transactions per second (TPS)
The load testing process can help you track software performance in every software lifecycle, identify performance bottlenecks, and address them before the system is put into production.