[Performance Test] Summary by senior veterans, summary of common concurrency problems (1)


Preface

1. Definition of concurrent testing

There are two main points in the definition of concurrent testing:

Point level:
Doing something at the same time. For example: At 7:30 on Monday morning, primary school students must go to the playground to raise the national flag.

Line level:
Do different things in a time period. For example: from 11:30 to 13:00 noon, some primary school students dance rubber bands and some play football, but at the same time they put pressure on the server.

2. Concurrency testing is not equal to performance testing

I asked this question to many job seekers during interviews, and the first reaction of most job seekers was that concurrency testing is performance testing.

In performance testing, concurrency is divided into load and stress testing. Although concurrency testing and performance testing overlap, concurrency testing is not only used in performance testing, but is also used in other fields.

3. Classification of concurrent tests

Concurrency testing is not just performance testing, it exists in various testing stages, and the testing purposes are different.

4. Functional concurrency testing

First conduct concurrency testing of single business function scenarios, and then conduct concurrency testing of mixed business function scenarios.
The purpose of functional concurrency testing is to verify whether the system functions meet the requirements of the requirements specification.

5. Performance concurrency testing

On the premise that certain system performance indicators are met at the same time, the object under test is allowed to bear different workloads to evaluate the maximum processing capacity of the object under test and whether there are defects.

The purpose of performance concurrency testing is to verify whether the system performance indicators meet the requirements of the requirements specification.

6. Stability concurrency testing

Judge the long-term stable operation ability of the test system.
The purpose of stability and concurrency testing is to verify whether the system stability meets the requirements of the requirements specification.

7. Abnormal concurrency testing

The simulated system runs under poor and abnormal resource configurations to evaluate the working status of the tested object under insufficient resources.

The purpose of exception concurrency testing is to verify whether the system's exception response mechanism meets the requirements of the requirements specification.

8. Common concurrency problems

There is a fashionable software design concept currently popular called "microservices". Split complex functional combinations into several independent services for development, and then selectively combine and execute each service.

The microservice development framework is conducive to concurrent test design. Each service is the entry point for testing and can be executed independently. In other words, the more test entry points, the more conducive to the design of test scenarios and the effective execution of concurrent use cases.

The concurrency entry point looks for statistics from the following three aspects:

1) Client operation
Use tools to capture requests submitted to the server, analyze links and parameters for testing.

2) System interface
Consult relevant interface documents, develop and simulate other system functions for testing.

3) Scheduled tasks
Scheduled tasks are development frameworks that may require secondary development and testing in the form of interfaces.

The problem of concurrent testing is a syndrome, often with multiple errors intertwined, so "medicine" cannot be used indiscriminately. Solving this type of problem usually involves the following five steps (two more steps than putting an elephant in the refrigerator):
① Find the fault point through concurrent testing;
② Analyze the cause of the problem based on the phenomenon of the fault point;
③Discuss the solution after determining the cause;
④Implement repair according to the solution;
⑤ Verify the repair situation with the concurrent test.

4) Transaction concurrency issues
Concurrency issues caused by transaction processing, we need to first understand what a transaction is.

5) The definition of transaction
is the smallest unit of database operation. It is a series of operations performed as a single logical unit of work. These operations are submitted to the system as a whole, or executed , or not executed, a transaction is a set of operations (logical unit of work) that cannot be further divided.

6) System internal transaction control
The quality of transaction control often depends on the coders' development skills, business understanding ability, and concentration. Bugs caused by such errors It is very low level and serious (yellow card must be shown for warning)!

Let’s illustrate with an example: using APP to book movie tickets. First, open a group, find a movie, select the location, and click "Confirm Selection", then enter the payment page, submit the order, select Alipay to pay, and receive a text message after the payment is successful.

In the first half, you use your mobile phone to open a group, find the movie you want to watch, select seats, and submit the order to the payment page. "Select seats" and "Submit order" are both internal interfaces of a group.

If these two are treated as one transaction, they have the following four characteristics:
Atomicity: Either they are integrated, or they are not integrated.
Consistency: If you lock a seat and submit an order, an order number must be generated. If you cancel the order, the seat will be unlocked.
Isolation: The seat is selected by others, there is no network, operation log recording fails, etc.
Durability: After a transaction is committed, it exists permanently and will not be affected by any failures.

As a tester, the test points that need to be considered are:
A seat is locked by multiple accounts and an order is generated;
The seat is locked successfully , but no order is generated;
The order is canceled and the seat is not unlocked;
A duplicate order number is generated;
The operation log is not fully recorded All behaviors.

Let’s analyze the second half of the movie ticket booking scenario: on the payment page, Alipay is used to pay, and a platform text message is received after the payment is successful.

"Payment successful" is an external interface. For transaction control of the external interface, the design of two systems needs to be considered.

Concurrent interface testing of the payment interface, transaction issues to be considered:
For the same order, multiple methods cannot be selected at the same time, and multiple payments cannot be made;< a i=2> Repeated notification of uploaded payment results (payment successful, payment timed out), only one order can be processed; The log record completely records the payment information sent and accepted, matching the content of the test case.

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)

On the stage of life, everyone is his own protagonist. Therefore, please pursue your dreams bravely, use hard work and sweat to shape your own unique life role, and make the world more exciting because of you!

Life is like a journey, it doesn’t matter how far the destination is, only the scenery and mood along the way. Therefore, please cherish every journey, face every challenge with a smile and courage, and let life be beautiful because of you!

Everyone has his own value and meaning, we just need to discover and realize it. Therefore, please believe in your potential, bravely pursue your dreams, and use actions to create your own beautiful future!

Guess you like

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