You’ve worked hard developing your Web application. Maybe it’s nothing pioneering, but is one of the millions of unsung software heroes that make our lives function everyday.
Then again, maybe it will change the world.
Either way, you know you need to test it – and not just once. Testing should be performed at each step in the development cycle and should continue after the application is live. While it can be frustrating that a tester’s job is never done, it’s important to take consolation that with each testing and remediation cycle, the application improves.
Applications go down under load for two reasons: Either developers didn’t load test or, worse, they took the time to load test but didn’t prepare properly. Without adequate prep work, a load test can’t find all the issues that it should.
So, how do you best prepare for a load test?
1. What do you really need to know?
Determine what you want to learn about your application or system. Each type of test is run differently, and looks at your application in a different light. So, you’ll need to run different types of tests based on what you hope to find out.
- If you hope to discover how your application performs with little or no load in order to get a baseline, you will run a single user test.
- If you hope to determine how your system will perform under normal expected load, you will run a load test.
- If you hope to determine the breaking point, the point where your application either stops responding or responds so slowly
- that it is unusable, you need to run a stress test.
- If you want to know if your application has memory leaks, you will want to run an endurance or soak test.
2. Decide on a number of users
If you are going to load test, how many virtual users do you want to simulate? In order to answer this, you will want to approximate how many concurrent users may visit your site, and that depends on the time of day. Many testers just take a guess. Instead, talk to your architect, talk to your marketing people, and look at the performance specifications.
If you want to know some concrete statistics from a historical perspective, go directly to your own analytics reports. You may even want to ask your engineers how many concurrent users they designed the application for, and your product owner/marketing base their projected numbers based on promotional activities. Plan to test that number and some percentage above it.
Note: If you must run a post-production load test for some reason, be sure to schedule your tests for a time when actual users can be minimized or eliminated.
3. Study your analytics
Do not pretend to know how your customers use your application. The only way to truly understand your users is to study history (i.e. analytics).
By studying your analytics, you will be able to create tests that are actually representative of your actual users – as opposed to tests that you think are representative of your users. In this regard, analytics are a tester’s best friend!
4. Gather your team
You need to involve a number of people in the testing effort: Developer, Network Engineer, DBA, and Business Owner – to name a few. All of these individuals have a vested interest in making the application successful, and each will approach the problem from a different angle. The correct solution will not fall directly into one of these buckets, but will be a combination of two or more. Make sure each is available during testing to:
- Monitor their area of expertise.
- Provide balanced feedback.
- Gain a sense of ownership for the health and performance of the application.
5. Prepare your browsers
Use testing software that brings you as close to your actual users’ experience as possible. You should be able to record your scenario in the browsers of your choice, but you also need to anticipate the browsers your users will most likely use. Consider the countries and regions where you anticipate high usage, and research the most used browsers.
You’ll need to have these installed on your machine to begin testing. Then you need to make sure your load testing software emulates as closely as possible actual user behavior. This includes:
- Parallel thread processing.
- Think time
- Multiple Concurrent Scenarios
- Complex Scenarios
- Generating load from multiple agents (network/cloud)
6. Be prepared to test your production application
While it is valuable to test your application when it is in a staging environment, for a number of reasons this can leave some holes in your testing.
- Staging environments are not often exact duplicates of production.
- Staging environments are often accessible from only inside the firewall.
- There is something to be said for testing the same system that you are gathering information about.
7. Set aside time to analyze results
You should be prepared to spend some time analyzing test results as a group (remember all of those people that were present during testing?). Results need to be looked at carefully to ensure bottlenecks/errors/weaknesses are really understood and that the remediation is effective. Make sure to reach out to everyone and schedule adequate time.
To read more about creating scenerios, emulating real-life conditions, and analyzing your load testing data, download our eBook, Load Testing 101: Essential Tips for Developers and Testers.