Wednesday, 16 December 2015

Stress Testing of Web Applications



Stress Testing is performed to identify the issues of the application that can arise only in cases of extreme software and hardware conditions. These conditions may be heavy loads, extreme concurrency or limited resources. Stress Testing identifies the breaking point of the application and related system discrepancies that may occur just before that. Such inconsistencies may be:





- Loss or corruption of data.
- Unnecessary high resource utilization
.- Failure of application components to respond.
- Surfacing of new and un-handled exceptions.

Stress on an application can be due to one or more of the following reasons:

- Excessive user or data
- Denial of service
- Sudden spike in user transactions
- Unexpected outages

Steps for Stress Testing -

Step 1: Identify the test objectives

- The different ways that the system can possibly fail.
- Parameters to consider for building defenses against possible failures.
- Identify the behavior of the system under challenging situations.
- Ensure the stability of the system under stressful conditions.     
   
Step 2: Identify the main scenarios

-  Select scenarios critical to the overall application performance.
- Try operations that affect performance.
- Define scenarios based on potential bottlenecks through load testing and stress test in these areas.

Step 3: Identify the workload

- Incrementally increase the load and record the application performance under such conditions. Here, the key is to test the system with various workloads until a significant failure can be created.
The following activities help to identify the correct workload for stress testing:
- Observe the distribution of work
- Estimate the peak user load
- Simulate the anti-profile workload

Step 4: Identify the metrics

Metrics help to identify the potential problem areas in a system or application.The different types of metric categories are:

- Processor Utilization
- Memory Consumption
- Process recycles
- Available memory
- Utilized memory
- Disk utilization
- Network utilization
- Transaction Rate
- Successful transactions
- Failed transactions
- Successful orders
- Failed orders
- Rate of contention
- Deadlocks
- Thread allocation
- Transaction time

Step 5: Creation of Test Cases

In addition to workload profiles and key scenarios, additional parameters such as performance objectives, workload characteristics, test environment, test data and identified metrics are required to design a test case. The expected results should be mentioned for each test in such a way that the test can be marked as a pass or fail after its execution.

Step 6: Load Simulation

- Validate the test environment as expected.
- Ensure the correct configuration of the test and the test environment for metrics collection.
- Quickly execute a smoke test to ensure that the test script and the performance counters are correctly working.
- Reset and start the system.

Step 7: Result Analysis

Analyze and compare the results as per the accepted level for each metric. In case of any issues:
- Review the design.
- Review the code.
- Run the stress tests in environments where debugging is possible.

Conclusion

In practice, stress testing in generally applied in application testing, transaction testing and system testing. Exploratory stress testing is applied by subjecting the system to conditions that are very unlikely to occur. A stress test is sometimes confused with loadtest, which is a milder form of testing. Stress testing very brutally emphasizes on the robustness, reliability, stability and scalability of a web application.

Wednesday, 9 December 2015

What is Load Testing?



Load Testing is a process by which simulated demand is put on the application under test to demonstrate its  behavior under different load conditions. Load Testing generally applies ordinary stress to the application to review its performance under regular anticipated conditions. Its final objective is to establish that the software is able to handle the load it has been designed to handle. 

Load Testing, a key type of performance testing, enables to measure the response times, throughput rate and the level of  resource utilization of the software application. It subjects the associated hardware, server, the network to its load limits. This can be done under lab conditions to accurately get an idea of  its capabilities or it can be conducted in the field to get a qualitative idea of its functions in the real world. 



Endurance testing is a type of loadtesting. It subjects the application to load volumes over an extended period of time. Endurance Testing quantifies the Mean Time to Failure and Mean TIme Between Failure.

Steps for Load Testing-

Step 1: Identify the performance acceptance criteria. This is determined by balancing the business, technology, competition and user requirements. The objectives of test generally include:

- Response Time

- Throughput

- Resource Utilization

- Business Load

- Maximum User Load

Step 2: Identify the anticipated user scenarios with high risk key performance goals. The main steps for identifying these scenarios are:

-  Identify the scenarios for the Web Application

-  Identify the activities in each scenario

-  Identify the commonly executed, most resource intensive scenarios

Step 3: Once the key scenarios are identified, the workload profiles can be created to design load tests. For this, the characteristics of the user scenario need to be defined.
- A user scenario can be thought of as a user session, which can include navigational paths and a number of intermediate steps to complete a task.

- Consider user pause as user delay or think time.

- Define the average time for each session for multiple concurrent views.

- Define the primary users.

Step 4: Identify the target load levels to ensure that the tests can be used to compare a variety of load conditions. The common inputs used for this are:

- Key Scenarios

- Volume of business

- Work distribution

- Session characteristics

Step 5: Identify the metrics that are most relevant to the performance objectives. Only well selected metrics provide valuable information. This can be done by:

- Defining performance questions that can be tested.

- Determine quality goals

- Identify the metrics

- Identify the supporting metrics

- Regularly reevaluate the metrics to be collected

Step 6: Designing tests can be done through the scenarios defined, selected key metrics and the workload analyzed. Each test has its own purpose, and is able to collect its own data and have its different target load levels.  Tests are designed to collect information that helps to understand, evaluate and enhance the application.

Step 7: Load simulations need to reflect the tests designed in order to collect useful information. The following points need to be considered for this:
 
- Configure the test environment as per the production environment.

- Ensure the not interference of performance counters with the simulation.

- Use appropriate tools for load generation.

- Begin with a small number of users, continue to increase the load, record the behavior till the threshold is reached, identify when the system crosses the threshold limit and continue to do so till the SLA limit is violated.

Step 8: Result Analysis

- Analyze the recorded data against the accepted level to determine the inward or outward trend from the performance objective.

- Analyze the data and identify the potential bottlenecks.  


Conclusion:

Load testing enables us to quantify the maximum operating capacity of an application. It should not be confused with Stress testing, which is performed to determine the application's breaking point. It is a more severe form of testing, which helps to record the different warning signals that a software gives out before its actual breakdown.

Monday, 23 November 2015

An understanding of Performance Testing



Performance Testing of an application ensures its responsiveness, reliability, throughput and future scalability under a certain workload. Performance testing determines the following for an application.

-           Assess readiness for production.

-           Compare performance against performance criteria.

-           Find performance issues.

-           Determine throughput levels.




Performance Testing can be divided into the following test activities:

-           Performance Test: It is a technical investigation that determines characteristics such as responsiveness, scalability and throughput of the application system.

-           Load Test: It verifies the performance of the application under different conditions of work load ranging from normal to peak conditions. It helps to determine the response time, resource utilization levels, and throughput rates and further identifies the breaking point of the application on an assumption that the breaking point occurs within the peak load condition.

-           Endurance Test is classified under load testing. It validates the performance of the application when it is subjected to volumes of workload over a period of time. This helps to calculate the Mean Time between Failure and Mean Time to Failure for the application. 


-           Stress Test: it verifies the performance of the system when it is subjected to work beyond peak load conditions. The bugs generated here include synchronization problems, memory leaks etc. Stress test determines how the system functions under extreme loads.

-           Spike Test is classified under stress test. It validates the performance of a system by subjecting it repeatedly to load models beyond anticipation for short periods of time.


-           Capacity Test: This test determines how many transactions the application will support and still meet its performance parameters. It basically determines the future scalability of the system.

Risks Addressed by Performance Testing


-           Speed related risks

-           Is the application fast enough?

-           Is the application able to process the data before it becomes outdated?

-           Is the application able to provide the latest information?

-           Is the application able to respond within time before an error occurs?


-       Scalability related risk

-       Is the application able to provide consistent response time?

-           Is the application able to store all the data in its life time?

-           Is there any warning flag that shows it is reaching its peak capacity?

-           Will the application secure under heavy usage?

-           Will the application get compromised under heavy usage?

-           Will the application be able to handle heavy work loads?


-     Stability related risk

-           Is the application able to run for longer periods of time without inconsistencies?

-           What happens to incomplete transactions during abrupt system failure?

-           Will the application still function seamlessly once rebooted?

-           What are the probabilities of a system crash?

-           Can the system be scaled up or down without putting it down?

The main activities of performance testing are as follows:


-           Test Environment Identification

-           Identification of the Performance Criteria

-           Planning and designing of tests

-           Configuration of the test environment

-           Implementing the test design

-           Executing the tests

-           Analyzing results, reporting and retesting.

Conclusion

The goal of carrying out performance testing is not to find out bugs but to eliminate them. It is necessary before releasing the application into the market. There are a number of performance testing tools available. HP Loadrunner, HTTP Load and Proxy Sniffer are a few.