What is load testing – A Primer

What is load testing? Load testing measures the response of a system under an increased user volume in order to verify it can handle an expected traffic of users. To test your system’s behavior and functionality you use various measurements and parameters such as response time, throughput, servers’ health and stability.

But what does an “increased user load” mean? This will vary significantly depending on the application and context. Google may expect millions of users searching for data in parallel and may require that its system return results in less than 0.5 seconds. A small local bank, on the other hand, may only be required to serve 1000 users in parallel with a 3-seconds login. And an eCommerce site may have another set of requirements for handling the checkout process of thousands of users.

Put differently, load testing goals (which are often not given enough thought), will depend on the context and specific business.

Is load testing the same as performance testing?

There is often a confusion between the two terms. Performance testing has a wider context and may include other variances, beyond load. For instance, you may run a performance test of a single user from your desktop, or a performance test that runs as a service from the cloud.

Load testing is a specific branch of performance testing, which simulates a large volume of activities to check a system’s behaviour.

Types of load testing

There are a few different types of load tests, aimed at testing different aspects or conditions:

‘Classic’ load Testing typically tests the system to verify that it can provide certain response times for a certain volume of users.

Stress Testing – Tests how the system behaves in extreme conditions after it reached its defined requirement as defined by the load testing. Extreme conditions may include machines with less memory than expected, more users than expected, different CPU, or other configurations.

Capacity testing – Capacity is a specific type of stress testing, which helps identify the maximum number of users the system can serve.

Soak testing – Tests how the system behaves when running for a long duration (for example, several days) after it reached its defined requirements as defined by the load testing.

The process of running load testing

While complete books are devoted to the process and methodology of load testing, here are the very basic steps in the process.

1 – Defining goals

This is the first, important, and often forgotten step of the load testing. Unlike functional or regression testing where pass/fail results are definite, in load testing the results are much less clear cut, and are open to interpretation as to whether they are good or bad.

Load testing goals may include a wide range of metrics such as the expected response time, the number of users each activity will support, what should happen in peak time, the number of many mobile users supported, etc.

2 – Setting a load test environment

An important part of running load tests is building a solid test environment that accurately replicates the real production environment. This includes issues such as machine profiles and configuration, the network architecture, load balancers, firewalls, databases, etc. For more info on this you can read our tips for building a load test environment.

3 – Creating load scenarios

Building load scenarios is done by either recording user activity, scripting, or in most cases a combination of both. Load test scenarios will include validation points, transactions and measurements.

4 – Running tests

Once you’ve setup test scenarios, you execute them using different conditions to simulate real-life conditions, based on your goals. For example, run scenarios using different number of users, from different location or using different browsers.

 5 -Analyzing results

Results analysis involved the interpretation of data collected during test runs. This includes data related to transactions, errors, hits, responses times of transactions, pages, components, and servers performance measurements.

The heaps of data collected are typically what make results analysis challenging. The process of analysis is typically iterative, where you modify different test settings and re-run scenarios in order to narrow down problems and identify the root-cause of issues. A methodological and well-documented process that is planned and based on pre-defined goals can save lots of time.

When is load testing done?

Typically load testing is done at the end of building a release, just before pushing the software live to production. In recent years, as part of agile development processes, some companies are launching their load testing much earlier. This enables identifying and fixing problems early on lowering the costs of corrections and avoiding last-minute delays.

Summary

Load testing is a combination of science and art. It requires skilled performance engineers to have a good system and networking understanding, knowledge in the tested application, a good knowledge of servers – but also the abilities to uncover hidden issues, isolate problems, and work in a methodical, organized fashion.