Load Testing 101 PDF
Load Testing 101 PDF
development project nears applications become modern and complex, load test-
ing becomes challenging. Though it has been around
completion, it likely will have gone
for years, we still see well known mobile and web ap-
through numerous tests, particularly plications getting overwhelmed with peak traffic.
in an Agile environment where
testing and development happen The other parallel change is about the place of testing
concurrently. But no matter how many tests in software development. With shift-left and DevOps
youve run, once your application is nearly motion, software teams are encouraged to test more
complete, theres really only one way to know and test often. As a result, software testing is becom-
whether or not your software can handle the ing a specialized career on par with developers them-
actual demands your army of end users will selves. Testing teams and individual testers are now
soon be placing on it load testing. critical players that need to be valued and better un-
derstood by anyone involved in software.
Load testing is the process of putting simulated demand
on software, an application, or website in a way that We can trace this move to three main trends:
demonstrates its behavior under various conditions. the rising popularity of Agile/DevOps approaches
LITERATE
A
pplication breaking point
LOAD TESTING 101: ESSENTIAL TIPS FOR TESTERS AND DEVELOPERS 8
different types of tests based on what you hope to
Preparing your load tests find out.
Dont guess. Instead, talk to your architect or marketing 3. Study your analytics
people, and look at the performance specifications. If you Dont pretend to know how your customers use your ap-
want to know some concrete statistics from a historical per- plication. The only way to truly understand your users is
spective, go directly to your analytics reports. You may even to study history (i..e. analytics). By studying your analytics,
want to ask your engineers how many concurrent users they you will be able to create tests that are representative of
designed the application for, and your product owner for pro- your actual users, as opposed to tests that you think are
jected numbers, based on promotional activities. Plan to test representative of your users. In this regard, analytics are
that number and some percentage above it. a testers best friend.
There are numerous ways you can find the number of virtual 4. Performance is a team goal gather your team
users needed to run a load test. We recommend the follow- You need to involve a number of people in the testing
ing formula to find the number of virtual users needed to run effort, including: developer, network engineer, DBA, and
a load test. business owner. All of these individuals have a vested
interest in making the application successful, and each
Concurrent users = (peak hourly visits * visit duration in
will approach the problem from a different angle.
seconds) / 3600
You can find peak hourly visits and visit duration from an The correct solution will not fall directly into one of these
analytics tool, such as Google Analytics. Note that this for- buckets, but will be a combination of two or more. Make
Percentage Role
How to record scenarios
The first thing to do is to determine the roles you will define 95% Browse and Leave
for use in your test. A role is equivalent to a certain type of 5% Browse, add something to the cart and checkout
user that will visit the tested website, and the steps they will
take while visiting.
The combination of these two roles, or scenarios, will
If the tested site is a retail site, for example, you might have represent actual site traffic.
the following roles:
After each scenario is recorded, you need to verify it in-
Browse and leave
dividually. This involves running a single virtual user for a
B
rowse, add something to the cart, and check out single pass through the scenario. This step should never
be forgotten.
If your tested site is a restaurant site, your roles might look
something like this:
Now youre ready to start testing. By recording scenari-
Browse menu and find directions os that imitate actual user traffic, youre setting the stage
to greatly improve customer experience and, if youre
Look at hours of operation and make a reservation
into e-commerce, get that percentage of purchases
above 5%.
Its best to choose at least three of the most common path-
ways through your site, and add a few uncommon routes
as well. Next, you need to break these roles down by per-
centage of traffic. A typical retail site may have 95% of users
load tests load profile whereby you start with a small number of
virtual users, and increase that number over time. For
example: you start with a single virtual user and add one
Whether its an elementary school math quiz, a college
virtual user every two seconds until you reach a certain
history exam, or a software development teams load
number of simultaneous users, and then hold that num-
test, we always want our tests to emulate real-life condi-
ber for the duration of the test.
tions. Otherwise, whats the point of testing?
Heres a list of the most important results in load testing Request and response throughput
and how you should be working with them. Its important to see the amount of data going to and
coming from the tested system. This is especially im-
Page load time portant in a case where load is increasing, but band-
You need to know the average page load time for each page width reaches and maintains a plateau. In this case, it
in your scenario. You might have a strict Service Level Agree- becomes apparent that bandwidth is being throttled at
ment (SLA) that mandates how quickly pages must load, or some point in the process, possibly at the firewall.
may just want to know what this number is. It is also import-
ant to know if one page takes longer than others to load Hosts
this indicates a bottleneck in your application. Because so many of todays websites call out to a pleth-
ora of additional hosts for things like content delivery
Response load time networks, ad servers, analytics servers, social media and
Just knowing page load time is not enough. If a page is syndicated content, it is important for these sites to be
slow, you need to know why. Being able to look at average enumerated in your reports. Its equally important to be
response times for each response gives you a detailed look able to view all of the calls to a particular host. If a host is
into where the time is being spent. called from your pages, the response time for those re-
quests will add to the time it takes your pages to render.
Errors and warnings
You need to know which errors and warnings were generat-
Donts:
Do not run tests in real environments*. A real
environment can have other network traffic, and this
may affect test results. To avoid excess data transfer,
use a test environment that behaves in the same way
as the real environment except that there is no other
traffic usage. (Refer details on prepare stage to per-
form load test in production).
Dynamic simulation of visitor data and traffic patterns via data wizard
SmartBears software quality tools assist with code review, functional and
load testing, API readiness as well as performance monitoring of these mod-
ern applications.
LOAD TESTINGWISHT
10 THINGS DEVELOPERS 101: THEIR
ESSENTIAL TIPSUNDERSTOOD
BOSSES FOR TESTERSABOUT
AND DEVELOPERS
CODE REVIEW 21
21
Over 4 million software professionals and
25,000 organizations across 194 countries
use SmartBear tool
Functional testing through Functional testing, Synthetic monitoring for API, Peer code and documentation
performance monitoring performance testing and test web, mobile, SaaS, and review
management Infrastructure