Monday, December 1, 2008

Chapter 2: Performance Testing – A Quick Overview

Software Performance Testing Handbook

A Comprehensive Guide for Beginners




Performance Management


Reactive Approach
The Performance testing activity is often considered as a reactive way of performance management. In most of the cases, the system performance is never thought of during the early phases of Software Development Life Cycle phases (SDLC). Performance Testing is often thought of only as a last activity after the system testing phase.

Also, if the performance bottlenecks are related to the system architecture or the system design, then it becomes highly impossible to fix the issues due to the high COPQ (Cost of Poor Quality) and in certain cases, the system is put into trash because of the huge deviations in the performance constraints.

Basically waiting for the performance problems to appear and then dealing with it at the end is always not a better approach. Hence performance testing is considered as a reactive approach as there is not much importance given to the system during early life cycle phases. It is more a ‘fix-it-later’ approach which is not that effective.

Proactive Approach
The Proactive approach anticipates the performance problems well in advance and adopts techniques to mitigate them. The importance of performance is thought about during all the SDLC phases right from the requirement analysis phase and various performance engineering activities are identified for the system.

The disadvantages of ‘fix-it-later’ approach are well understood and engineering practices are adopted to analyze the system design in performance angle. As the system is evaluated for the performance right from the design phase, the chances of last minute surprises is very less in proactive approach.

Application Performance Management

Application Performance Management (APM) is about managing the performance of the application throughout its lifecycle to ensure availability and better performance to the end users of the system. It forms a closed loop of performance management by managing the performance in development, testing and production stages of the application. Lot of production monitoring and diagnostics tools are available in the market to identify the performance problems of the production system and to provide quick diagnostics to resolve the performance problems. It also provides lot of inputs to carry out the pre-production performance testing. Some tools provide flexibility to use the same test assets (scripts, etc) for both pre-production and post-production performance testing.

Myths about Performance Testing

Organizations generally like to make the headlines with their success stories and not about the failure web sites due to unexpected user load. Industry study reveals that poor performing IT applications cost industrialized nations almost $45 billion annually. Most of the organizations understand the importance of performance testing and the impact of bypassing it. ‘How much time would it take to do the performance testing of an application?’ is a million dollar question for all organizations wherein the Software Performance Engineering (SPE) is not in place from the start of the project. Most of the organizations plan for the performance testing of the applications towards the end of the project, though it is of great importance to decide whether the performance bottlenecks are addressed before the go-alive dates in order to meet the end user demand on the production systems.

The following are the some of the popular myths about Performance Testing.

MYTH 1 : Performance testing is the last activity thought of only based time availability.
FACT : The importance to the system performance should be thought from the requirements identification phase and performance engineering activities needs to be practiced during each phase of SDLC.

MYTH 2 : Conducting Performance testing would increase the system performance irrespective of implementing the recommendations.
FACT : Conducting Performance test alone will not improve the system performance. It helps to identify whether the system meets the performance test goals and identify the performance bottlenecks of the system.

MYTH 3 : Performance Testing is just doing code profiling or memory profiling to tune the code.
FACT : Performance Testing is about evaluating the system for its conformance to the performance test goals and thereby identifying the performance bottlenecks in the software and hardware of the system.

MYTH 4 : Performance Testing needs to be done on all the functional flows of the application to identify performance issues.
FACT : Performance Testing needs to be done for specific scenarios based on Pareto analysis. The scenarios that are used often, which are of stakeholder’s concern, high critical scenarios, scenarios which are considered error prone are the right candidate for conducting performance testing.

MYTH 5 : The response time goal should be per the industry standards.
FACT : There is no industry standard for response time. The response time goal needs to be derived based on the hardware and software capacity available for the system considering the end users tolerance limit.


MYTH 6 : Instead of investing in performance testing activities, it is better to procure high capacity hardware as it is cheap.
FACT : Industry studies show that the hardware price is improving at around 40% per annum whereas the demand for IT resources is increasing at around 60% per annum. The reason for the actual performance issue needs to be identified through performance testing activity.

MYTH 7 : Performance Testing can be planned in parallel during the functional testing.
FACT : Performance Testing needs to be planned on a stable system only after the completion of system testing phase.

MYTH 8 : An application needs performance testing once in its life time irrespective of how many modules of the application are revamped over a period of time.
FACT : Performance testing needs to be best done as a continuous process of measuring, analyzing and tuning the system performance. The system performance needs to be re validated whenever the code is changed or added in the system or if there is a hardware change.

MYTH 9 : The Performance bottlenecks can be identified by conducting one test run.
FACT : The Performance bottlenecks cannot be identified by conducting one round of test. The isolation of bottlenecks becomes very tough in complex systems. Multiple rounds of isolation tests need to be run in order to identify the performance bottlenecks depending upon the type of bottleneck.

MYTH 10 : Performance Testing can be done only if the system is properly tuned.
FACT : Performance Testing can be done on any system to identify the bottlenecks. Irrespective of the system condition, performance testing can be conducted.

MYTH 11 : The Performance Tester is solely responsible for detecting and tuning the system for performance.
FACT : It is often a joint effort to detect the performance bottleneck and tune the system to meet its performance goals. Advices from Subject matter experts, DBAs and System administrators become a value add to identify/isolate the bottleneck easily.

MYTH 12 : Performance Testing can be carried out only on the development / test environment.
FACT : Performance Testing needs to be planned on an isolated environment in order to isolate the performance bottlenecks easily.

Performance Process Maturity Model

Michael Maddox proposes five levels of the maturity model for the performance test process. All the levels have the following common characteristics:

1. The levels are cumulative. The performance activities and processes practiced at level 2 are retained and enhanced at level 3 and so on through higher levels.
2. Different applications may exhibit different maturity levels.
3. Some level of learning and feedback is applied as work progresses. Organizations at higher levels of maturity apply more effective, more strategic feedback.

Chapter 1: Introduction

Software Performance Testing Handbook

A Comprehensive Guide for Beginners



Why Performance Testing is Crucial


Performance Testing is an essential activity for developing optimal software solutions. It is highly important to avoid last minute surprises that arise after deploying the application in the production environment. The failures experienced by the end users are vulnerable to the competitors.

Performance Testing helps to answer the sample of following questions:

• What is the response time of system during the expected load condition?
• How is my system behaving during unexpected load condition?
• Is my system scalable to specific user load?
• Which environment provides the best performance for my system?
• Is my system performing well after adding the new NIC card?
• Will my system handle the spike user loads? Or will it crash?
• Does my system need a dedicated database server to meet the performance goals?

The performance being the essential quality of software application, it is required to evaluate the software systems for its performance.

Performance Testing Jargons

The following are the some of the main performance testing terminologies used in day today life. A good understanding of the below jargons are critical to get the most out of this book.

Business Transaction: It refers to a sequence of request-response and the related information exchange between the client and the server in order to accomplish a business requirement. For example, an online banking customer transferring money from one account to other is a business transaction.

Test Scenario: It refers to a high critical business transaction or high traffic workflow identified for the performance testing. Normally all the business transactions cannot be tested for its performance. The Paretto analysis helps to identify those specific 20% transactions which is often exercised by the end users rather than testing the remaining 80% non-critical transactions.

Think Time: It refers to the time taken by the user for thinking or clicking on any of the web page links, buttons, etc while navigating through the web site. Think time is a very important parameter which needs to be set while scripting the scenarios using the performance testing tools. The business analysts of the application or web site management team or sometimes even the end user survey might give a realistic picture about the think time requirements of a transaction.

Virtual User: The Performance testing tool simulates the real user traffic by creating virtual users during the performance test. A virtual user is configured in the performance test tool to run the script simulating the real user behavior. Though in real time, users access the application from a unique IP address, more than one virtual user can be configured to access the application from the same IP address.

Simultaneous User load: The simultaneous users have the active session on the server at any point of time wherein each user will be executing different transactions. For example, if we say 100 simultaneous users load, then there will be 100 active sessions opened up in the server, wherein each user will be performing different set of transactions – one logging in, another viewing reports, another navigating to the next page, etc. The simultaneous user load of a web site would be always greater than the concurrent user load of a web site.

Concurrent User load: The concurrent users connect to the server and perform the same operation at any point of time. For example, if we say 100 concurrent user load, all 100 users would be logging in at the same point of time, view the reports at the same point of time, etc. For example, an online banking web site might have 10,000 – 20,000 simultaneous user load, but 1000 to 1500 concurrent user load.

Performance Requirements/Goals: It refers to the quantitative way of putting forth the criteria for claiming the system performance is good. The performance requirements of an application are often expressed in response time, hits per second, transactions per second, etc. The performance requirements of the System Under Test (SUT) need to be quantitatively expressed in the performance test plan.

Workload: It refers to the user load subjected by a web application under real time user access or during the performance test and the way the users are distributed between various transaction flows. Normally, the web server log files of a web site can be analyzed to learn about the workload of the site (if the web site is already in production). For web sites which are yet to go alive for the first time, a workload model needs to be developed based on the discussion with business analysts, application experts, etc. It is very important to know the workload of the application before conducting the performance test. Conducting the performance test for a system without proper analysis on the workload might lead to misleading results.

User Abandonment: It refers to the situation wherein the end users exit from the web site because of the slow performance of the site. The user abandonment rate varies from web site to web site. A low priority web site might experience a high user abandonment rate compared to the payroll web site. Analysis on the abandonment rate of the site needs to be done before concluding on the load on the site.

Baseline Test: It refers to the test conducted to measure the application performance for 1 virtual user load. The baseline test is often conducted to collect the metrics about the system performance for 1 user load and thereby it could be used for comparing the system performance at a high load condition. It also helps to check the validity of the test script.

Benchmark Test: It refers to the test conducted to measure the application performance for a low load condition. Normally for a benchmark test, 15 -20% of the target load can be considered. The objective of the benchmark test is to validate the correctness of the test scripts and to check the readiness of the system before subjecting it to a high load. It helps to know whether various components of the system collaborate as per the design and meet the performance test SLA for 20% of target load.

Hit: It refers to the server request for accessing a web page or a file or an image from a web server. For example, if a web page contains 5 images, then a user visit to that page creates 6 hits on the web server (5 hits for fetching each of the images and 1 hit for fetching the web page). For a web site, the performance requirement can be derived in terms of hits per unit time like ‘the system should support the load of 10 hits per second with a response time of below 5 seconds’.

Response Time: It refers to the servicing time or processing time in order to serve the request. It is measured from the time the web browser sends the request to the web server to the time when the first byte of response is received by the requesting user after server processing. The response time of a transaction say login refers to the time taken by the server to respond to the request by logging into the system and displaying the home page (it includes web server processing time + application server processing time + database server processing time + network latency).

Throughput: It refers to the amount of data (in bytes) transferred by the server in order to the serve the client requests. It is a good indicator of server performance as it refers to the amount of work done by the server. Throughput also referrers to the number of requests or transactions processed by the server at any point of time. For example, the server throughput can be expressed as 2.5Mbps or 35 Hits/sec or 8 Transactions/sec.

Page Views: It refers to the number of pages transferred by the server in order to serve the client requests. i.e. number of times the web site is completely loaded or refreshed. A page is a html page or script page or plain text documents. It is also a good indicator of server performance. If a user visits a web site and navigates to 5 pages and then logs off then the Page Views could be indicated as 5.

Performance Bottleneck: It refers to the slow spot, the effects of which are widely felt. It refers to the situation/areas which do not allow the application to perform as per its ideal specifications. For example, the response time increase for the load of 100 virtual users because of improper setting of HTTP connections parameter in the IIS server, CPU utilization reaching 95% during 100 users load are typical performance bottlenecks. A bottleneck might lead to a failure if mitigation actions are not taken.

Load Test: It refers to the test conducted on the system simulating the actual usage pattern or a representative load in order to identify the system behavior and diagnose the performance bottlenecks in the system. The load test should have the objective of checking how the system performs for the specific load, say 1000 simultaneous users. It is carried out by ramping up the user load from zero to the maximum count with the specific ramp up rate depending upon the kind of application and the user access pattern. Sometimes load testing is conducted to identify the maximum acceptable user load or the highest arrival rate the system can handle.

Stress Test: It refers to the test conducted by subjecting the system to an unreasonable load to identify the system breakpoint. It is generally considered as a negative testing as the system is subjected to an unrealistic load. It is usually conducted to know the importance of potential harm created during unrealistic load and to act on it proactively. It also sometime helps the web site owners to inform the user base about the scalability limit of the application.

Spike Test: It refers to test conducted by subjecting the system to a short burst of concurrent load to the system. This test might be essential while conducting performance tests on an auction site wherein a sudden load is expected.

Volume Test: It refers to the tests designed to measure the throughput of the system more in a batch processing, messaging kind of environment. The objective of this test is to identify the processing capacity. Also, in database server perspective , a volume test can be conducted to test the server performance by subjecting it to huge data (say , 75,000 rows of employee information in EMPLOYEE table) keeping in mind the data available by end of 2 years of web site usage.

Stability / Longevity / Endurance Test: It refers to the tests conducted to check whether the system is able to withstand the load continuously for a longer duration say 48 hours, etc. The system is subjected to reasonable representative load and tested for its continued performance. These tests are helpful in identifying memory problems (memory leaks, buffer overflow, etc) which arise after continuous usage of the application for a longer duration.

Bottleneck Isolation Test: It refers to the specific tests conducted on the system or a specific component of a system to isolate or confirm the performance problem. It is often conducted during or after the load tests to identify the root cause / confirm a specific performance issue. Mostly these tests are decided dynamically to debug the performance problems.

Software Performance Testing Handbook - Preview Index

Preview available for quick reference of audience


Software Performance Testing Handbook
A Comprehensive Guide for Beginners


Chapter 1:Introduction - Preview

Chapter 2: Performance Testing – A Quick Overview - Preview

Chapter 3:Deriving Performance Test Goals - Preview

Chapter 4: Workload Identification - Preview

Chapter 5: Overview of Performance Testing Tools - Preview

Chapter 6: Setting up Performance Test Environment and Performance Test Scripts development best practices - Preview

Chapter 7: Application Benchmarking - Preview

Chapter 8: Performance Test Execution - Preview

Chapter 9: Performance Test Monitoring - Preview

Chapter 10: Performance Bottleneck Analysis - Preview

Chapter 11: Performance Test Reporting - Preview

Chapter 12: Road Ahead – Moving towards advanced Performance Engineering techniques - Preview

Thursday, November 27, 2008

My Book on Software Performance Testing for Begineers

Here is the updated table of contents of my book.... I am happy to share that the book will be available in my blog in downdable pdf format within a week. Preview of all the chapters will be available in couple of days.

Software Performance Testing Handbook
A Comprehensive Guide for Beginners

Author : Ramya Ramalinga Moorthy

Contents

Chapter 1: Introduction.. 7
What is Performance Testing.. 7
How Performance Testing is different from Functional Testing.. 8
What is an E-Business Application.. 8
Components of a Web Site.. 9
Why Performance Testing is Crucial.. 10
Performance Testing Jargons.. 10

Chapter 2: Performance Testing – A Quick Overview.. 15
Performance Management.. 15
Performance Testing Approach.. 16
Dynamism in Performance Testing.. 18
Application Performance Management.. 19
Myths about Performance Testing.. 19
Performance Process Maturity Model.. 22

Chapter 3: Deriving Performance Test Goals.. 25
Why to set the Performance Test Goals.. 25
Know your customer.. 25
Deriving Quantitative Goals.. 26
Industrial Standards for Benchmarks.. 27
User behavior Modeling.. 27
Importance of automation in Performance Testing.. 29
Performance Test Estimation.. 29

Chapter 4: Workload Identification.. 33
What is Workload? 33
Types of Workload.. 33
Customer Behavior Modeling.. 36
Customer Behavior Model Graph (CBMG).. 36
User Community Modeling Language (UCML).. 36
Web log Analysis.. 36
Web Log Analysis Tools Overview.. 37
Web Log Analyzers Summary.. 38
Web Log Analysis Metrics.. 42
Web Site Traffic Monitoring.. 46
Overview of Statistical distributions.. 46

Chapter 5: Overview of Performance Testing Tools.. 51
Performance Test Tool Requirements.. 51
Market Tools.. 52
Open Vs Licensed Performance test tools.. 52
Criteria for choosing the Performance test tool.. 52
The most important tool.. 53
Performance Testing Tools Overview.. 53

Chapter 6: Setting up Performance Test Environment and Performance Test Scripts development best practices.. 56
Know the Test and Production environment.. 56
Test environment Isolation.. 56
Network Isolation.. 57
Load Generators.. 57
Test Data Generators.. 58
Test Execution Environment.. 58
How to choose the test scenarios.. 59
Tips for writing successful performance test scripts.. 60
Real time versus Virtual user Mapping.. 63

Chapter 7: Application Benchmarking.. 64
What is benchmarking?.. 64
Why should we benchmark the applications?.. 64
Software Benchmarking.. 64
Hardware Benchmarking.. 65
Industry Standards for Benchmarking.. 65
Transaction processing Performance Council (TPC).. 65
Standard Performance Evaluation Council.. 66
Mistakes in Benchmarking.. 67

Chapter 8: Performance Test Execution 68
Quality of Service of web application.. 68
Virtual User Simulation.. 69
Pre-requisites for Performance Tests.. 69
Types of Performance Tests.. 70
Performance Test Execution Approach.. 73
Tips for Load and Stress Test Execution.. 76
Test Execution Factors.. 77

Chapter 9: Performance Test Monitoring 81Introduction to Performance Monitoring.. 81
What Counters needs to be monitored?.. 81
Key Performance Counters.. 82
Performance Monitoring in Windows platform.. 85
Using Perfmon.. 85
Post production Monitoring.. 87
Benefits of Performance Monitoring.. 87

Chapter 10: Performance Bottleneck Analysis.. 88
Scott’s Recommendation on Scatter Charts.. 88
Scatter Chart Types.. 89
Performance Test Analysis.. 90
Best Practices on Performance Bottleneck Analysis and Isolation.. 92
Performance Testing Vs Profiling.. 94
HP Diagnostics.. 94
SQL Profiler.. 98
Know your Limits.. 99
Typical bottlenecks on DB server.. 100

Chapter 11: Performance Test Reporting.. 102
Why is it Critical.. 102
How to report the results of performance testing.. 102
Components of a good Test Report.. 103
Components of a Good Visual 104
Response Time Reporting 104
Best Practices of Test Reporting recommended by Scott Barber 105

Chapter 12: Road Ahead – Moving towards advanced Performance Engineering techniques.. 107
Moving towards Performance Engineering.. 107
What is Queuing Theory?.. 107
Types of Queuing System.. 108
What can be modeled as Queues?.. 109
Limitations of Queuing Theory.. 110
Operational Laws.. 110
a. Utilization Law.. 110
b. Little’s Law.. 111
c. Interactive Response Time Law.. 112
d. Forced Flow Law.. 112
e. Flow Balance Assumption.. 113
f. Bounding Law of Service Demand.. 113
Capacity Planning.. 114
Why Capacity Planning is required.. 114
When is it required?.. 115

Happy Learning!!!!

Friday, May 9, 2008

Performance Simulation using Ptolemy Framework made easy by PEA

The moment we start talking about Performance testing, popular market tools, type of tests, bottlenecks and the isolation techniques ,etc comes to our mind. But am sure you would be definetly surpraised to see a group who always talks about simulation , performance modeling , prediction, etc. Yes, they are none other than my favourite reference site of PEA.

Checkout this new tool available in PEA site http://www.pea-online.com/resources.htm. But be prepared for getting lost into the world of new terminolgies and jargons which might scare you little. But try understanding at a high level what is the tool all about and it be a good start to learn more about it.
Even i am very new to simulation and am a begineer to this new world of simulation. But its really interesting and and with lot of excitement am writting this note. Let me give a quick intro of all i understand.

Ptolemy is a open source project developed by group of researchers at U.C. Berkeley. It is a framework for assembling software components, a modeling and simulation tool, a block-diagram editor, a system-level rapid prototyping application, a toolkit supporting research in component-based design, a toolkit for building Java applications,etc. You can correlate it to Rational Rose (or any other modeling tool) used to create UML diagrams which consits of actors and the necessary association and aggregations. In case of Ptolemy, the models are stored in a format called MoML (Modelling Markup Language) which is created by using Vergil, Ptolemy's editor. The MoML is a modelling markup schema in XML. It is the primary mechanism for constructing models using Ptolemy framework.

In Ptolemy,it is easy to create simulation model by dragging and dropping the available actors. It provides set of actors libraries where each actor is a pre-built java class written in the ptolemy framework. You can image an actor as a web server, another actor as a DB server and interconnect them.But there will be lot of input and output parameters which needs to be defined by the user to create a successful model and it is stored as an xml file internally.

Now, it becomes too complex to drag and drop all the required components to simulate the IT system infrastrucutre. PEA has come up with composite actors which are built by using a set of available actors provided by Ptolemy. So that, we can input the required details of the server infrastructure (like, how many servers, tiers, arrival rate and service demand of various service centers,etc) through a web UI and a xml schema can be created from their tool. This will be help the user not to spend time in learning how to use Ptolemy and how to manualy feed the input to each of the actors in the model using Vergil editor. The xml file generated from the PEA tool can be fed into the Ptolemy editor Vergil to generate the text output of the simulation model. The output will be the response time predicted on the simulated server infrastructure.

In nutshell, this PEA tool takes as input deployment configuration, hardware details, workload details, etc, and generates an XML file. This XML file when run using Ptolemy (Open source, Free for use, Berkeley Lab’s Simulation Framework) can be used for simulating the performance of an IT environment. Advantage I see is the it is not required to know about simulation or its in-build actors/features to use it.

Also checkout other free tools available in PEA site. Though those analytical tools are really valuable ones, the real challenge lies in understanding how to use those tool for our system under test practically and interpret the results. Ofcourse, thats their business and formally we might need to approach them and get trained in them to use them for projects effectively.

Happy Learning!!!