Load Testing - Automation

Lecture



Modern software is simply obliged to work smoothly under enormous loads. Any kind of problems associated with poor performance can cause customers to stop using your software. In this regard, the conduct of high-quality load testing should be mandatory, to ensure the stability of your applications.

Now let's answer the question: “ What is load testing? ”, And we will try to describe in more detail the process of conducting load testing .

Load testing (Load Testing) or performance testing (Performance Testing) is an automated testing system that simulates the operation of a certain number of business users on a shared (shared) resource.

Starting work in the field of load testing, you should clearly understand that this is not just a record and a run (Record and Playback) of scripts, but a more complex process:

  • First , load testing is a serious research and analytical work.
  • Secondly , it is real automated testing that requires serious programming skills, as well as knowledge of network protocols and various application servers and databases.
  • Thirdly , there are different types of load testing that have different goals.

Next, I suggest you, item by point, go deeper into performance testing :

  • Terminology in load testing
  • Load testing objectives
  • Stages of load testing
  • Load model development
  • Tools for load testing

We also recommend reading the articles of stress testing specialists :

  • Load model as a starting point for performance testing (Alexey Bulat)
  • Testbed configuration for load testing (Alexey Bulat)
  • The main aspects of creating scripts for load testing (Alexey Bulat)

Of course, reading all this is not enough to say: “I have become a connoisseur or expert in performance testing,” for this you will need more than one year and more than one project. From ourselves we can only wish you good luck on this difficult path. If you have any questions, you can feel free to contact us. Specialists from the ProTesting group can consult on software testing and quality assurance.

Terminology in load testing

To discuss approaches to load testing and problems solved with its help, we suggest starting with terminology. Understanding the same entities under different terms, one can speak “one language”.

Load testing or Performance testing is an automated testing that simulates the operation of a certain number of business users on a shared (shared) resource. As an example, we can cite the work of employees of a modern bank in which everyone works with the same software applications installed on banking servers. Or the use of a web shop software application, in this case, the visitors who load the server will be Internet users.

The load is modeled using special products and techniques. What, what and how are we going to model? In order to understand this and you need to decide on the terminology:

  1. Virtual User - a software process that performs simulated operations cyclically
  2. Iteration is a single repetition of a looped operation.
  3. Operation Intensity - the frequency of the operation per unit of time, in the test script is set by the time interval between iterations
  4. Load ( Loading ) - the cumulative performance of operations on a shared resource (tr / sec, hits / sec)
  5. Performance ( Performance ) - the number of operations performed over a period of time (N operations per M hours)
  6. Application Scalability - proportional increase in performance with increasing load
  7. A performance profile is a set of operations with given intensities, obtained from the collection of statistical data or determined by analyzing the requirements for the system under test.
  8. The load point is the calculated (or specified by the Customer) number of virtual users in groups that perform operations with certain intensities.

Now consider how these entities are related. Expressing the intensity through the time interval between iterations, we see that the increase in the intensity of the operations performed is a reduction in the time interval. The increase in load is proportional to the increase in intensity. It is also natural that with increasing intensity, productivity increases. This increases the degree of use (workload) of resources. From a certain moment the productivity growth stops (and the load can continue to grow), saturation occurs and then the system degrades. In addition, it can be noted that during testing, the change in the intensity of operations may obey a law (for example, Poisson) or be uniform throughout the test.

Load testing objectives

The main goals of load testing are:

  1. Evaluation of the performance and performance of the application at the stage of development and transfer to operation
  2. Evaluation of the performance and performance of the application at the stage of release of new releases, patch sets
  3. Optimize application performance, including server settings and code optimization
  4. Selection of appropriate for this application hardware (software platform) and server configuration

Note that within the same goal, different types of performance and load tests can be used, for example, for the first, second and third goals, both performance testing and stability testing should be performed. But when planning load testing it is more logical to build on the technical objectives (and not commercial ones listed above) that are achieved as a result of testing and classify tests according to them:

  1. If you are interested in the study of application performance , namely, response times for operations on different loads in fairly wide ranges, including stress loads, then this is all the same performance testing (Performance Testing)
  2. If the goal is to understand how the application is stable in long-term use (excluding memory leaks, incorrect configuration settings, etc.) then a long load test is performed - this is stability testing (Stability Testing). At the same time, the analysis of response times may take place, but not be the first priority, the main thing is that the system "does not fall".
  3. Stress Testing aims to check whether the system returns to the normal mode after the exorbitant load (and how soon), testing the system behavior can also be the purpose of stress testing in cases where one of the application servers in the pool stops working, the hardware database server configurations, etc. Note also that during stress testing, it is not the performance of the system that is checked, but its ability to regenerate after an over load.

The main thing is to understand the goals of a particular test and try to achieve them.

Stages of load testing

Considering the stages of load testing , I would like to note the following, in our opinion mandatory:

  1. Analysis of requirements and collection of information about the system under test
  2. Testbed configuration for load testing
  3. Load model development
  4. Tool selection for load testing
  5. Creating and debugging test scripts
  6. Testing
  7. Results analysis
  8. Preparation, sending and publication of a load testing report

Load model development

Having decided on the types of load testing, goals and terminology, we turn to the main task of load testing - the development of a load model .

To do this, define the following:

  • list of operations to be tested
  • intensity of operations
  • dependence of intensity of operations on time

The list of tested tasks should include operations that are critical from a business point of view, as well as from a technical point of view:

  • Critical from a business point of view are operations, the speed of which, actually affects the performance of the business process. For example, an increase in the duration of customer service at a bank, the inability to perform the required number of operations during the day, and so on .
  • Critical from a technical point of view are resource-intensive operations, requiring a large amount of memory, seriously involving the processor, creating significant network traffic. As a rule, these are operations performed simultaneously by a large number of business users or the creation of complex reports, which include the so-called "heavy" queries to the database .

We would like to emphasize once again that by the degree of criticality of an operation, we mean its impact on the business process and the performance of the system . For example, creating a report that completely loads the database server at night will not be a high priority for optimization, and during business hours it will have the highest priority.

Next, I invite you to familiarize yourself with the following sections, step by step, revealing the specifics of developing a load model:

  • Learning application
  • Load profile definition
  • Calculation of load points
  • Baseline load point

Learning Applications

We will call the application under test as an “application.” To select parts of the application, namely the operations that will be tested, it is necessary to carry out work related to the study of the application. Application developers should be very helpful in this case, if we are talking about testing in the development process, or business users and system administrators, if the application is in operation. In the course of this work it is wise to take such steps:

  • Describe the components of the application and chart the interaction between them.
  • Select critical in terms of the intended testing of the operation. As such, can be selected:
    1. Operations with "heavy" database queries, report generation processes
    2. Operations performed by a large number of users or with high intensity
    3. Operations are critical from a business point of view, and also satisfying the conditions of the two upper points

Once again I would like to note that a survey of business users or a joint study with the developers and administrators of the system can greatly facilitate the task. If the application is in operation, you can monitor the load of the hardware components of the server (processor, memory, disks) and analyze the system logs of web servers (remove stats pack if you use Oracle as a database server, for example). Syslogs can show peaks of high user activity during the day and give a quantitative estimate of how many transactions (hits) are performed per unit of time. According to Pareto’s law or the 20/80 principle, 20% of application operations generate 80% of the system load, so you should try to select these 20% of operations for modeling.

Load profile definition

The key point in the load model is the operation or load profile selected for testing. Naturally, these operations in the test should be performed simultaneously. There can be several load profiles for the application and this is justified. After all, business users can perform different sets of operations at different times. For example, the beginning of the trading day and the end of the day, the beginning of the month (quarter) and, accordingly, the end may differ. Thus, we obtain different sets of application operations that are performed simultaneously and respectively create different loads. By the way, not only the operations themselves can change , but also their intensity . In the first approximation, the load model is a set of load profiles, where each profile differs from another by either a set of operations or the intensity of these operations.

An example of the load profile , which includes 5 operations, the value of n can be different for each operation:

<Load Profile>

  1. Operation_1 - the intensity of execution n times / unit of time
  2. Operation_2 - the intensity of execution n times / unit of time
  3. Operation_3 - the intensity of the execution of n times / unit of time
  4. Operation_4 - the intensity of execution n times / unit of time
  5. Operation_5 - the intensity of the execution of n times / unit of time
  6. Calculation of load points

    Since there are usually several operations in the load profile, this means that we will have several user groups. It is desirable to model each operation by a separate group of virtual users (although in life it is often the other way around, one business user may be responsible for performing several operations). However, if you assign one virtual user to perform a single operation, then it is easier to sustain a certain intensity (and, accordingly, performance) for this operation in the test than in the case when a sequential chain of operations is assigned to the virtual user. Knowing the intensity of the operation, you need to determine the number of virtual users in the group performing this operation. The ideal case when working with an application is similar to the work of a factory pipeline and there are accurate estimates of how many operations a user does per day . Most often it is not so and only the total number of operations performed during the day is known. It may also turn out that the intensity of the operation performed by each user is very low, for example, one user performs the operation once a day or every other day.

    Simulation of work with recalculation of intensities in this case can be illustrated by the following example.

    EXAMPLE : (for one operation)

    Number of operations = 200 for 4 hours
    Number of business users = 20


    1. Determine the number of operations for each user.
    200/20 = 10

    2. Every user performs 2.5 operations per hour.
    10/4 = 2.5

    3. Determine the repetition period of the operation (intensity) for each user.
    60 / 2.5 = 24 minutes

    4. To reduce the test time to an hour, and at the same time get at least some statistics on the execution of operations, as well as improve the "mixing" of operations during the test, you can increase the intensity by 4 times, while reducing the number of users just 4 times .
    24/4 = 6 min. = 360 seconds

    Thus, 5 virtual users, performing an operation with a period of 6 minutes, will provide for 4 hours a given performance equal to 200 operations.


    What gives such a recount :
    First , it is possible to reduce the test time without losing the statistics on the performance of operations, and hence the reliability of the test results.
    Secondly , it is possible to reduce the number of simulated users where their number goes beyond several thousand and thus lower the requirements for the number of resources of the loading computers (1VU may require up to 10MB of operating memory of the loading computer), and in some cases comply with the terms of the license agreement (license cost for test tools depends on the number of virtual users)

    What are the limitations :
    For some applications, it may be critical to the number of simultaneously open connections between the client and the server. There were situations when requests to the database started to work much slower if, when working with an application, the number of different users (different logins) increases and not the intensity of requests. And finally, the increase in the intensity of operations, should not lead to a situation when the repetition period becomes less than the time of the operation itself.

    In any case, despite some limitations, such a calculation may allow for variation in the number of virtual users and the intensity of their operations. At the same time, performance and, accordingly, the load should not change and be different from the set one. So, the load point includes the calculations of virtual users and intensities for all load profile operations.

Baseline load point

I would like to note that the calculation of the load point, described in the section Calculation of load points based on statistics collected for a running application (or on the expected workload for a newly developed application), is the starting point for further load growth, and the calculated load point can be considered a baseline or baseline point . Now you can increase the load, moving with a certain step, while increasing only the number of virtual users in groups, without changing the intensity of operations for a single virtual user.

A full load model is a set of load profiles with all load points for each profile . When developing test scenarios, all load points must be correctly implemented. I would also like to add that the load points for each profile must be at least three, in order to be able to evaluate the dependence of the response times of the operations performed on the growth of the load. Obviously, the more linear such dependence, the better the scalability of the application and the higher the predictability of its behavior under load.

Tools for load testing

Commercial tools for automated load testing:

Hewlett-Packard (Mercury Interactive) HP Performance Center (includes HP LoadRunner)
IBM Rational Rational performance tester
Borland (Segue) Silk performer
SmartBear LoadComplete Web Load Testing
Neotys NeoLoad

A separate item will highlight the free tools for automated load testing:

  • Jmeter is a variety of services.
  • This is a distributed test using many load injector machines. Test scripts are written in jython, and HTTP scripts.

Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Quality Assurance

Terms: Quality Assurance