0% found this document useful (0 votes)
4 views29 pages

Performance Testing

Performance Testing is a software testing technique aimed at evaluating the performance and scalability of applications under expected workloads. It includes various types such as load testing, stress testing, and scalability testing, which help identify bottlenecks and ensure systems can handle user demands. Additionally, performance testing is crucial for improving user experience, reliability, and compliance while also having some disadvantages like being resource-intensive and complex.

Uploaded by

dhruvsapaliga12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views29 pages

Performance Testing

Performance Testing is a software testing technique aimed at evaluating the performance and scalability of applications under expected workloads. It includes various types such as load testing, stress testing, and scalability testing, which help identify bottlenecks and ensure systems can handle user demands. Additionally, performance testing is crucial for improving user experience, reliability, and compliance while also having some disadvantages like being resource-intensive and complex.

Uploaded by

dhruvsapaliga12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Performance Testing is a type of software testing that ensures software

applications perform properly under their expected workload. It is a testing


technique carried out to determine system performance in terms of sensitivity,
reactivity, and stability under a particular workload.

What is performance testing?


Performance testing is a type of software testing that focuses on evaluating
the performance and scalability of a system or application.
Performance testing aims to identify bottlenecks, measure system
performance under various loads and conditions, and ensure that the system
can handle the expected number of users or transactions.
Performance Testing ensures software applications perform properly under
their expected workload.

Types of performance testing


Performance Testing is the process of analyzing the quality and capability of a
product.
It is a testing method to determine the system’s performance in terms of
speed, reliability, and stability under varying workloads.
Just as performance testing is essential for ensuring that software applications
can handle expected workloads and maintain stability under various
conditions, understanding the intricacies of this testing type is crucial for
delivering high-quality software.
Performance testing evaluates how a system performs in terms of

responsiveness and stability under a particular workload.

Performance testing aims to examine the following factors of software

performance: speed, robustness, reliability, application size, scalability,

stability, and response times.


1.​ Speed measures how quickly the system responds to user
interactions or completes tasks
2.​ Robustness assesses the system’s ability to handle stress and
maintain performance under unexpected conditions
3.​ Reliability evaluates the consistency of the system’s performance
over time without failures
4.​ Application size considers the impact of the application’s size on
its performance, including load times and resource usage
5.​ Scalability tests the system’s capacity to maintain performance
levels as the workload increases
6.​ Stability checks the system’s ability to perform steadily under
normal and peak load conditions without crashing.
7.​ Response time measures the time it takes for the system to
respond to user inputs or requests.

Performance testing is also known as Perf Testing .


The types of Performance testing are as follows:
1. Load testing

Load testing simulates a real-world load on the system to see how it performs
under stress.
It helps identify bottlenecks and determine the maximum number of users or
transactions the system can handle.
It checks the product’s ability to perform under anticipated user loads.
The objective is to identify performance congestion before the software
product is launched in the market.

2. Stress testing

Stress testing is a type of load testing that tests the system’s ability to handle
a high load above normal usage levels.
It helps identify the breaking point of the system and any potential issues that
may occur under heavy load conditions.
It involves testing a product under extreme workloads to see whether it
handles high traffic or not.
The objective is to identify the breaking point of a software product.

3. Spike testing

Spike testing is a type of load testing that tests the system’s ability to handle
sudden spikes in traffic.
It helps identify any issues that may occur when the system is suddenly hit
with a high number of requests.
It tests the product’s reaction to sudden large spikes in the load generated by
users.

4. Soak testing
Soak testing is a type of load testing that tests the system’s ability to handle a
sustained load over a prolonged period.
It helps identify any issues that may occur after prolonged usage of the
system.

5. Endurance testing

Endurance testing is similar to soak testing, but it focuses on the long-term


behavior of the system under a constant load.
It is performed to ensure the software can handle the expected load over a
long period.

6. Volume testing

In Volume testing , a large number of data is saved in a database and the


overall software system’s behavior is observed.
The objective is to check the product’s performance under varying database
volumes.

7. Scalability testing

In Scalability testing , the software application’s effectiveness is determined by


scaling up to support an increase in user load.
It helps in planning capacity additions to your software system.

Why use performance testing?


Performance testing is crucial for businesses because it ensures
applications deliver a fast, reliable, and satisfying user experience,
which is vital for customer retention and satisfaction. It helps businesses
identify and resolve potential bottlenecks and issues before they impact
users, thereby preventing costly downtimes and revenue loss.
●​ Performance testing ensures faster and more reliable applications,
which leads to higher user satisfaction and retention.
●​ With performance testing, testers can identify performance bottlenecks
and issues early in the development process, reducing the risk of
failures in production.
●​ This testing approach ensures the application remains stable under
different loads and stress conditions.
●​ Performance testing is helpful in understanding and optimizing how the
application uses system resources like CPU, memory, and network
bandwidth.
●​ This testing confirms that the application can handle an increase in
users and data volume without compromising performance.
●​ Performance testing helps reduce the cost associated with performance
issues by addressing them before deployment.
●​ Performance testing is crucial in ensuring the application complies with
industry standards and regulations regarding performance and reliability.
●​ The objective of performance testing is to eliminate performance
congestion.
●​ It uncovers what needs to be improved before the product is launched in
the market.
●​ The objective of performance testing is to make software rapid.
●​ The objective of performance testing is to make software stable and
reliable.
●​ The objective of performance testing is to evaluate the performance and
scalability of a system or application under various loads and conditions.
●​ It helps identify bottlenecks, measure system performance, and ensure
that the system can handle the expected number of users or
transactions.
●​ It also helps to ensure that the system is reliable, stable, and can handle
the expected load in a production environment.

Important metrics for performance testing


Tracking the performance testing metrics provides insights into potential
performance issues and helps in optimizing the application’s efficiency and
stability.
Here are the common metrics and KPIs to track during performance testing:

1.​ Response Time Metrics: It is the time taken for a system to respond
to a request. High response times can indicate performance
bottlenecks that affect user experience.
2.​ Throughput Metrics: The number of requests processed by the
system per unit of time, usually measured in requests per second
(RPS) or transactions per second (TPS). It helps in understanding
the system’s capacity and efficiency in handling concurrent
requests.
3.​ Resource Utilization Metrics: It measures the percentage of CPU
capacity used by the application. High resource utilization can
indicate inefficiencies and potential bottlenecks, guiding optimization
efforts.
4.​ Error Metrics: This metric is known as the percentage of requests
that result in errors, usually measured as a proportion of total
requests. A high error rate can indicate stability and reliability
issues, signaling potential problems in the application.
5.​ Scalability Metrics: Scalability metric is defined as the system’s
ability to handle increased load by adding resources. It ensures the
system can grow and maintain performance as demand increases
6.​ Endurance Testing Metrics: This metric is crucial to check the
application’s performance over an extended period, indicating
issues like memory leaks.
7.​ User Experience Metrics: It includes the time taken for the first byte
of data to be received by the client after a request is sent.

Tools and frameworks for performance testing


Performance testing makes sure applications can handle expected workloads
and perform well under stress. Various tools and frameworks are available to
help conduct comprehensive performance tests. Here are some of the most
widely used performance testing tools:

1.​ Apache JMeter is a tool for load testing and measuring


performance that supports various protocols such as HTTP, HTTPS,
FTP, and more.
2.​ Gatling is a load-testing tool designed for ease of use, high
performance, and maintainability.
3.​ K6 is a modern load-testing tool for testing the performance of APIs,
microservices, and websites.
4.​ NeoLoad is a performance testing platform designed for continuous
testing and DevOps integration
5.​ BlazeMeter is a load-testing platform compatible with Apache
JMeter and Gatling.

How to conduct performance testing?


Conducting performance testing involves several steps to ensure that a
software application can handle expected loads and perform well under
stress.
Here’s a simplified guide on how to conduct performance testing:

performance testing process

Step 1: Set Up the Testing Environment (Identify The Right Test


Environment and Tools)-
First prepare the place where you will run the tests for the performance
testing. Make sure you have all the needed tools and understanding for the
setup, like what devices and software you will be using for the performance
testing
Step 2: Decide What to Measure - Think about what you want to know from
the tests. This will include things like how fast the system responds to and
how much it can handle the tests. You can also look at successful similar
systems to set your goals.
It is important to define clear and measurable performance goals, including
acceptable response times, throughput, error rates, and other relevant
metrics. You must also determine specific performance targets for different
aspects of the system, such as transaction processing times, page load times,
or API response times.
Step 3: Plan Your Tests to Figure out different scenarios to test, considering
things like how users might behave and what data you will use. This helps you
create tests that cover a range of situations and decide what data to collect.
Step 4: Set Up Your Tools Get everything ready for testing, including tools
and ways to track what’s happening during the tests.
Step 5: Create and Run Tests Make the tests based on your plan and run
them. Keep track of all the data you get from the tests.
Step 6: Look at the Results After each test, see what you find out. Adjust
your tests based on what you learn, and run them again to see if things
change.
Step 7: Keep Testing Keep analyzing and adjusting your tests to get the best
results. Repeat the process until you are satisfied with the performance.

Advantages of Performance Testing


●​ Identifying bottlenecks : Performance testing helps identify
bottlenecks in the system such as slow database queries, insufficient
memory, or network congestion. This helps developers optimize the
system and ensure that it can handle the expected number of users
or transactions.
●​ Improved scalability: By identifying the system’s maximum
capacity, performance testing helps ensure that the system can
handle an increasing number of users or transactions over time. This
is particularly important for web-based systems and applications that
are expected to handle a high volume of traffic.
●​ Improved reliability: Performance testing helps identify any
potential issues that may occur under heavy load conditions, such as
increased error rates or slow response times. This helps ensure that
the system is reliable and stable when it is deployed to production.
●​ Reduced risk: By identifying potential issues before deployment,
performance testing helps reduce the risk of system failure or poor
performance in production.
●​ Cost-effective: Performance testing is more cost-effective than
fixing problems that occur in production. It is much cheaper to
identify and fix issues during the testing phase than after
deployment.
●​ Improved user experience : By identifying and addressing
bottlenecks, performance testing helps ensure that users have a
positive experience when using the system. This can help improve
customer satisfaction and loyalty.
●​ Better Preparation: Performance testing can also help
organizations prepare for unexpected traffic patterns or changes in
usage that might occur in the future.
●​ Compliance : Performance testing can help organizations meet
regulatory and industry standards.
●​ Better understanding of the system: Performance testing provides
a better understanding of how the system behaves under different
conditions, which can help in identifying potential issue areas and
improving the overall design of the system.
●​ Performance testing ensures the speed, load capability, accuracy,
and other performances of the system.
●​ It identifies, monitors, and resolves the issues if anything occurs.
●​ It ensures the great optimization of the software and also allows
many users to use it at the same time.
●​ It ensures the client as well as the end-customer’s satisfaction.
Performance testing has several advantages that make it an
important aspect of software testing:

Disadvantages of Performance Testing


Performance testing also has some disadvantages, which include:
●​ Resource-intensive: Performance testing can be
resource-intensive, requiring significant hardware and software
resources to simulate many users or transactions. This can make
performance testing expensive and time-consuming.
●​ Complexity: Performance testing can be complex, requiring
specialized knowledge and expertise to set up and execute
effectively. This can make it difficult for teams with limited resources
or experience to perform performance testing.
●​ Limited testing scope: Performance testing is focused on the
performance of the system under stress, and it may not be able to
identify all types of issues or bugs. It’s important to combine
performance testing with other types of testing such as functional
testing, regression testing, and acceptance testing.
●​ Inaccurate results: If the performance testing environment is not
representative of the production environment or the performance test
scenarios do not accurately simulate real-world usage, the results of
the test may not be accurate.
●​ Difficulty in simulating real-world usage: It’s difficult to simulate
real-world usage, and it’s hard to predict how users will interact with
the system. This makes it difficult to know if the system will handle
the expected load.
●​ Complexity in analyzing the results: Performance testing
generates a large amount of data, and it can be difficult to analyze
the results and determine the root cause of performance issues.
●​ Sometimes, users may find performance issues in the real-time
environment.
●​ Team members who are writing test scripts or test cases in the
automation tool should have a high level of knowledge.
●​ Team members should have high proficiency in debugging the test
cases or test scripts.
●​ Low performances in the real environment may lead to the loss of a
large number of users

Examples of performance testing


Performance Testing Example #1: E-commerce Website Performance Testing

Aspect Example Scenario

Ensure the website can handle peak traffic during sales


Objective
events and maintain fast response times

Load Testing Simulate 1000 concurrent users browsing products


Increase user load to 1500 concurrent users to identify
Stress Testing
system breaking point

Test scalability by doubling server resources and


Scalability Testing
measuring response times

Real User Monitor real user interactions during a flash sale to


Monitoring (RUM) identify performance issues

Performance Response time, throughput, page load time, transaction


Metrics success rate

Reporting and Generate reports with detailed performance metrics and


Analysis recommendations for optimization

Performance Testing Example #2: Mobile Application Performance Testing

Aspect Example Scenario

Ensure the mobile app performs well under various


Objective
network conditions and device specifications

Load Testing Simulate 5000 concurrent users accessing app features


Apply heavy load with 10,000 concurrent users to test
Stress Testing
app stability

Test app scalability by adding virtual users incrementally


Scalability Testing
and measuring resource consumption

Real User Monitor user interactions during app updates to identify


Monitoring (RUM) performance regressions

Performance App launch time, screen transition time, API response


Metrics time, memory usage, network latency

Reporting and Generate reports with insights on app performance, user


Analysis experience, and optimization recommendations

=========================================================

Apache JMeter™
The Apache JMeter™ application is open source software, a 100% pure Java
application designed to load test functional behavior and measure
performance. It was originally designed for testing Web Applications but has
since expanded to other test functions.
Apache JMeter may be used to test performance both on static and dynamic
resources, Web dynamic applications.​
It can be used to simulate a heavy load on a server, group of servers, network
or object to test its strength or to analyze overall performance under different
load types.

Apache JMeter features include:

●​ Ability to load and performance test many different


applications/server/protocol types:
○​ Web - HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET, …)
○​ SOAP / REST Webservices
○​ FTP
○​ Database via JDBC
○​ LDAP
○​ Message-oriented middleware (MOM) via JMS
○​ Mail - SMTP(S), POP3(S) and IMAP(S)
○​ Native commands or shell scripts
○​ TCP
○​ Java Objects
●​ Full featured Test IDE that allows fast Test Plan recording (from
Browsers or native applications), building and debugging.
●​ CLI mode (Command-line mode (previously called Non GUI) /
headless mode) to load test from any Java compatible OS (Linux,
Windows, Mac OSX, …)
●​ A complete and ready to present dynamic HTML report
●​ Easy correlation through ability to extract data from most popular
response formats, HTML, JSON , XML or any textual format
●​ Complete portability and 100% Java purity.
●​ Full multi-threading framework allows concurrent sampling by many
threads and simultaneous sampling of different functions by separate
thread groups.
●​ Caching and offline analysis/replaying of test results.
●​ Highly Extensible core:
○​ Pluggable Samplers allow unlimited testing capabilities.
○​ Scriptable Samplers (JSR223-compatible languages like Groovy
and BeanShell)
○​ Several load statistics may be chosen with pluggable timers.
○​ Data analysis and visualization plugins allow great extensibility
as well as personalization.
○​ Functions can be used to provide dynamic input to a test or
provide data manipulation.
○​ Easy Continuous Integration through 3rd party Open Source
libraries for Maven, Gradle and Jenkins.

Terminologies used in JMeter


Thread Group (Users)
A Thread Group defines a pool of users that will execute a particular test case
against your server.

Controls how many virtual users will access your website or app during the
test.

In the Thread Group GUI, you can control

1.​ the number of users simulated (number of threads),


2.​ the ramp up time (how long it takes to start all the threads),
3.​ the number of times to perform the test, and
4.​ optionally, a start and stop time for the test.

When using the scheduler, JMeter runs the thread group until either the
number of loops is reached or the duration/end-time is reached - whichever
occurs first.

Note that the condition is only checked between samples; when the end
condition is reached, that thread will stop.

JMeter does not interrupt samplers which are waiting for a response, so the
end time may be delayed arbitrarily.
Samplers
Samplers perform the actual work of JMeter.

Each sampler (except Flow Control Action) generates one or more sample
results.

The sample results have various attributes (success/fail, elapsed time, data
size etc.) and can be viewed in the various listeners.

Different samplers are


○​ FTP Request
○​ HTTP Request
○​ JDBC Request
○​ Java Request
○​ LDAP Request
○​ LDAP Extended Request
○​ Access Log Sampler
○​ BeanShell Sampler
○​ JSR223 Sampler
○​ TCP Sampler
○​ JMS Publisher
○​ JMS Subscriber
○​ JMS Point-to-Point
○​ JUnit Request
○​ Mail Reader Sampler
○​ Flow Control Action (was: Test Action )
○​ SMTP Sampler
○​ OS Process Sampler
○​ MongoDB Script (DEPRECATED)
○​ Bolt Request

FTP Request
This controller lets you send an FTP "retrieve file" or "upload file" request to
an FTP server.
If you are going to send multiple requests to the same FTP server, consider
using a FTP Request Defaults Configuration Element so you do not have to
enter the same information for each FTP Request Generative Controller.
When downloading a file, it can be stored on disk (Local File) or in the
Response Data, or both.

Latency is set to the time it takes to login.

HTTP Request

This sampler lets you send an HTTP/HTTPS request to a web server.

It also lets you control whether or not JMeter parses HTML files for images
and other embedded resources and sends HTTP requests to retrieve them.
The following types of embedded resource are retrieved:

●​ images
●​ applets
●​ stylesheets (CSS) and resources referenced from those files
●​ external scripts
●​ frames, iframes
●​ background images (body, table, TD, TR)
●​ background sound

Listener
Listeners in JMeter are reporting components that will show us the results and
the reports.
Most of the listeners perform several roles in addition to "listening" to the test
results.
They also provide means to view, save, and read saved test results.

Note that Listeners are processed at the end of the scope in which they are
found.

The saving and reading of test results is generic.

The various listeners have a panel whereby one can specify the file to which
the results will be written (or read from).
By default, the results are stored as XML files, typically with a ".jtl"
extension.

Storing as CSV is the most efficient option, but is less detailed than XML (the
other available option).

Listeners do not process sample data in CLI mode, but the raw data will be
saved if an output file has been configured.

In order to analyse the data generated by a CLI run, you need to load the file
into the appropriate Listener.

=========================================================
Download JMeter

Extract the downloaded file.


Strat JMeter by clicking on Jmeter.bat file
JMeter interface is divided into following sections
1.​ Menu bar
2.​ Tool bar
3.​ Test Plan
4.​ Tree View
5.​ Editor
6.​ Result tree
7.​ Time , Logs and Users

How to create First JMeter Test


Step 1 : Start JMrter
Step 2 : Create a Test Plan
Step 3 : Create a Thread Group(Users)
Step 4 : Add a sampler (HTTP)
Step 5 : Add Listeners
Step 6 : Run the Test

Creating test plan

File> New

OR
Create Thread groups (Users)
Right click on Test Plan
Add > Thread(User) > Thread Group
Thread group is created
Add Name , Comment (optional) Number of Thread, Ramp_up period
And Lop count

Create sampler
Right click on Thread Group
Add > Sampler > HTTP Request

Add Name, Protocol , Server name or IP and Path


Add Listener
Right click sampler(HTTP Request)
Add > Listener > View Results Tree
Save
Run
=========================================================
https://www.geeksforgeeks.org/performance-testing-software-testing/

https://www.qatouch.com/blog/performance-testing/#:~:text=Why%20is%20pe
rformance%20testing%20crucial?%20Performance%20testing,is%20vital%20f
or%20customer%20retention%20and%20satisfaction.

You might also like