Interface test case generation method and device
Through node attribute configuration documents and robot process scripts combined with machine learning algorithms, requests and verification packets for intelligent robots' multi-round session interfaces are generated, which solves the problem of low manual writing efficiency, and achieves more efficient and accurate test case generation, improving the Test coverage.
Patent Information
- Application Number
- CN202110902080.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-06
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-08-06
AI Technical Summary
In multi-round session testing of intelligent robots, the existing technology requires manual writing of interface request messages and verification messages covering the entire process, resulting in low writing efficiency and many repetitive tasks, making it difficult to quickly and comprehensively test the robot functions.
Through node attribute configuration documents and robot process scripts, combined with machine learning algorithms and model corpus, interface request messages and verification messages for each branch of the entire process are generated, jump conditions are automatically identified and test verification points are generated, and the generation of test cases is improved. Efficiency and accuracy.
It greatly improves the writing efficiency and accuracy of the full process test cases of multiple rounds of conversations, reduces the time for manual writing and verification, and achieves more comprehensive scenario coverage.
Smart Images

Figure CN113609017B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing and can also be used in the financial field, and specifically relates to a method and device for generating interface test cases. Background Art
[0002] In today's era of big data and artificial intelligence, the business scenarios of using intelligent robots to replace human customer service are constantly expanding. The main function of intelligent robots is to realize multi-round conversations with users. Therefore, in the process of developing intelligent robots, how to quickly and comprehensively test the multi-round conversation function of robots and improve research and development efficiency is of great significance. Intelligent robots mainly interact by calling interface services. Before starting the test, testers need to prepare interface request messages covering the entire process of business scenarios and verification messages for verifying the results returned by the interface. The test process is to use self-developed test tools to simulate the upstream application sending multi-round conversation request messages to call the intelligent robot interface, and verify the field values in the return message, and finally obtain a test report summarizing all intelligent robot scenarios.
[0003] At present, the interface request messages and verification messages of multiple rounds of conversations require testers to manually write complete messages covering all branches of the entire process. Since a complete message involves many parameters, usually ranging from 15 to 30, there is a lot of repetitive work and manual operations and verification work, and the writing efficiency is low. Summary of the invention
[0004] In response to the problems in the prior art, the present application provides an interface test case generation method and device, which can effectively improve the generation efficiency and accuracy of request messages and verification messages in multi-round dialogue full-process interface test cases, and improve the multi-round conversation process testing efficiency and full coverage of scenarios.
[0005] In order to solve at least one of the above problems, the present application provides the following technical solutions:
[0006] In a first aspect, the present application provides an interface test case generation method, comprising:
[0007] Generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and splice the request message set for multi-round conversation interface test of each branch through the input parameter set of each branch of the whole process and the preset robot process script;
[0008] Call a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expand the test verification points corresponding to the request message set based on the interface return message set and a preset model corpus to obtain an updated verification message set.
[0009] Furthermore, before generating the input parameter set of each branch of the whole process according to the branch jump condition, condition combination coverage test rule and boundary value test rule configured in the node attribute configuration document, it also includes:
[0010] A comparison and verification is performed according to the node attribute configuration document and the robot process script, and a verification error message is returned when the comparison and verification fails.
[0011] Further, the test verification points corresponding to the request message set are expanded according to the interface return message set and the preset model corpus to obtain an updated verification message set, including:
[0012] Identify the jump conditions of each branch in the request message set according to the interface return message set;
[0013] New test verification points are generated according to the jump conditions of each branch and the user's commonly used corpus in the preset model corpus, and the verification message set corresponding to the request message set is updated according to the new test verification points.
[0014] Further, after calling the multi-round conversation interface corresponding to the request message set to obtain the interface return message set, it also includes:
[0015] Extracting the check field in the message set returned by the interface to obtain a target check field;
[0016] Invalid check fields in the check message set corresponding to the request message set are removed according to the target check field to obtain an updated check message set.
[0017] In a second aspect, the present application provides an interface test case generation device, comprising:
[0018] The request message set determination module is used to generate the input parameter set of each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and splice the request message set of each branch of the whole process through the input parameter set of each branch of the whole process and the preset robot process script to obtain the multi-round conversation interface test of each branch;
[0019] The verification message set determination module is used to call the multi-round conversation interface corresponding to the request message set to obtain the interface return message set, and expand the test verification points corresponding to the request message set according to the interface return message set and the preset model corpus to obtain an updated verification message set.
[0020] Furthermore, the request message set determination module includes:
[0021] The process verification unit is used to compare and verify the node attribute configuration document and the robot process script, and return a verification error message when the comparison and verification fails.
[0022] Furthermore, the verification message set determination module includes:
[0023] A message parsing unit, used for identifying the jump conditions of each branch in the request message set according to the interface return message set;
[0024] The verification updating unit is used to generate new test verification points according to the jump conditions of each branch and the user's commonly used corpus in the preset model corpus, and update the verification message set corresponding to the request message set according to the new test verification points.
[0025] Furthermore, the verification message set determination module includes:
[0026] A field extraction unit, used for extracting the check field in the message set returned by the interface to obtain a target check field;
[0027] The invalid removal unit is used to remove the invalid check fields in the check message set corresponding to the request message set according to the target check field to obtain an updated check message set.
[0028] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the interface test case generation method when executing the program.
[0029] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the interface test case generation method when executed by a processor.
[0030] It can be seen from the above technical solution that the present application provides an interface test case generation method and device. Through the robot process script and the node attribute configuration document in the requirement design, combined with the machine learning algorithm and model corpus, it can batch complete the multi-round conversation interface request messages and verification messages of each branch of the whole process, saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of the full process test cases of multiple rounds of conversations. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 This is one of the flow charts of the method for generating interface test cases in the embodiment of the present application;
[0033] Figure 2 This is a second flow chart of the method for generating interface test cases in an embodiment of the present application;
[0034] Figure 3 The third flowchart of the method for generating interface test cases in the embodiment of the present application;
[0035] Figure 4 This is one of the structural diagrams of the interface test case generation device in the embodiment of the present application;
[0036] Figure 5 This is the second structural diagram of the interface test case generating device in the embodiment of the present application;
[0037] Figure 6 This is the third structural diagram of the interface test case generation device in the embodiment of the present application;
[0038] Figure 7 This is the fourth structural diagram of the interface test case generating device in the embodiment of the present application;
[0039] Figure 8 A structural diagram of an interface test case generating device in a specific embodiment of the present application;
[0040] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] Taking into account the interface request messages and verification messages of multiple rounds of conversations in the prior art, testers are required to manually write complete messages covering all branches of the entire process. Since a complete message involves many parameters, usually ranging from 15 to 30, there are many repetitive tasks and manual operations and verification tasks, and the writing efficiency is low. The present application provides an interface test case generation method and device, which can complete the interface request messages and verification messages of multiple rounds of conversations in each branch of the entire process in batches through robot process scripts and node attribute configuration documents in requirement design, combined with machine learning algorithms and model corpora, thereby saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of test cases for the entire process of multiple rounds of conversations.
[0043] In order to effectively improve the generation efficiency and accuracy of request messages and verification messages in multi-round dialogue full-process interface test cases, and improve the multi-round conversation process test efficiency and full coverage of scenarios, the present application provides an embodiment of an interface test case generation method, see Figure 1 , the interface test case generation method specifically includes the following contents:
[0044] Step S101: Generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and obtain a request message set for multiple rounds of conversation interface testing of each branch through the input parameter set of each branch of the whole process and the preset robot process script.
[0045] Optionally, the present application can automatically generate test cases for each branch of the entire process based on the jump conditions configured on each branch of the process, combined with the test method of condition combination coverage (making all possible combinations of each judgment condition result appear at least once) and boundary value testing, to ensure that the condition combination on each branch is covered at least once.
[0046] Optionally, the present application can batch generate full-process multi-round conversation interface request messages. Through the input parameter set of each branch of the full process, combined with the robot process script, batch splicing generates complete multi-round conversation interface test request messages covering each branch of the full process.
[0047] The request message refers to a group of multi-round test messages that satisfy a branch flow in the process.
[0048] Step S102: calling a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expanding the test verification points corresponding to the request message set according to the interface return message set and a preset model corpus to obtain an updated verification message set.
[0049] Optionally, the present application can automatically identify the branch jump conditions in the case based on the generated interface return message, and automatically expand and generate new test verification points in combination with the user's commonly used corpus in the model corpus. The expanded test verification points will automatically generate request messages and interface calls again to generate new request message sets and return message sets, and repeat this cycle until there are no more new verification points in the machine learning.
[0050] From the above description, it can be seen that the interface test case generation method provided in the embodiment of the present application can complete the multi-round conversation interface request messages and verification messages of each branch of the whole process in batches through the robot process script and the node attribute configuration document in the requirement design, combined with the machine learning algorithm and model corpus, thereby saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of the full process test cases of multiple rounds of conversations.
[0051] In order to accurately perform process verification, in an embodiment of the interface test case generation method of the present application, before the above step S101, the following contents may be specifically included:
[0052] A comparison and verification is performed according to the node attribute configuration document and the robot process script, and a verification error message is returned when the comparison and verification fails.
[0053] Optionally, this application can check the multi-round conversation process configuration of the intelligent robot by comparing the node attribute configuration document in the business requirement design document with the robot process script exported by the system, batch verify the correctness and completeness of the node attributes, model configuration, and process logic of the entire process, and record the verification results.
[0054] The node refers to a link in a multi-round conversation process that completes a certain function, which may be intent recognition, element extraction, or obtaining a certain business parameter.
[0055] In order to accurately obtain the verification message set, in one embodiment of the interface test case generation method of the present application, see Figure 2 , the above step S102 may also specifically include the following contents:
[0056] Step S201: Identify the jump conditions of each branch in the request message set according to the interface return message set.
[0057] Step S202: Generate a new test verification point according to the jump conditions of each branch and the user's commonly used corpus in the preset model corpus, and update the verification message set corresponding to the request message set according to the new test verification point.
[0058] Optionally, the present application may simulate the calling method supported by the interface service and obtain the interface return message according to the interface request message.
[0059] The interface service refers to an access service provided by the system to the outside world. The caller can obtain information in a manner specified by the service provider, such as the REST method, WebService method, etc.
[0060] In order to accurately obtain the verification message set, in one embodiment of the interface test case generation method of the present application, see Figure 3 , the above step S102 may also specifically include the following contents:
[0061] Step S301: extracting the check field in the message set returned by the interface to obtain a target check field.
[0062] Step S302: removing invalid check fields in the check message set corresponding to the request message set according to the target check field, to obtain an updated check message set.
[0063] Optionally, the present application can extract fields in the interface return message, extract preset verification fields from the complete interface return message, remove unnecessary verification fields, and generate a complete set of multi-round conversation interface test verification messages covering all branches of the entire process.
[0064] The verification message refers to a group of multiple rounds of test messages used to verify the correctness of each field in the interface return message.
[0065] The field refers to the Key value of each key-value pair in the message format.
[0066] In order to effectively improve the generation efficiency and accuracy of request messages and verification messages in multi-round dialogue full-process interface test cases, and improve the multi-round conversation process test efficiency and full coverage of scenarios, the present application provides an embodiment of an interface test case generation device for implementing all or part of the content of the interface test case generation method, see Figure 4 , the interface test case generation device specifically includes the following contents:
[0067] The request message set determination module 10 is used to generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and to obtain a request message set for multiple rounds of conversation interface testing of each branch through the input parameter set of each branch of the whole process and the preset robot process script.
[0068] The verification message set determination module 20 is used to call the multi-round conversation interface corresponding to the request message set, obtain the interface return message set, and expand the test verification points corresponding to the request message set according to the interface return message set and the preset model corpus to obtain an updated verification message set.
[0069] From the above description, it can be seen that the interface test case generation device provided in the embodiment of the present application can complete the multi-round conversation interface request messages and verification messages of each branch of the whole process in batches through the robot process script and the node attribute configuration document in the requirement design, combined with the machine learning algorithm and model corpus, thereby saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of the full process test cases of multiple rounds of conversations.
[0070] In order to accurately perform process verification, in one embodiment of the interface test case generation device of the present application, see Figure 5 , the request message set determination module 10 includes:
[0071] The process verification unit 11 is used to perform a comparison verification based on the node attribute configuration document and the robot process script, and return a verification error message when the comparison verification fails.
[0072] In order to accurately obtain the verification message set, in one embodiment of the interface test case generation device of the present application, see Figure 6 , the verification message set determination module 20 includes:
[0073] The message parsing unit 21 is used to identify the jump conditions of each branch in the request message set according to the interface return message set.
[0074] The verification updating unit 22 is used to generate a new test verification point according to the jump conditions of each branch and the user's common corpus in the preset model corpus, and update the verification message set corresponding to the request message set according to the new test verification point.
[0075] In order to accurately obtain the verification message set, in one embodiment of the interface test case generation device of the present application, see Figure 7 , the verification message set determination module 20 includes:
[0076] The field extraction unit 23 is used to extract the check field in the interface return message set to obtain a target check field.
[0077] The invalid removing unit 24 is used to remove the invalid check fields in the check message set corresponding to the request message set according to the target check field to obtain an updated check message set.
[0078] In order to further illustrate the present solution, the present application also provides a specific application example of using the above-mentioned interface test case generation device to implement the interface test case generation method, see Figure 8 , specifically including the following contents:
[0079] Process verification unit 101, verification point generation unit 102, automatic request message generation unit 103, interface call unit 104, machine learning unit 105, automatic verification message generation unit 106, robot process script 201, node attribute configuration document 202, process verification result 203, test verification point set 204, request message set 205, return message set 206, verification message set 207, model corpus 208.
[0080] The connection relationship between them is that the process verification unit 101 is connected to the automatic generation of request message unit 103, the robot process script 201 and the node attribute configuration document 202 are passed into the process verification unit 101, and the generated process verification result 203 is passed into the verification point generation unit 102 to generate a test verification point set 204; the verification point generation unit 102 is connected to the automatic generation of request message unit 103, the test verification point set 204 is passed into the automatic generation of request message unit 103 to generate a request message set 205; the automatic generation of request message unit 103 is connected to the interface call The interface calling unit 104 is connected to the machine learning unit 105, and the request message set 205 is passed into the interface calling unit 104 to generate a return message set 206; the interface calling unit 104 is connected to the machine learning unit 105, and the return message set 206 and the model corpus 208 are passed into the machine learning unit 105, and the generated extended verification points are added to the test verification point set 204; the machine learning unit 105 is connected to the automatic generation of verification message unit 106, until no new extended test verification points are added after machine learning, then it enters the automatic generation of verification message unit 106 to generate a verification message set 207.
[0081] The process verification unit 101 is responsible for checking the configuration of the multi-round conversation process of the intelligent robot. By comparing the node attribute configuration document in the business requirement design document with the robot process script exported by the system, the correctness and integrity of the node attributes, model configuration, and process logic of the whole process are batch verified, and the verification results are recorded. The node refers to a link in the multi-round conversation process that completes a certain function, which can be intent recognition, element extraction, or obtaining a certain business parameter.
[0082] Verification point generation unit 102 is responsible for batch generation of test verification points for each branch of the whole process. According to the jump conditions configured on each branch of the process, combined with the test method of condition combination coverage (making all possible combinations of each judgment condition result appear at least once) and boundary value testing, the algorithm automatically generates test cases for each branch of the whole process to ensure that the condition combination on each branch is covered at least once.
[0083] The automatic request message generation unit 103 is responsible for batch generation of full-process multi-round conversation interface request messages. The verification points generated by the verification point generation unit 102 are combined with the robot process script to batch splice and generate complete multi-round conversation interface test request messages covering all branches of the full process. The request message refers to a group of multi-round test messages that meet the flow of a branch in the process.
[0084] The interface calling unit 104 is responsible for simulating the calling method supported by the interface service and obtaining the interface return message according to the interface request message. The interface service refers to an access service provided by the system to the outside world. The caller can obtain information in the manner specified by the service provider, such as the REST method, WebService method, etc.
[0085] The machine learning unit 105 automatically identifies the branch jump conditions in the case based on the generated interface return message set 206, and automatically expands and generates new test verification points in combination with the user common corpus in the model corpus 208. The expanded test verification points enter the automatic request message generation unit and the interface call unit again to generate a new request message set and a return message set. This cycle continues until there are no more new verification points in the machine learning unit.
[0086] The automatic verification message generation unit 106 is responsible for extracting the fields in the interface return message, extracting the preset verification fields from the complete interface return message, removing the unnecessary verification fields, and generating a complete set of multi-round session interface test verification messages covering all branches of the whole process. The verification message refers to a set of multi-round test messages used to verify the correctness of each field in the interface return message. The field refers to the key value of each key-value pair in the message format.
[0087] In another embodiment of the present application, the present application also provides a method for automatically generating a multi-round conversation test case, the specific steps of which are:
[0088] Step 1: Multi-round conversation process configuration, including configuration of each node and branch jump conditions, etc.
[0089] The node refers to a link in a multi-round conversation process that completes a certain function, which may be intent recognition, element extraction, or obtaining a certain business parameter.
[0090] The branch jump condition refers to the condition that needs to be met to jump from one node to another node.
[0091] Step 2: Export the process script. Export the complete process script file from the system.
[0092] Step 3: The node attribute configuration document refers to the node attribute information obtained in the business requirements design.
[0093] Step 4: Process configuration verification, by comparing the robot process script and the node attribute configuration document, batch verify the correctness and integrity of the node attributes, model configuration, and process logic of the entire process, and record the verification results, and output the specific error details for errors. If the verification passes, continue to step 6; if the verification fails, re-execute step 1.
[0094] Step 5: Automatically generate a set of input parameters for each branch of the entire process. Based on the jump conditions configured in the process, combined with test methods such as condition combination coverage and boundary values, the algorithm automatically generates a set of test verification points for each branch of the entire process. The verification point refers to a set of input parameters designed according to the business scenario. A process branch contains a set of input parameters. The verification points need to cover all branches of the entire process so that all possible combinations of each judgment condition result appear at least once.
[0095] Step 6: Automatically splice and output a complete set of multi-round conversation interface request messages covering the entire process.
[0096] Step 7: Call the multi-round conversation interface to generate an interface return message set.
[0097] Step 8: Combine the generated interface return message and scenario corpus, and gradually expand the test verification point set through self-learning until there are no new verification points after machine learning.
[0098] Step 9: Verify the integrity of the interface field according to the preset interface verification field, and automatically generate a verification message.
[0099] From the above description, it can be seen that this application can complete the multi-round conversation interface request messages and verification messages of each branch of the whole process in batches through robot process scripts, node attribute configuration documents in requirement design combined with machine learning algorithms and model corpora, saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of multi-round conversation full-process test cases.
[0100] From the hardware level, in order to effectively improve the generation efficiency and accuracy of request messages and verification messages in the multi-round dialogue full-process interface test case, and improve the multi-round conversation process test efficiency and full coverage of scenarios, the present application provides an embodiment of an electronic device for implementing all or part of the content in the interface test case generation method, and the electronic device specifically includes the following content:
[0101] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the interface test case generation device and related devices such as the core business system, user terminal and related database; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the interface test case generation method and the embodiment of the interface test case generation device in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0102] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0103] In practical applications, part of the interface test case generation method can be executed on the electronic device side as described above, or all operations can be completed in the client device. The selection can be made based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0104] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0105] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0106] In one embodiment, the interface test case generation method function may be integrated into the central processing unit 9100 .
[0107] The CPU 9100 may be configured to perform the following control:
[0108] Step S101: Generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and obtain a request message set for multiple rounds of conversation interface testing of each branch through the input parameter set of each branch of the whole process and the preset robot process script.
[0109] Step S102: calling a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expanding the test verification points corresponding to the request message set according to the interface return message set and a preset model corpus to obtain an updated verification message set.
[0110] From the above description, it can be seen that the electronic device provided in the embodiment of the present application can complete the multi-round conversation interface request messages and verification messages of each branch of the whole process in batches through the robot process script and the node attribute configuration document in the requirement design, combined with the machine learning algorithm and model corpus, thereby saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of the full process test cases of multiple rounds of conversations.
[0111] In another embodiment, the interface test case generation device may be configured separately from the central processing unit 9100. For example, the interface test case generation device may be configured as a chip connected to the central processing unit 9100, and the interface test case generation method function may be implemented under the control of the central processing unit.
[0112] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module (transmitter / receiver) 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0113] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0114] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0115] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0116] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0117] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0118] The communication module (transmitter / receiver) 9110 is a communication module (transmitter / receiver) 9110 that sends and receives signals via the antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0119] Based on different communication technologies, multiple communication modules (transmitters / receivers) 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0120] The embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps in the method for generating an interface test case in the above embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps in the method for generating an interface test case in the above embodiment, where the execution subject is a server or a client, are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0121] Step S101: Generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and obtain a request message set for multiple rounds of conversation interface testing of each branch through the input parameter set of each branch of the whole process and the preset robot process script.
[0122] Step S102: calling a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expanding the test verification points corresponding to the request message set according to the interface return message set and a preset model corpus to obtain an updated verification message set.
[0123] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application can complete the multi-round conversation interface request messages and verification messages of each branch of the whole process in batches through the robot process script and the node attribute configuration document in the requirement design, combined with the machine learning algorithm and model corpus, thereby saving the time of manual writing and verification, and improving the writing efficiency, accuracy and coverage of the full process test cases of multiple rounds of conversations.
[0124] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0125] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0128] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for generating an interface test case, characterized in that: The method comprises: Generate an input parameter set for each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and splice the request message set for multi-round conversation interface test of each branch through the input parameter set of each branch of the whole process and the preset robot process script; Calling a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expanding the test verification points corresponding to the request message set according to the interface return message set and a preset model corpus to obtain an updated verification message set; The method of expanding the test verification points corresponding to the request message set according to the interface return message set and the preset model corpus to obtain an updated verification message set includes: Identify the jump conditions of each branch in the request message set according to the interface return message set; New test verification points are generated according to the jump conditions of each branch and the user's commonly used corpus in the preset model corpus, and the verification message set corresponding to the request message set is updated according to the new test verification points.
2. The interface test case generation method according to claim 1, characterized in that: Before generating the input parameter set of each branch of the whole process according to the branch jump condition, condition combination coverage test rule and boundary value test rule configured in the node attribute configuration document, the following is also included: A comparison and verification is performed according to the node attribute configuration document and the robot process script, and a verification error message is returned when the comparison and verification fails.
3. The interface test case generation method according to claim 1, characterized in that: After the calling of the multi-round conversation interface corresponding to the request message set to obtain the interface return message set, the method further includes: Extracting the check field in the message set returned by the interface to obtain a target check field; Invalid check fields in the check message set corresponding to the request message set are removed according to the target check field to obtain an updated check message set.
4. An interface test case generation device, characterized in that: include: The request message set determination module is used to generate the input parameter set of each branch of the whole process according to the branch jump conditions, condition combination coverage test rules and boundary value test rules configured in the node attribute configuration document, and splice the request message set of each branch of the whole process through the input parameter set of each branch of the whole process and the preset robot process script to obtain the multi-round conversation interface test of each branch; A verification message set determination module, used to call a multi-round conversation interface corresponding to the request message set to obtain an interface return message set, and expand the test verification points corresponding to the request message set according to the interface return message set and a preset model corpus to obtain an updated verification message set; Wherein, the verification message set determination module includes: A message parsing unit, used for identifying the jump conditions of each branch in the request message set according to the interface return message set; The verification updating unit is used to generate new test verification points according to the jump conditions of each branch and the user's commonly used corpus in the preset model corpus, and update the verification message set corresponding to the request message set according to the new test verification points.
5. The interface test case generating device according to claim 4, characterized in that: The request message set determination module comprises: The process verification unit is used to compare and verify the node attribute configuration document and the robot process script, and return a verification error message when the comparison and verification fails.
6. The interface test case generating device according to claim 4, characterized in that: The verification message set determination module comprises: A field extraction unit, used for extracting the check field in the message set returned by the interface to obtain a target check field; The invalid removal unit is used to remove the invalid check fields in the check message set corresponding to the request message set according to the target check field to obtain an updated check message set.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the interface test case generation method described in any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the interface test case generation method described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Interface verification method and device
CN111478969A
Multi-round session system testing method and device
CN111708693A
Request message generation method and interface test method
CN111858376A
KR20210039997A
