Lecture22
Lecture22
Example
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.
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.
● 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.
● 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.
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.
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.
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
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?
JMeter simulates a group of users sending requests to a target server, and return statistics
information of target server through graphical diagrams
First Script
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.
<
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.
Add Listener
To perform the load testing, start the thread group using the green play icon at the top ribbon in
tool.
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