Logo
/ stress-testing

How to prepare for a stress test?

By DeviQA on Mon Nov 14 2016 00:00:00 GMT+0000 (Coordinated Universal Time)

How to prepare for a stress test?

Subscribe Now!

Get the latest QA news and tips from DeviQA
Stress testing is a kind of test that characterizes the system in terms of the sustainability of its operation under conditions that exceed its normal state. Sounds boring? In this article we’ll tell you how to prepare for stress testing and much more.

Checking operation in extreme conditions of use for the software for any malfunctions is extremely necessary, as they can lead to serious consequences, both financial and more serious like human lives.

Often, it’s not possible to manually create the required load conditions, therefore, refer to:

  • focusing on certain types of transactions, which are more strongly influenced by the occurrence of boundary situations than during a simple load testing;
  • the use of scripts, virtual users, and other automated simulations of intense workflow that allow you to study the behavior of the software at peak loads;
  • studying the bottlenecks of the system;
  • studying the error handling process and exceptions.
  • Another case of stress testing is to test the capacity of the application, the purpose of which is to determine the safety margin of the system. With this type of testing is necessary to consider the current load of queries and transactions, as well as their expected number in the future. As a result of capacity testing, we get a lot of acceptable characteristics in accordance with its requirements in the development process.

    How to prepare for a stress test?

    Nowadays, with the ever-growing number of Internet users and PC users in general, we seriously face with the task of creating systems capable to work under enormous loads without visible slowdowns and failures.

    Any kind of problems associated with poor performance can lead to failure of the customer to use your software, even if it suits them functionally. In this regard, a qualitative stress testing should be mandatory in order to ensure the stability of your applications.

    Stress testing and performance testing are automated simulating the work of a certain number of users on any or general (shared among them) resource.

    Here are the steps of stress testing:

    1. Stress models development (can take up to 50% of time).
    2. Testbed configuration.
    3. Script development.
    4. Conducting the test.
    5. Analysis of results.

    The preparation stage (see point 1 above) consists of:

  • requirements analysis;
  • target audience analysis;
  • definition of the basic load profile;
  • stress models development.
  • Requirements analysis: Preparing for Stress Test

    In the analysis of the requirements, the focus needs to be done to identify the main criteria for the success of the tests. To do this, you will need to identify the following characteristics:

    1. The response time (how long it takes to open a page or obtain the expected result).
    2. The intensity (the number of requests per second - Qps).
    3. Useful resources (CPU usage, number of used memory, disk and network I/O).
    4. The maximum number of users (number of users determines the ability to operate the system in a given configuration).
    5. And also some metrics of business scenarios related to work (for example, the number of business transactions per unit of time, run-time business transactions, etc.).

    These specifications will be used as base-loaded points of the application under test. All the results obtained will be compared to them for a decision on the conclusion of the test or future performance profiling.

    Analysis of requirements depending on the type of project

    It’s necessary to consider whether the new startup project is developed or it’s a profiling project in operation.

    For startup projects:

  • analysis of the generally accepted criteria of performance;
  • performance analysis of competing applications;
  • analysis of expert opinions of developers, system and network administrators, database administrators and engineers on stress testing;
  • analysis of expectations of target users (user groups).
  • For profiling projects:

  • analysis of the generally accepted criteria of performance;
  • performance analysis of competing applications;
  • performance Analysis of the operated version of the application to determine requiring profiling functions, processes, operations, etc.;
  • analysis of expert opinion of developers, system administrators and database administrators, engineers, load testers;
  • analysis of target users opinions (user groups).
  • Analysis of the target audience

    Communicating directly with users, monitoring their activities helps us to understand more precisely how it will look like to work with the software, which parts of the application are the most critical and require special attention. If the system under test is already in operation, user scenarios and distributed queries throughout the day can be obtained analyzing logs from the application server.

    As a result, we get:

  • a clearly dedicated group of users (ex. administrators, operators, registered customers, new users, etc.);
  • description of the test scenarios on the basis of the actual behavior of each group of users;
  • distribution schedule of the execution of business operations throughout the day.
  • Determination of base load profile

    Highlighted at the previous step, user groups, business scenarios, system requirements can start to create the load profile - a set of operations and the intensity of their performance for each user group. Knowing the number of users in each group, we will have to distribute them to perform the required operations, while maintaining the necessary intensity.

    Development of stress models

    Depending on the type of test conducted and the objectives pursued by them, we have to develop different load patterns.

    It can be different:

  • number of user requests and their intensity;
  • users behavior: one at a time, step by step groups or we start all at once;
  • script duration from 10 minutes to several hours or even days.
  • The easiest way to carry out the changes by varying the parameters in the base profile and load tool for performance testing (ex, HP LoadRunner, Jmeter).

    How to prepare for stress test: Stress Testing Model

    By increasing the intensity of the operations above the peak (the maximum allowed) values ​​or increasing the number of users until the load becomes greater than the maximum permissible value, we check that the system is operable under stress. Furthermore, lowering the load to the average values, check (the system's ability to regenerate), that the system is back to normal (basic load characteristics do not exceed the basic).

    Conclusion

    Strict adherence to all of the above instructions to will allow us to:

  • further analyze and test performance requirements;
  • specify the parameters and performance characteristics;
  • get a better understanding of the operation of the system as a whole;
  • get to the exit plan of forthcoming activities associated with stress testing;
  • determine the maximum volume of system data (to maintain acceptable performance);
  • determine the maximum number of users (groups) (to maintain acceptable performance);
  • identify resource-intensive operations or scripts (for further profiling system);
  • to monitor the effect of the input system optimization with regular measurements of performance, developed and tested * using the stress model.
  • Having the ready-designed load model, we can safely move on to the next stage of preparation for the stress testing called the testbed. It will be one more exciting story…