Load Test
A load test is simulating a high volume of concurrent users against a software application. In terms of web applications, a load test hits the site with http traffic in a realistic fashion that mimics activities by users such as exploring a product catalog, logging in, and posting comments to blogs.
The 4 KEY COMPONENTS of Load Testing
- Understanding the environment of the application being tested
- A test plan defining user scenarios
- Tools to generate load and capture metrics
- Analysis of performance indicators
Additional explanation and detail is offered below for each of these four key components of load testing.
Understanding the Environment of the Application Being Load Tested
- Figure out the architecture of physical layers and logical layers
- Study any system documentation that shows the big picture, not the coding
- Ask plenty of questions of project stakeholders to see how the system will be used
- Determine expectations of IT leaders, executives, and especially the head of marketing
Some people call this the "context" of the load test. A good way to understand the context or specific situation around your load test is to play detective. Review a list of load testing questions and analyze them for which ones will be appropriate for your project. Don't be afraid to ask. Above all - listen carefully to the answers!
A Load Test Plan Defining User Scenarios
Your test plan should contain:
- User types - administrators, buyers, window shoppers, bloggers, commenters, etc.
- User success criteria - if they wait over 5 seconds will they leave?
- Business success metrics - examples are: concurrently process 5,000 anonymous users shopping, 500 processing their credit card, 200 posting comments about the products, and 50 clerks updating the product catalog
- System success criteria - examples are: 98% of all responses time to last byte under 3 seconds, memory utilization under 60%, CPU utilization averages under 35% and never reaches 85%, etc.
- Test scenarios - for each user type, describe a series of actions that they can take
- Volumes - for instance: ramp up traffic from 100 to 5,000 concurrent users over 60 minutes, simulating 80% of visitors as anonymous, 10% shopping cart experience, 10% authenticated users performing CMS transactions
Tools to Generate Load and Capture Metrics
There are dozens of load testing tools, and a few of these will fit your needs. A thorough list is available at performance testing resource and linking site. Some tools have been around for 20 years, have the most features, are the most expensive, have long learning curves, and tend to be for companies that have a large budget with a dedicated testing team. Open source tools are plentiful and are free to download, but require you to provide the hardware and usually require significant tech skills to configure. New cloud tools abstract the hardware from you, allowing you to focus on the other aspects of running the tool, and their cost is based on usage rather than license fee. Choosing the best for you will ultimately come down to a balance between ease/features, and the price your project can afford.
Representatives of each category:
- LoadRunner - very expensive, takes months to learn, extensive scripting capability using C language
- JMeter - Desktop tool, free, moderate learning curve, extensible by Java coders
- LoadStorm - load testing in the EC2 cloud, inexpensive, short learning curve, limited scripting capability
Analysis of Performance Indicators
The purpose of load testing is to apply large volumes of virtual users to the web application or site to determine how it responds to the heavy traffic. Many confuse load testing with analyzing page performance. It is a good idea to examine the pages of your site or app to see how long it takes for each resource (html, images, stylesheets, Javascript, XML) to load. There are aspects of rendering that you should consider as part of the user experience. However, big difference is that you analyze page performance with one user at a time, and in load testing you have hundreds or thousands of users all hitting the site at the same time. Let's start with load testing metrics:
- Response times - milliseconds it takes to receive a response to a certain request made,
- Time to first byte (TTFB) - the timer starts when sending request completes, and the timer stops immediately when a response header is first registered
- Time to last byte (TTLB) - the timer starts when sending request completes, and the timer stops when everything in the response payload is received
- Requests per second - the average number of requests being received by the application's front end, regardless if they get a response
- Throughput - the amount of data flowing in/out of web site measured in kilobytes per second
- Error rate - which errors (if any) are occurring as the traffic increases, measured as a percentage of total requests

