0% found this document useful (0 votes)
2 views

Lecture22

Performance Testing evaluates the speed, response time, reliability, resource usage, and scalability of software under expected workloads to identify and eliminate bottlenecks. Various types of performance testing include load, stress, endurance, spike, volume, and scalability testing, each serving specific purposes to ensure applications can handle user demands. Tools like Apache JMeter are used for conducting these tests, simulating user requests, and analyzing performance metrics.

Uploaded by

belo4kaaly
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture22

Performance Testing evaluates the speed, response time, reliability, resource usage, and scalability of software under expected workloads to identify and eliminate bottlenecks. Various types of performance testing include load, stress, endurance, spike, volume, and scalability testing, each serving specific purposes to ensure applications can handle user demands. Tools like Apache JMeter are used for conducting these tests, simulating user requests, and analyzing performance metrics.

Uploaded by

belo4kaaly
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Performance Testing Tutorial: What is, Types, Metrics &

Example

What is Performance Testing?

PERFORMANCE TESTING checks the speed, response time, reliability, resource usage,
scalability of a software program under their expected workload. The purpose of Performance
Testing is not to find functional defects but to eliminate performance bottlenecks in the software
or device.

The focus of Performance Testing is checking a software program's

●​ Speed - Determines whether the application responds quickly


●​ Scalability - Determines maximum user load the software application can handle.
●​ Stability - Determines if the application is stable under varying loads

Why do Performance Testing?

Features and Functionality supported by a software system is not the only concern. A software
application's performance like its response time, reliability, resource usage and scalability do
matter. The goal of Performance Testing is not to find bugs but to eliminate performance
bottlenecks.

Performance Testing is done to provide stakeholders with information about their application
regarding speed, stability, and scalability. More importantly, Performance Testing uncovers what
needs to be improved before the product goes to market. Without Performance Testing, software
is likely to suffer from issues such as: running slow while several users use it simultaneously,
inconsistencies across different operating systems and poor usability.

Performance testing will determine whether their software meets speed, scalability and stability
requirements under expected workloads. Applications sent to market with poor performance
metrics due to nonexistent or poor performance testing are likely to gain a bad reputation and fail
to meet expected sales goals.

Also, mission-critical applications like space launch programs or life-saving medical equipment
should be performance tested to ensure that they run for a long period without deviations.
According to Dunn & Bradstreet, 59% of Fortune 500 companies experience an estimated 1.6
hours of downtime every week. Considering the average Fortune 500 company with a minimum
of 10,000 employees is paying $56 per hour, the labor part of downtime costs for such an
organization would be $896,000 weekly, translating into more than $46 million per year.

Only a 5-minute downtime of Google.com (19-Aug-13) is estimated to cost the search giant as
much as $545,000.

It's estimated that companies lost sales worth $1100 per second due to a recent Amazon Web
Service Outage.

Hence, performance testing is important.

Types of Performance Testing

●​ Load testing - checks the application's ability to perform under anticipated user loads.
The objective is to identify performance bottlenecks before the software application goes
live.
●​ Stress testing - involves testing an application under extreme workloads to see how it
handles high traffic or data processing. The objective is to identify the breaking point of
an application.
●​ Endurance testing - is done to make sure the software can handle the expected load over
a long period of time.
●​ Spike testing - tests the software's reaction to sudden large spikes in the load generated
by users.
●​ Volume testing - test Data is populated in a database and the overall software system's
behavior is monitored. The objective is to check software application's performance
under varying database volumes.
●​ Scalability testing - The objective of scalability testing is to determine the software
application's effectiveness in "scaling up" to support an increase in user load. It helps plan
capacity addition to your software system.

Example Performance Test Cases

●​ Verify response time is not more than 4 secs when 1000 users access the website
simultaneously.
●​ Verify response time of the Application Under Load is within an acceptable range when
the network connectivity is slow
●​ Check the maximum number of users that the application can handle before it crashes.
●​ Check database execution time when 500 records are read/written simultaneously.
●​ Check CPU and memory usage of the application and the database server under peak load
conditions
●​ Verify response time of the application under low, normal, moderate and heavy load
conditions.

Load Testing vs Stress Testing vs Performance Testing:


Difference Discussed
When do you use Performance Testing?

Performance testing is done to check the performance of website servers, database, and network.
If you are adopting waterfall methodology, then it is important for you to check each time release
of a new version. However, if you are using the agile software development approach, then you
need to test application continuously.

When do you use Load testing?

Load testing is performed to determine how many users the system can handle. You can also
check out different scenarios that let you focus on different parts of your system. Like the home
page or checkout webpage on your website for web load testing. It also helps you to determine
how the load builds and sustains in the system.

When do you Use Stress Testing?

Website and app stress tests are significant before big events such as ticket selling for a famous
concert with high demand of the people. So it is very important to test regularly to the capacity
of the system endurance. This also helps you to prepare for unexpected traffic spikes and gives
more time and resources to fix any bottlenecks.
What is JMeter? Introduction & Uses

What is JMeter? Why it is used?

The Apache JMeterTM is pure Java open source software, which was first developed by
Stefano Mazzocchi of the Apache Software Foundation, designed to load test functional behavior
and measure performance. You can use JMeter to analyze and measure the performance of web
application or a variety of services. Performance Testing means testing a web application against
heavy load, multiple and concurrent user traffic. JMeter originally is used for testing Web
Application or FTP application. Nowadays, it is used for a functional test, database server test
etc.

Why JMeter?

How does JMeter work?


The basic workflow of JMeter as shown in the figures below

JMeter simulates a group of users sending requests to a target server, and return statistics
information of target server through graphical diagrams
First Script

1. Create test plan

A useful test plan is created with minimum 3 components –

●​ Thread Group – contains the simulation of multiple concurrent users. A single


thread represent a single user. We can create any number of threads to put the
desired load on the application. It also help us in scheduling the delay between two
threads, and any repetition of request batches.
●​ HTTP Request – consist the HTTP request configuration which thread group will
be invoking. It is the application URL which you want to load test.
●​ Listener – helps in viewing the result of the whole testing process. There are
multiple listener available in jmeter to verify the testing results.

1.1. Create Thread Group


To create a thread group, navigate to ‘Right click Test Plan -> Add -> Threads -> Thread
Group’.

Create Thread Group Option

Fill in the values as per your requirements (or based on your assumptions, we can change them
anytime in future). Name the thread group and save it to any location in your workstation.

Thread Group Created

1.2. Create HTTP Request


To add HTTP request details, navigate to ‘Right click thread group -> Add -> Sampler -> HTTP
Request’. http://blazedemo.com/

<

Create HTTP Request[/caption]>

Filled HTTP Request

1.3. Timers

When users click on your website or app, they naturally have pauses and delays. These can
be simulated with Timers.

Constant timers are the most common, and they determine how many milliseconds to wait
before between requests.

Right click - Add->Timer->Constant Timer


In this case, we will wait for 300 milliseconds.

1.4. Add Listener


To see the results of test plan, add listener named “” by navigating to ‘Right click thread group
-> Add -> Listener -> View Results Tree’.

Add Listener

2. Perform load testing

To perform the load testing, start the thread group using the green play icon at the top ribbon in
tool.

Start Load Test

Let all threads run and invoke the configured application URL. After the test is finished, we can
review the load test results in consolidated manner in listener tab.
Load testing results

Second Script

Go back to JMeter, add another HTTP Sampler, and this time, add the website path after the
server. In our example - reserve.php.

Afterwards, add the relevant parameters from your website or app. In this case: fromPort,
Boston; toPort, London.
We’ll also add a “View Results in Table” Listener, just to spice things up.

This is the second test plan, which includes hitting the Home page and then sending two
parameters to the Reserve page.
Save and run the test.

In the results, you can see that each page is hit 3 times:

https://www.guru99.com/jmeter-tutorials.html

You might also like