Performance Testing 103 : Load and Performance Testing of middleware application using Load Runner
Middleware is general term used to describe a computer software which connects two otherwise separate applications. Middleware often plays a role between operating system and applications on different servers and unravels the development of applications that leverage services from other applications.
As per Wikipedia “Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to perform communication and input/output, so they can focus on the specific purpose of their application.”
Middleware includes web servers, application servers and similar tools that support application development and delivery.
Typically, middleware programs provide messaging services so that different applications can communicate using frameworks/protocols like simple object access protocol (SOAP), web services, representational state Transfer (REST) and JavaScript object Notation (Json).
At a basic level, middleware provides services required to connect applications together such as concurrency, transaction management, threading and messaging.
Importance of performance testing of middleware applications
Performance is one of the most important aspects concerned with the quality of software. It indicates how well a software system or component meets its requirements of timelines. When it comes to testing of an application, it includes front end and middleware testing. Testing of middleware plays important role as well even though while testing front end invokes the same services. Because when it comes to API (application programming interface) level, the load and response time varies from front end testing scenarios. When we are testing middleware separately it includes high level of volume.
For example let’s take a scenario where we are testing a front end web application www.example.com . It will have different flows to test. Each and every flow will have different load and performance testing scenario. Let’s say there is one flow in which user will open browser and go to user accountuser detailsupdate the detailslogout. In this whole flow each and every page will invoke subsequent APIs which will return the responses to servers and then to users. So in this case we are testing APIs with front end load. Which is very less if we compare to middleware. Because same APIs which are called in this flow might be called in other flows also. Similarly, there will be many other front end applications which might be invoking the same APIs simultaneously, as multiple front end applications share the same middleware layer. So for a single API load will be more than calling front end. We can’t test API from one of calling front end by just increasing the load on it. Because load for calling front end is less as compare to API. When we will test with more than expected load it might crash. So testing this API separately will give the whole idea how this API is performing under actual load. That’s why testing of middleware is important.
The focus of Performance testing is checking a software programs:
- Speed (Response Time) - Determines whether the application responds quickly.
- Scalability - Determines maximum user load the software application can handle.
- Stability - Determines if the application is stable under varying loads.
Aspects in Middleware testing
While testing middleware, we need to focus on following attributes:
- Volume
- SLA
- Workload Model
While calculating the volume we need to consider the traffic from all the front end apps and ideal SLA for usual web services. We can get the traffic numbers from production log and by using Little’s Law we can come up with appropriate number.
Load distribution across all the identified scenarios of application is called the Workload. Workload model of an application depicts how this application will be used in the production environment. In order to get such performance test results which portray the true picture of application, it should be tested on a workload model which is very similar to the production environment.
Workload selection is a very important step while designing a scenario for a Performance Test. Distribution of load across the identified transactions in a given time is called Workload. Workload helps us to study the behavior of the system under various identified workload model. Workload model can be designed by predictability, repeatability and scalability. E.g. consider a website which provides online seasonal greeting cards. During festival seasons, the number of visitors will be high, whereas during non-seasonal time, visitors will be minimal. By predicting the number of visitors, one can design workload model accordingly. The type of workload needed may be different for different types of tests and moreover, appropriate selection of workload type is also important to ensure that the designed scenario simulates the real world situation in the best possible way.
Types of workload model in HP performance center
The workload types offered by HP Performance Center 11.0 can be broadly classified based on two parameters:
- Type of Schedule - Basic or Real World
- Applicability of the Schedule – By Test or By Group
Based on the various combinations of the above two parameters, there are four different Workload Types available in HP Performance Center.
- Basic Schedule By Test
- Basic Schedule By Group
- Real- World Schedule By Test
- Real- World Schedule By Group
Different types of Performance testing of Middleware
The primary goal of performance testing includes establishing the benchmark behavior of the system. There are a number of industry-defined benchmarks, which should be met during performance testing.
Performance testing does not aim to find defects in the application, it address a little more critical task of testing the benchmark and standard set for the application. Accuracy and close monitoring of the performance and results of the test is the primary characteristic of performance testing.
There are following main types of performance testing of middleware application:
Load Testing: A load test is type of software testing which is conducted to understand the behavior of the application under a specific expected load. Load testing involves simulating real-life user load for the target application. Load testing is performed to determine a system's behavior under both normal and anticipated peak load conditions. It helps to determine how the application behaves when multiple users hit it simultaneously. It analyses software intended for a multi-user audience by subjecting the software to different numbers of virtual and live users while monitoring performance measurements under different loads.
Load testing Goal: The primary goal of load testing is to define some definite amount of work a system can handle without significant performance degradation with in definite duration (generally 1 hour).
Example: For example, to check the email functionality of an application, it could be flooded with 1000 users at a time. Now, 1000 users can fire the email transactions (read, send, delete, forward, reply) in many different ways. If we take one transaction per user per hour, then it would be 1000 transactions per hour. By simulating 10 transactions/user, we could load test the email server by occupying it with 10000 transactions/hour.
Stress Testing: Under stress testing, various activities to overload the existing resources with excess jobs are carried out in an attempt to break the system down. Negative testing, which includes removal of the components from the system is also done as a part of stress testing. Also known as fatigue testing, this testing should capture the stability of the application by testing it beyond its bandwidth capacity.
The purpose behind stress testing is to ascertain the failure of system and to monitor how the system recovers back gracefully. The challenge here is to set up a controlled environment before launching the test so that you could precisely capture the behavior of system repeatedly, under the most unpredictable scenarios.
Stress Testing Goal: The goal of the stress testing is to determine the point of failure or breaking point of the system and to analyze post-crash reports to define the behavior of application after failure. The biggest issue is to ensure that the system does not compromise with the security of sensitive data after the failure. In a successful stress testing, the system will come back to normality along with all its components, after even the most terrible break down.
Example: As an example, if there is an application which can handle 30 simultaneous users login at a time. Purpose of our stress testing is to load it with the more than 30 users and we will check where application is cracking the hardware/software resources.
Endurance Testing: Endurance testing involves examining a system while it withstands a huge load for a long period of time, and measuring the system's reaction parameters under such conditions. Performance quality may also be tested to make sure that both the result and the reaction times - after a defined long period of continuous load - are degraded no more than a certain specified percentage from their values at the beginning of the test.
Endurance testing Goal: The goal is to discover how the system behaves under sustained use. That is, to ensure that the throughput and/or response times after some long period of sustained activity are as good as or better than at the beginning of the test. It basically used to test the memory leaks.
Example: A system may behave as expected when tested for about 1 hour but when the same system is tested for 5 or 8 hours or even more than that, the problems such as memory leaks cause the system to fail or behave randomly or even the application might crash.
Available ways to test middleware by using Load runner
- By using web http/html protocol
- By using web services protocol
By using web http/html protocol
By using web service protocol
- Open VuGen and select web service protocol.
- Click on SOA Tools on top tool bar and Click on manage Services.
- Import and give the WSDL by choosing any one of the option (URL, File, UDDI).
- Now Click on Add Web Service Call on top tool bar. Give the Input Arguments and Leave the output arguments empty. And click on ok. As shown in the following image.
- It will create a script in load runner as shown below. You can perform the steps one by one in this way for all the web services steps. You can use lr_xml_find and lr_xml_get_values to validate the response.
Comments
Post a Comment