# Load Testing
Load testing is a type of performance test for a system or software product under real-life load conditions.
Here, we determine the system's behavior when multiple users use the application simultaneously. It is the system's response measured under varying load conditions.
# Objectives of Load Testing
- Maximize the application's operational capacity;
- Determine if the latest infrastructure can handle the application or not;
- Determine the application's sustainability under extreme user loads;
- Discover the total number of users that can access the application simultaneously;
- Determine the application's scalability;
- Allow more users to access the application.
- Test Environment Setup: First, create a dedicated environment to conduct the load test; this ensures it is done appropriately.
- Load Test Scenario: Here, scenarios are created, and then, load test transactions are determined for the application, and data is prepared for each transaction.
- Execution of Test Scenarios: Different measurements and metrics are collected to gather information.
- Results Analysis;
- Re-Tests: If a test fails, it is conducted again to obtain the correct result.
# Load Testing Metrics
Metrics are used to understand the performance of load tests under different circumstances. This tells us how accurate the test is in each different scenario.
There are many metrics, such as:
- Average Response Time: Measures the time it takes for a response from a request generated by the client or user. It also shows the application's speed depending on how long the response takes for all requests made.
- Error Rate: Mentioned in terms of percentage and denotes the number of errors occurring during requests to the total requests. These errors usually occur when the application can no longer support the requests in the given time or due to other technical issues. This makes the application less efficient as the error rate rises.
- Throughput: Used to measure the amount of bandwidth consumed during load scripts or tests. It is also used to determine the amount of data used to check the requests flowing between the user's server and the main application server. It is measured in kilobytes per second.
- Requests per Second: Tells us how many requests are generated to the application server per second. Requests can be anything from requests for images, documents, web pages, articles, or anything else.
- Concurrent Users: This metric is used to determine how many users are actively present at a specific or any given time. It merely keeps track of the count of those who visit the application at any time, without raising any requests within the application. From this, we can easily identify peak times.
- Peak Response Time: Measures the time taken to handle the request. It also helps find the duration of the peak period (the longest time) in which the request/response cycle is taking more time.
# Load Testing Tools
Some of the load testing tools are:
- Apache JMeter
- WebLoad
- NeoLoad
- LoadNinja
- HP Performance Tester
- LoadUI Pro
- LoadView
# Advantages of Load Testing
- Improves the system's sustainability;
- Enhances the system's scalability;
- Helps minimize risks related to system downtime;
- Reduces system failure costs;
- Increases user satisfaction.
# Disadvantages of Load Testing
- Requires programming knowledge to conduct a Load Test;
- Testing tools can be expensive.