Execute the chaos test with one click, and hang the service completely

Early in the morning, the boss of the company arranged for Xiao T to do a system business scenario stability test. Is this a good thing? Haha, I told the boss, I have a solution, don’t blame me for killing the system, the boss said: It’s okay to kill the test environment, the main thing is to test the robustness of the system!

The words are spoken, but is it really easy? I was so anxious that Xiao T was a male (difficult) and a big man (sweaty), so I couldn’t find Chatgpt, and the operation was as fierce as a tiger. Haha, Chatgpt provides an interface chaos test, and the general idea is to do it in the form of collision database The principle of the test interface is as follows:

Configure the chaos rules, and then arrange and combine them in the form of "crash stuffing", replace the parameter values ​​in the forward interface use cases to perform crash stuffing, and complete the interface robustness test "crash stuffing" in an instant. First change them one by one, and then Rearrange the combination.

Well, now comes the key question, Little T can’t write this kind of code (hahahaha)! ! ! But there is still a very good way, manual operation exhaustive, but look at the number of interfaces: more than 10, each parameter is not too small, not exhaustive, there are many permutations and combinations, Xiao T thought about it It only takes about 50 hours, OK, the system is not hung up, and the little T hangs up first!

At the same time, what Little T tests is not a single interface, but a business scenario that includes a series of interfaces. This is not what I said last week: " Have you ever had pain in R&D management ?" " Interface orchestration was mentioned in the tweet.

In the end, little C gave little T a trick to learn about the corresponding functions of Codes. Little T quickly joined the technical support group of Codes. The technical support told little T that for this small case, interface scene arrangement and interface chaos testing can be done in one step. , It’s really cool, I’m really worried that the system will hang up as soon as I start it, first take the POC of the plan I told me, I was really worried before, Xiao T is just a noob, follow the official DEMO POC for a few minutes It's over, don't believe me, take a look at the POC process.

Step1: Define each interface in the interface scene

I heard that it is possible to record, but it’s a pity that Little T still doesn’t know how to use it. First, manually add the login interface and other related interfaces in the POC scene.

step2: Set the login interface assertion

Little T thinks that the drag-and-drop way to set assertions is quite cool, of course, advanced players can also implement it by their own code.

step3: Arranging business scenarios

The drag-and-drop arrangement interface is a business scenario, so it’s really not too cool! (Little T is dizzy)

step4: Set business scenario flow conditions

It is really like a workflow. Double-click the connection between the interfaces to set the flow conditions, and the response result of the previous interface will be parsed into a tree structure. Drag the nodes on the tree structure, as shown in the following figure:

Step5: Set up all the flow logic

step6: The following is the most amazing function, which automatically derives the dependency topology between interfaces

step7: Configure chaos rules and apply them in the scene

Codes can be configured with any number of chaotic rules. Small T assumes that the parameter of an interface in the scene is M, and N chaotic rules are configured . Which is a and the other is B), assuming that there are X interfaces in the scene, the total number of executions is the Higg code M+C ab * P aa

step8: Run the scene to view the call chain

step9: Check the call status and chaos log

View a normal execution.

(Fortunately, the system did not hang up here, and it ran more than 1800 times in more than 30 seconds)

Little T finally summed up:

If you do reverse testing in business scenarios, you don’t need to manually execute them one by one. It is also difficult to do data-driven operations in a manual exhaustive way. If the parameters are complex, data-driven files are not easy to configure. So Codes took another approach, configure reverse rules and corresponding values, arrange and combine all the interfaces in the scene together, and finally arrange and combine to replace the normal parameters for testing. Not to mention that we have an internal MIS system, and we ran more than 3,000 combinations at a time. Haha, the system was down, and I greeted the boss proudly.

Wechat has opened up to 10,000 friends, friends can add me, first come, first served; you need to briefly introduce yourself or the circle of friends is open on a peer-to-peer basis. If none of the items are satisfied, refuse to provide friend slots. If you need to add test codes discussion group, please note codes.

Finally:  The complete software testing video learning tutorial below has been sorted out and uploaded, and friends can get it for free if they need it【保证100%免费】

insert image description here

 These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too!

软件测试技术交流群社:786229024(里面还有工作内推机会,毕竟我们是关系社会。)

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

How to obtain interview documents:

Guess you like

Origin blog.csdn.net/wx17343624830/article/details/130128327