Performance Testing
Performance Testing
Application Under
Creating the test
load on the
application (Lets assume Gmail
application)
What are Vusers Can we have
Image real users
there were
1000 users
These
were real
users
Virtual Users
OR
Vusers
Types of users
Key Facts
Number of concurrent users is not same as the number of
application users
Performance testing tools and protocols
8
What is
Architecture?
What is architecture?
An architecture is a
10
Importance of architecture
Helps in
Designing smaller and more manageable pieces of application
Understanding dependencies between components
Enables interaction
Between different parties (stakeholders) who intend to develop the computer-
based system
Between different systems and system components
11
What is a server
15
Client/Server - 2 Tier architecture
16
3-Tier Architecture
Presentation
Layer
Business logic tier between presentation logic and data tier
Business Logic
Layer
Data Access
Layer
Data
PC Database
(Thin Client) Server
Application
Server
17
Three tier architecture
Advantages
Separate processor might be present for each application layer
18
N-Tier (Multi-Tier Architecture)
Business Logic
Layer
Enterprise Data
Database
PC (Thin Client) Web Server Application Server
Server
Specialized web servers were introduced which can generate presentation content
which is transferred to the browser on the client tier, which takes care of rendering
the user interfaces
19
What is performance testing?
Key Notes:
Performance Tester are required to identify Performance Bottlenecks but not Defects
(Bugs)
Important Terms in PT
Performance Testing usually deals PE not only deals with identifying the
with identifying issues in the issues but also eliminating the same.
Application Under Test
Types of Performance Testing
Load Testing
Steps The online load will be maintained at steady state for 1 hour
with only critical transactions
Entry All the Monitors are in place
Criteria Test Data is set-up
Shakedown completed successfully
Spike Testing
Spike Testing is considered to be subset of Stress Testing.
It is done by increasing the user load beyond anticipated load for short periods of
time.
Scenario Stress Test
Name
Scenario Type Stress Test – Duration N/A
Scenario To objective is verify that the application can handle the projected growth
Objective and to discover the breaking point of MERCURY SAMPLE PROJECT
Online
Scenario To discover memory issues and bottlenecks that might occur under daily
Objective usage of the application
Steps Steady state Test is maintained for 8 hour with half the Peak Load.
Test is performed using the user load considering the growth of the
application under test down the years.
This test is performed to check the capability to scale up or scale out
in terms of User Load.
Volume Testing
Iterations
Bottleneck
Analysis
Includes the number of virtual users and the volume of transactions per user
Collect information on
various combination of business transactions
N = X * (Rt)
N = X * (Rt + Zt + Pacing)
Rt + Zt = SET
NFR Gathering
Infrastructure Details
Example
Apache Tomcat Server 8
1.6GHz processors with 32MB Cache, 16GB Memory, 100GB Hard Disks, HP-UX and
Java ES pre-installed
Transaction Details
Example
For a banking application, following transactions are critical
Account Summary Details
Checking Transaction History
Balance Transfer
Login
Logout
Few years down the line, there is chance that user load on the application
might increase because of the business growth.
Because of this increased load, the performance of the application might get
affected.
So, performance Testing team is supposed to capture the future user volume
growth.
Example
There is a 100% increase in user load annually.
Workload Related data
Application usage patterns and volumes for each performance Critical Transaction is
captured as part of this model.
This data is identified by
Interviewing Clients
Analyzing existing logs
Example
Data related to response times and other
metrics
After the Performance test execution, the test results are compared with the
SLA to determine if the application meets performance expectations
Examples -
When application is subjected to 1000 concurrent user load, “Login”
transaction should not take more then 2 seconds to complete
When application is subjected to 1000 concurrent user load, CPU
utilization of the WebApp Server should never cross 60%.
DB Data
Database volumes affect round times for operations that access the database
The data retention model is used to capture the key DB tables and estimated
number of records in each of these tables
All this data will help in simulating realistic database volumes during test
execution
45
LoadRunner
Components of LR
• Virtual User Generator
• Controller
• Analyzer
• Load Generator
Virtual User Generator (VuGen)
• VuGen is the main component of LR which is used to
create scripts to simulate user actions on the AUT.
• Number of Vusers
• Number of LG’s
http://www8.hp.com/us/en/software-
solutions/loadrunner-load-testing/try-now.html
• Download starts
Installation of LR
• Browse to DVD folder and Double click on set-up file to
start the installation
Installation of LR
• Select the required installation option as “LoadRunner
Full Setup” and finish the installation.
• Vuser_init:
• Actions:
• Vuser_end:
Steps to Create a Script in VUGEN
Steps to Create a Script
Recording
Script
Protocol
Code Generation
• Correlations
Configuration
Recording Options
• General – Protocol option shows all the protocols chosen for the recording of the
script
75
Recording Options
• Network – Port Mapping is used to configure the port setting for capturing user
actions
• Three options available
• Socket level data
• WinInet level data
• Socket level and WinInet level data
77
Recording script using Vugen
78
Recording script using Vugen
Script created
after
recording
ends
79
HTML Based Script Vs URL Based
Script
HTML Based Script Vs URL Based Script
34
Think Time
Think Time
87
Comments
Comments
//
/* ……..*/
Check Points
Check Points
• Two types of Check Points are available with VuGen
Text CP
Image CP
94
Image Check Point
Image Check Point
101
Parameterization
Parameterization
• Create a Parameter
105
Give the parameter name, by default Parameter type and Original value will be
populated. You can change the Parameter type as required.
Click on “Properties” button.
“Parameter Properties” window will be opened.
Click on “Create Table” and enter the data by adding a new column if needed.
106
Close the Window
You can create different tables for different parameters or you can add all
parameters in same table with different columns and you can make the other
parameters use the same table by selecting the same “File path”.
107
Correlation
Correlation
• There are some dynamic values in the script which
changes from iteration to iteration.
• Pacing
• Log
• Think Time
• Speed Emulation
• Browser Emulation
• Preferences
Run Logic
Run logic : Allows manipulation of the run logic by setting different iteration values
118
Pacing
Pacing – Provides different options regarding when the next iteration
starts
119
Log
Provides various logging options
120
Think Time
Provides different options of how the think times are replayed during
run-time.
121
Network
Provides Network speed simulation options
122
Browser
Simulates browser during runtime
123
Internet Protocol
Preferences: Set preference for verification check point and other advanced options
124
Internet Protocol
Advanced Options: Set advanced options like step download timeout period, Keep alive
connections by
125
Other Miscellaneous options
Logs
• Replay
• Recording
• Generation
Regenerating the Script
Vusers Vusers
Server(s
)
LG1 LG2
Test Scenario Creation
Test Scenario
• Goal-Oriented Scenario
Adding Scripts to the Scenario
Adding Scripts to the Scenario
• Schedule By Group
• Basic Schedule
• Pacing
• Log
• Think Time
• Speed Emulation
• Browser Emulation
Test Execution
Test Execution
Generates graphs
• Summary report
90 Percentile
SLA
Running Vusers
Throughput
Merged
Overlay
Tile
Correlate
Test Report Generation
Test Report Generation
• Once Analysis is done, a Test report can be generated
in any one of the formats.