A 13-year testing veteran, summary of interface concurrency performance test analysis, don’t take any more detours...


Preface

1. Concurrent test definition

Purpose:
is to use concurrency as a means to conduct interface testing, and through testing behavior to discover functional problems caused by the interface in concurrent scenarios.

Type:
①Point level: Do something at the same time;
Example: At 7:30 in the morning, all students raise the national flag

②On the online level: Do different things at one time, but at the same time it puts pressure on the server;
Example: At one point in time, some students jump rubber bands and some play football a>

Concurrency and performance: Concurrency testing is not the same as performance testing, and performance testing is only a subcategory of concurrency testing.

2. Concurrent test classification

Functional concurrency testing:

Analysis: First conduct concurrency testing of single business function scenarios, and then conduct concurrency testing of mixed business function scenarios.
Purpose: To verify whether the system function meets the requirements of the requirements specification;

Performance concurrency test:
Analysis: On the premise of meeting certain system performance indicators at the same time, let the object under test bear different workloads to evaluate the maximum processing capacity of the object under test and whether there are defects.
Purpose: To verify whether the system performance indicators meet the requirements of the requirements specification;

Stability concurrency test:
Analysis: Determine the long-term stable operation ability of the test system.
Purpose: To verify whether the system stability meets the requirements of the requirements specification;

Abnormal concurrency test:
Analysis: The simulation system runs under poor and abnormal resource configuration to evaluate the working status of the tested object under insufficient resources.
Purpose: To verify whether the system's exception response mechanism meets the requirements of the requirements specification.

3. Organize design ideas

1) Need analysis

①First find the concurrent test object and understand the functions of the demand test. They can be organized according to business functions without going into details.

② Secondly, describe the importance of the test object, such as core functions that require strict quality, frequently used functions, functions that occupy more system resources, etc.

③ Finally, the test objects are split. For example, purchasing goods can be split into: searching for goods, locking inventory, submitting orders, sending payment instructions, accepting and processing payment results, business flow, SMS and site notifications, VX push results, etc.

2) Environmental needs analysis

Clarify the key test objects, set basic data and a large amount of historical data in advance, and simulate the real environment.

3) Analysis of performance index requirements

Analyze whether the performance indicators are reasonable.
You can consider these aspects of historical data: TPS, page views, number of concurrent requests, etc., to judge whether the demand indicators are reasonable and arrange priorities.

4. Test plan design

1) Test strategy

Preparation for concurrent testing:
After determining the request sequence, mutual calling relationship between requests, data flow direction, whether there are calls to external systems, etc., it is necessary to clarify the key test objects and set the foundation in advance Data and a large amount of historical data, simulate the real environment, etc.

Test strategy execution generally involves the following 4 stages:
① For functional concurrency testing: first conduct concurrent testing of single business function scenarios, and then conduct mixed business function scenarios Concurrency testing.

② For performance concurrency testing: On the premise of meeting certain system performance indicators at the same time, let the object under test bear different workloads to evaluate the maximum processing capacity of the object under test and whether there are defects.

③For stability and concurrency testing: determine the long-term stable operation ability of the test system. The intensity of this strategy is small and generally tends to the pressure intensity under the daily conditions of the customer site.

④ For abnormal concurrency testing: simulate the system running under poor and abnormal resource configuration, such as artificially reducing the resources required for the system working environment, network bandwidth, system memory, data frames, etc., to evaluate the work under insufficient resources. state.

In different testing stages, testers focus on different testing purposes. Therefore, for testers, testing ideas are the most important. Only with testing ideas can we have good testing plans.

2) Test plan

Take two rounds of testing as an example:
The first round of testing is driven by interface documents. The testing steps and key points are as follows.

①Write interface test code: Check the incoming parameter control of each interface: length limit, format, required item limit, normal value range limit, etc. At the same time, confirm whether the error message is accurate and in place;

②Abnormal data testing: For example, if the channel value is set to a negative number, the attribute setting does not exist, the network is disconnected, the database locks the table, etc., check whether the data is abnormal;

③ Conduct concurrent transaction testing interface by interface: check account amount, user flow, and reconciliation flow data. Check whether the data is consistent with the use case call result;

④ Composite interface concurrency test: Concurrently conduct various recharge and transaction type interfaces in a certain order to verify whether the account balance and flow are consistent with the use case call results.

The second round of testing is driven by business scenarios. The testing steps and key points are as follows.
①Unified action concurrency: concurrent payments and refunds for the same order;
②Mixed transaction scenarios: flash sales, centralized returns, and arrival confirmation; >
③Bypass page operation: Capture packets and throw abnormal values ​​for transaction testing.

5. Indicator analysis

1) Organize concurrency requirements

Demand content:
Noon and evening are the peak periods for ordering, so there will be a large number of concurrent orders. In order to ensure the order success rate, response speed and other factors, we need to conduct concurrent performance testing on the order volume during the peak period.

Performance indicator requirements:
① Opening speed <3s, successful order submission <5s;
②Order success rate reaches over 99.5%;
③In the peak period of 100 concurrent users, the order processing capacity reaches at least 900TPS.

2) Extract performance indicators

Take 100 takeout orders as an example. The concurrency indicators that need to be extracted are:
①Number of concurrent orders
②Number of successful orders< a i=3> ③Successful order response time ④Order success rate ⑤Total response time of successful orders ⑥Successful orders Average response time ⑦Tps




3) Performance index analysis

①Number of concurrent orders: that is, the custom number of concurrency, set the concurrency to 100 times, set to 10 threads, and each cycle 10 times;
②Number of successful orders: that is, get If the response value is a successful request, first define a success_count with an initial value of 0. If successful, +1 will be executed;

③Order success rate: number of successful orders/total number of successful orders;
④Total order response time: the sum of the response times of each successful order, so we define a sum_time , the initial value is 0.00, and then the response time of each success is added up;

⑤Average order response time: total response time of successful orders/number of successful orders;
⑥TPS: number of successful concurrency/average response time of successful orders;
⑦ Order response time: Get the time before the request, and get the time again after the assertion is successful. The difference between the two is the response time of the order.

The following is the most comprehensive software testing engineer learning knowledge architecture system diagram in 2023 that I compiled.

1. Python programming from entry to proficiency

Please add image description

2. Practical implementation of interface automation projects

Please add image description

3. Web automation project actual combat

Please add image description

4. Practical implementation of App automation project

Please add image description

5. Resumes of first-tier manufacturers

Please add image description

6. Test and develop DevOps system

Please add image description

7. Commonly used automated testing tools

Please add image description

8. JMeter performance test

Please add image description

9. Summary (little surprise at the end)

Everyone will encounter difficulties and challenges on the road to pursuing their dreams. But please remember: only those who have experienced wind and rain can see the most beautiful rainbow! So, please move forward and meet every new challenge!

No matter what situation you are in now, please believe: as long as you have a dream in your heart, there is a road at your feet. Therefore, please strengthen your faith, move forward bravely, and use sweat and wisdom to write your own glorious chapter!

Life is like a marathon, it doesn't matter how high the starting point is, only whether the end point is reached. Therefore, please keep running, use perseverance and courage to realize your dreams, and let life be wonderful because of you!

Guess you like

Origin blog.csdn.net/shuang_waiwai/article/details/134711969