Test case generation method and related device

By analyzing the node hierarchical relationship of the test mind map to generate test cases, and using the AI ​​model to automatically generate and optimize inputs, the problem of low test case generation efficiency in existing technologies is solved, and efficient automatic generation and integration of test cases are achieved.

CN120653573APending Publication Date: 2025-09-16创优数字科技(广东)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510966693.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing test case generation methods rely on manual operations, which are inefficient and difficult to retain the correlation between model output and original requirements, resulting in insufficient software testing efficiency.

Method used

By parsing the node hierarchical relationship of the test mind map, the complete path information is obtained and used as input to call the pre-trained AI model to generate initial test cases. The model input is optimized through sorting and grouping to achieve automatic generation and integration of test cases.

Benefits of technology

It realizes the automatic generation and integration of test cases, reduces manual participation, and improves software testing efficiency and the relevance of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653573A_ABST
    Figure CN120653573A_ABST
Patent Text Reader

Abstract

The invention provides a test case generation method and a related device, which can analyze a node hierarchical relationship of a test mind map and obtain complete path information corresponding to each leaf node, and the complete path information retains father-child node relevance. According to the method, the complete path information of each leaf node is used as model input, the pre-trained AI model is called, and the target test case is obtained based on the result returned by the AI model. Therefore, on one hand, the test case can be automatically generated by utilizing the AI model, and on the other hand, the test case output by the AI model can be associated with the complete path information, so that the relevance between the model output result and the original test item can be reserved, and the model output result can be directly integrated into the test process. Therefore, the automatic generation and the automatic integration of the test case can be realized, and manual program participation is greatly reduced, so that the software test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a test case generation method and related devices. Background Art

[0002] To verify the correctness of software functionality and identify potential risks, comprehensive software testing using test cases is essential. By verifying that the software's performance in both normal and edge scenarios meets expectations, functional defects can be discovered promptly, thereby improving user experience and reducing the incidence of failures after the program is launched.

[0003] Currently, test case generation relies heavily on manual labor. During the test case generation process, engineers need to manually analyze requirement documents, construct test mind maps based on these documents, and then design test cases based on these mind maps. This completely manual approach is inefficient and can easily lead to the omission of edge cases.

[0004] To address the above issues, some technical solutions have proposed using AI (Artificial Intelligence) models to generate test cases. This method inputs the test mind map into the AI ​​model, which automatically generates test cases and provides feedback. Compared with methods that rely entirely on manual test case generation, this solution reduces manual intervention to a certain extent, thereby improving the efficiency of test case generation. However, the test cases generated by the AI ​​model in this solution lack correlation with the original requirements, making it difficult to directly integrate the model's output results into the test process. Therefore, although the AI ​​model can provide test cases, engineers still need to perform manual integration, which makes this method still limited in efficiency.

[0005] It can be seen that the existing test case generation scheme has the problem of high degree of manual participation, which reduces the testing efficiency of the software. Summary of the Invention

[0006] The purpose of this application is to solve at least one of the above technical deficiencies, especially the technical defect of low software testing efficiency in the prior art.

[0007] In a first aspect, an embodiment of the present application provides a test case generation method, comprising:

[0008] Obtaining a test mind map, wherein the test mind map is used to describe at least one functional module to be tested and test items required for each functional module to be tested;

[0009] Parsing the node hierarchical relationship of the test mind map and obtaining the complete path information corresponding to each leaf node in the test mind map;

[0010] Using each of the complete path information as a model input, calling a pre-trained AI model, and obtaining an initial test case returned by the AI ​​model;

[0011] A target test case is obtained according to each of the initial test cases.

[0012] In some embodiments, the calling of a pre-trained AI model using each of the complete path information as a model input includes:

[0013] Determine whether the total number of characters in each of the complete path information exceeds the maximum input character number of the AI ​​model;

[0014] If so, sorting each of the complete path information according to a preset sorting rule, and obtaining an arrangement order corresponding to each of the complete path information; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order;

[0015] According to each of the arrangement orders, each of the complete path information is used as the model input in turn to call the AI ​​model.

[0016] In some embodiments, calling the AI ​​model using each of the complete path information as a model input in sequence according to each of the arrangement orders includes:

[0017] Grouping the complete path information according to the maximum number of input characters to obtain a plurality of groups; wherein each complete path information belongs to a group, and at least one group includes a plurality of complete path information, and the complete path information in the same group corresponds to the same functional module to be tested;

[0018] Determining the execution order corresponding to each of the groups according to the respective arrangement orders;

[0019] According to the execution order corresponding to each of the groups, the AI ​​model is called in sequence using the complete path information included in each of the groups as model input.

[0020] In some embodiments, calling the AI ​​model using each of the complete path information as a model input in sequence according to each of the arrangement orders includes:

[0021] According to each of the arrangement orders, sequentially determine the M target path information of the current round in each of the complete path information; wherein M is a preset concurrency number and is a positive integer greater than 1;

[0022] Each of the M target path information is used as a model input, and the AI ​​model is called concurrently.

[0023] In some embodiments, obtaining a target test case according to each of the initial test cases further includes:

[0024] If the total number of characters exceeds the maximum number of input characters, deduplication and conflict detection are performed on each of the initial test cases returned by the AI ​​model to obtain the target test case.

[0025] In some embodiments, the calling of a pre-trained AI model using each of the complete path information as a model input includes:

[0026] If the total number of characters in each of the complete path information is less than or equal to the maximum number of input characters of the AI ​​model, all of the complete path information is used as model input to call the AI ​​model.

[0027] In a second aspect, an embodiment of the present application provides a test case generation device, comprising:

[0028] A mind map acquisition module is used to acquire a test mind map, wherein the test mind map is used to describe at least one functional module to be tested and the test items required for each functional module to be tested;

[0029] A hierarchical parsing module is used to parse the hierarchical relationship of the nodes in the test mind map and obtain the complete path information corresponding to each leaf node in the test mind map;

[0030] A model calling module, configured to use each of the complete path information as a model input, call a pre-trained AI model, and obtain an initial test case returned by the AI ​​model;

[0031] The use case acquisition module is used to obtain target test cases according to each of the initial test cases.

[0032] In some embodiments, the model calling module includes:

[0033] A judging unit, configured to judge whether the total number of characters in each of the complete path information exceeds the maximum number of input characters of the AI ​​model;

[0034] a sorting unit, configured to sort each of the complete path information according to a preset sorting rule and obtain an arrangement order corresponding to each of the complete path information when the total number of characters exceeds the maximum number of input characters; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order;

[0035] The first calling unit is used to call the AI ​​model according to each of the arrangement orders and using each of the complete path information as the model input.

[0036] In a third aspect, an embodiment of the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the test case generation method described in any of the above embodiments.

[0037] In a fourth aspect, an embodiment of the present application provides a computer device, the computer device comprising: one or more processors, and a memory;

[0038] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the test case generation method described in any of the above embodiments are executed.

[0039] In the test case generation method and related devices provided in some embodiments of the present application, the node hierarchical relationship of the test mind map can be parsed, and the complete path information corresponding to each leaf node can be obtained. Since the test mind map describes at least one functional module to be tested and the test items required for each functional module to be tested, and the functional module to be tested and the test items are both represented as nodes in the test mind map, the present application can automatically map the hierarchical relationship of the test mind map into structured complete path information that retains the association between parent and child nodes through node hierarchical relationship analysis.

[0040] This application uses the complete path information of each leaf node as the model input, calls the pre-trained AI model, and obtains the target test case based on the results returned by the AI ​​model. In this way, on the one hand, the AI ​​model can be used to automatically generate test cases, and on the other hand, the test cases output by the AI ​​model can be associated with the complete path information, thereby retaining the correlation between the model output results and the original test items, and then the model output results can be directly integrated into the test process. It can be seen that this application can realize the automatic generation and automatic integration of test cases, greatly reducing the manual participation program, thereby improving the testing efficiency of the software. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only 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 labor.

[0042] Figure 1A flowchart of a test case generation method in some embodiments;

[0043] Figure 2 A schematic diagram of a test mind map in some embodiments;

[0044] Figure 3 A schematic structural diagram of a test case generating device in some embodiments;

[0045] Figure 4 This is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0047] In some embodiments, this application provides a test case generation method. The following embodiments illustrate this method using a computer device as an example. It is understood that the computer device described in this application refers to a device with data processing capabilities, which may include, but is not limited to, various personal computers, notebook computers, laptop computers, tablet computers, smartphones, Internet of Things devices, and portable wearable devices. Among them, Internet of Things devices may include smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices may include smart watches, smart bracelets, head-mounted devices, etc.

[0048] like Figure 1 As shown, the test case generation method provided in this application may specifically include the following steps:

[0049] S102: Acquire a test mind map, where the test mind map is used to describe at least one functional module to be tested and test items required for each functional module to be tested.

[0050] Specifically, in the test mind map, the function modules to be tested and the test items required for each function module to be tested are displayed in the form of nodes. The test mind map records at least one function module to be tested and the test items required for each function module to be tested in the form of a hierarchical structure. For example, Figure 2 In the test mind map shown, the functional modules to be tested include a login module and a product ordering module. The login module requires tests such as username input and user information verification, and the username input requires a null value check test. The login module, product ordering module, username input test, user information verification test, and null value check test are all nodes in the test mind map.

[0051] It is understood that the test mind map involved in this application can be a file in any format and can be pre-generated using any software tool, and this application does not impose specific restrictions on this. In some examples, the test mind map can be a mind map generated using the XMind tool or the Freemind tool.

[0052] S104: Parse the node hierarchical relationship of the test mind map and obtain the complete path information corresponding to each leaf node in the test mind map.

[0053] Among them, a leaf node refers to a node that does not have child nodes, and the full path information of the leaf node is used to describe the complete path from the root node to the leaf node. The computer device can parse the node hierarchical relationship of the test mind map and convert each leaf node into a path text with a hierarchical identifier, thereby obtaining the complete path information of each leaf node. Since the complete path information records the complete path from the root node to the leaf node, the complete path information retains the correlation between the parent and child nodes, thereby reflecting the complete requirements of the test items, test objects, etc. In this way, the hierarchical relationship of the test mind map can be automatically mapped to structured complete path information that retains the correlation between the parent and child nodes.

[0054] For example, in Figure 2 In the test mind map shown, after parsing, the complete path information corresponding to the leaf node "null value check" is: software testing / login module / user name input / null value check.

[0055] It should be noted that the present application may adopt any method to implement the node hierarchical relationship analysis, and the present application does not impose any specific restrictions on this. For example, the computer device may recursively analyze the test mind map to obtain the complete path information corresponding to each leaf node.

[0056] S106: Using each complete path information as model input, calling the pre-trained AI model, and obtaining the initial test case returned by the AI ​​model.

[0057] In this step, the computer device can use the complete path information corresponding to each leaf node as prompt information (Prompt) input to the AI ​​model, and call the pre-trained AI model accordingly, so that the AI ​​model can automatically generate the corresponding initial test cases according to each complete path information, thereby realizing automatic generation of test cases.

[0058] It should be noted that this application can use any AI model to generate initial test cases. This application does not impose specific restrictions on model details such as AI model structure, model training process, and model fine-tuning process. It only requires that the AI ​​model can automatically generate test cases based on the received prompt information.

[0059] S108: Obtain target test cases based on each initial test case.

[0060] In this step, after obtaining the initial test cases returned by the AI ​​model, the computer device can derive target test cases for the final software testing based on the initial test cases. For example, the computer device can directly use the initial test cases as target test cases and integrate the target test cases into the software testing process to test the functional modules to be tested.

[0061] In this application, on the one hand, the AI ​​model can be used to automatically generate test cases. On the other hand, the test cases output by the AI ​​model can be associated with the complete path information, thereby preserving the correlation between the model output results and the original test items, and then the model output results can be directly integrated into the test process. As can be seen from this, this application can realize the automatic generation and automatic integration of test cases, greatly reducing the manual participation process, thereby improving the testing efficiency of the software.

[0062] In some embodiments, the pre-trained AI model is called with each complete path information as the model input, including:

[0063] Step A1: Determine whether the total number of characters in each complete path information exceeds the maximum input character number of the AI ​​model;

[0064] Step A3: If yes, sort each complete path information according to a preset sorting rule, and obtain the arrangement order corresponding to each complete path information; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order;

[0065] Step A5: According to the order of each arrangement, each complete path information is used as the model input and the AI ​​model is called.

[0066] In this embodiment, considering the AI ​​model's input length restrictions, the computer device dynamically and appropriately sorts each complete path information using a preset sorting rule. It then calls the AI ​​model using each complete path information as model input, sequentially following the sorting order. This ensures that core functional modules are prioritized, thereby improving testing efficiency.

[0067] Specifically, when calling the AI ​​model based on each complete path information, the first step is to determine whether the total number of characters in each complete path information exceeds the AI ​​model's maximum input character count. If so, this indicates that the AI ​​model cannot be called using all the complete path information as a single model input, and multiple model calls are required to generate initial test cases corresponding to each complete path information. In this case, the computer device can sort the complete path information according to the module attributes of the functional module to be tested to determine the order of arrangement corresponding to each complete path information.

[0068] The module attributes may include any one or any combination of node depth, preset function module priority, and preset function module execution order, and this application does not impose any specific restrictions on this. For example, when the preset sorting rule is to sort by node depth, this application may sort each complete path information in order of node depth from smallest to largest.

[0069] After sorting each complete path information, this application can call the AI ​​model in sequence based on the order of arrangement corresponding to each complete path information, thereby realizing batch request of the AI ​​model to generate initial test cases. It should be noted that in the process of requesting the AI ​​model in batches, the prompt information of the same batch may include one or more complete path information. This application does not impose specific restrictions on this. It only requires that the number of characters in the prompt information of each batch is less than the maximum input character number of the AI ​​model.

[0070] For example, if four complete path information is obtained from the test mind map, after sorting, the computer device can use the first complete path information as the model input to call the AI ​​model and obtain the initial test case corresponding to the first complete path information. Then, the computer device can use the second complete path information as the model input to call the AI ​​model and obtain the initial test case corresponding to the second complete path information. Similarly, the computer device can use the third and fourth complete path information as model inputs to call the AI ​​model.

[0071] For example, if four complete path information is obtained from the test mind map, after sorting, the computer device can use the first and second complete path information as model inputs to call the AI ​​model. Then, the computer device uses the third and fourth complete path information as model inputs to call the AI ​​model.

[0072] In some embodiments, according to each arrangement order, each complete path information is sequentially used as a model input to call the AI ​​model, including:

[0073] Step A51: Grouping each complete path information according to the maximum number of input characters to obtain a plurality of groups; wherein each complete path information belongs to a group, and at least one group includes multiple complete path information, and the complete path information in the same group corresponds to the same functional module to be tested;

[0074] Step A53: Determine the execution order corresponding to each group according to each arrangement order;

[0075] Step A55: According to the execution order corresponding to each group, the AI ​​model is called in sequence using the complete path information included in each group as the model input.

[0076] In this embodiment, when determining the model input information for each batch, the present application uses model boundaries rather than a fixed number of words as the basis for path grouping, thereby avoiding truncation of the complete path information and ensuring that each complete path information in each batch of model input information is a complete path information, rather than only including part of the complete path information, thereby maintaining semantic coherence. Furthermore, the present application can allocate the complete path information corresponding to the same functional module to be tested to the same group as much as possible, so that the model input information of the same batch can include the complete module semantics, thereby providing guarantees for the accurate understanding and processing of the AI ​​model, thereby improving the quality of test case generation.

[0077] Specifically, if the total number of characters in each complete path information exceeds the maximum number of input characters of the AI ​​model, the complete path information can be grouped according to the maximum number of input characters to obtain multiple groups, so that the total number of characters corresponding to each group is less than or equal to the maximum number of input characters of the AI ​​model. During the grouping process, each complete path information belongs to only one group to avoid repeatedly generating initial test cases corresponding to the same complete path information. In addition, at least one group includes multiple complete path information, and each complete path information in the same group corresponds to the same functional module to be tested.

[0078] For example, a computer device parses four complete paths from the test mind map. After sorting, the four complete paths are: login module / username input / null value check, login module / user information verification / SMS code verification, product order module / shopping cart verification / empty shopping cart verification, and product order module / payment verification / insufficient balance check. In this case, the application can group login module / username input / null value check and login module / user information verification / SMS code verification into the first group, and group product order module / shopping cart verification / empty shopping cart verification and product order module / payment verification / insufficient balance check into the second group.

[0079] Once the grouping is complete, the present application may determine the execution order for each group based on the order of the complete path information. For example, the present application may calculate the minimum order of each group and use this as the execution order for that group. For another example, the present application may calculate the average order of each group and use this as the execution order for that group.

[0080] After determining the execution order for each group, the computer device can invoke the AI ​​model in this order, using the complete path information included in each group as model input. For example, in the above example, the computer device can invoke the AI ​​model using the login module / username input / null value check and the login module / user information verification / SMS code verification as model inputs. Then, the AI ​​model can be invoked using the product order module / shopping cart verification / empty shopping cart check and the product order module / payment verification / insufficient balance check as model inputs.

[0081] In some embodiments, according to each arrangement order, each complete path information is sequentially used as a model input to call the AI ​​model, including:

[0082] According to each arrangement order, the M target path information of the current round is determined in each complete path information in sequence; where M is the preset concurrency number and is a positive integer greater than 1;

[0083] Each target path information in the M target path information is used as the model input and the AI ​​model is called concurrently.

[0084] In this embodiment, the computer device can concurrently send M target path information to the AI ​​model through the thread pool, thereby enabling concurrent calls to the AI ​​model. This can fully utilize computing resources and achieve asynchronous acquisition of initial test cases, thereby improving the efficiency of test case generation and reducing the time required for case generation. This application uses dynamic blocking and multi-threading technology to increase AI request efficiency by more than 60% and ensure the accuracy of test cases.

[0085] For example, when M=2, if four complete paths are extracted from the test mind map, the first and second complete paths can be used as target paths in the first round and used as model inputs to concurrently call the AI ​​model. In the second round, the third and fourth complete paths can be used as target paths and used as model inputs to concurrently call the AI ​​model.

[0086] In some embodiments, obtaining target test cases according to the initial test cases further includes:

[0087] If the total number of characters exceeds the maximum number of input characters, the initial test cases returned by the AI ​​model are deduplicated and conflict detected to obtain the target test cases.

[0088] In this embodiment, after invoking the AI ​​model in batches, the AI ​​model can return initial test cases corresponding to each complete path information in batches. In this case, the computer device can perform deduplication and conflict detection on all initial test cases returned by the AI ​​model to automatically filter out duplicate cases and obtain the target test cases.

[0089] Furthermore, after obtaining the target test case, the present application can compare the target test case with the original path information and mark the newly added nodes in the test mind map. For example, a node for login module / password input / special character verification can be added.

[0090] In some embodiments, the pre-trained AI model is called with each complete path information as the model input, including:

[0091] If the total number of characters in each complete path information is less than or equal to the maximum input character number of the AI ​​model, all the complete path information is used as the model input and the AI ​​model is called.

[0092] In this embodiment, if the AI ​​model's input character limit is met, the application can use the entire path information as the same prompt information to call the AI ​​model and obtain the initial test cases returned by the AI ​​model. This can not only ensure the AI ​​model's accurate understanding and processing, thereby improving the quality of test case generation, but also improve the efficiency of test case generation.

[0093] The test case generation device provided in an embodiment of the present application is described below. The test case generation device described below and the test case generation method described above can be referenced to each other.

[0094] In some embodiments, as Figure 3 As shown, the present application provides a test case generation device 300, comprising:

[0095] A mind map acquisition module 302 is used to acquire a test mind map, wherein the test mind map is used to describe at least one functional module to be tested and test items required for each functional module to be tested;

[0096] A hierarchical parsing module 304 is configured to parse the hierarchical relationship of the nodes in the test mind map and obtain complete path information corresponding to each leaf node in the test mind map;

[0097] A model calling module 306 is configured to use each of the complete path information as a model input, call a pre-trained AI model, and obtain an initial test case returned by the AI ​​model;

[0098] The use case acquisition module 308 is configured to obtain target test cases based on the initial test cases.

[0099] In some embodiments, the model calling module 306 of the present application includes:

[0100] A judging unit, configured to judge whether the total number of characters in each of the complete path information exceeds the maximum number of input characters of the AI ​​model;

[0101] a sorting unit, configured to sort each of the complete path information according to a preset sorting rule and obtain an arrangement order corresponding to each of the complete path information when the total number of characters exceeds the maximum number of input characters; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order;

[0102] The first calling unit is used to call the AI ​​model according to each of the arrangement orders and using each of the complete path information as the model input.

[0103] In some embodiments, the first calling unit of the present application includes:

[0104] a grouping unit, configured to group the complete path information according to the maximum number of input characters to obtain a plurality of groups; wherein each complete path information belongs to a group, and at least one group includes a plurality of complete path information, and the complete path information in the same group corresponds to the same functional module to be tested;

[0105] an execution order determining unit, configured to determine an execution order corresponding to each of the groups according to the arrangement orders;

[0106] The group calling unit is used to call the AI ​​model in accordance with the execution order corresponding to each group, using the complete path information included in each group as the model input.

[0107] In some embodiments, the first calling unit of the present application includes:

[0108] The target information determining unit determines, in accordance with each of the arrangement orders, the M target path information of the current round in each of the complete path information; wherein M is a preset concurrency number and is a positive integer greater than 1;

[0109] A concurrent calling unit is used to concurrently call the AI ​​model using each of the M target path information as a model input.

[0110] In some embodiments, the model calling module 306 of the present application further includes:

[0111] The second calling unit is used to deduplicate and detect conflicts on each of the initial test cases returned by the AI ​​model if the total number of characters exceeds the maximum number of input characters, and obtain the target test case.

[0112] In some embodiments, the model calling module 306 of the present application includes:

[0113] The third calling unit is used to call the AI ​​model using all the complete path information as model input if the total number of characters in each of the complete path information is less than or equal to the maximum input character number of the AI ​​model.

[0114] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the test case generation method in any embodiment.

[0115] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the test case generation method in any embodiment.

[0116] Schematically, Figure 4 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. In one example, the computer device may be a server. Figure 4 Computer device 900 includes a processing component 902, which further includes one or more processors, and memory resources represented by memory 901 for storing instructions executable by processing component 902, such as an application. The application stored in memory 901 may include one or more modules, each corresponding to a set of instructions. In addition, processing component 902 is configured to execute the instructions to perform the steps of the test case generation method described in any of the above embodiments.

[0117] The computer device 900 may further include a power supply component 903 configured to perform power management of the computer device 900, a wired or wireless network interface 904 configured to connect the computer device 900 to a network, and an input / output (I / O) interface 905. The computer device 900 may operate based on an operating system stored in the memory 901, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.

[0118] Those skilled in the art will understand that the internal structure of the computer device shown in the present application is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0119] Finally, it should be noted that, in this article, relational terms such as first and second are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further restriction, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element. Herein, "one," "said," "the," and "its" may also include plural forms unless the context clearly indicates otherwise. A plurality refers to at least two, such as 2, 3, 5, or 8. "And / or" includes any and all combinations of the relevant listed items.

[0120] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0121] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A test case generation method, characterized in that: include: Obtaining a test mind map, wherein the test mind map is used to describe at least one functional module to be tested and test items required for each functional module to be tested; Parsing the node hierarchical relationship of the test mind map and obtaining the complete path information corresponding to each leaf node in the test mind map; Using each of the complete path information as a model input, calling a pre-trained AI model, and obtaining an initial test case returned by the AI ​​model; A target test case is obtained according to each of the initial test cases.

2. The method according to claim 1, characterized in that The method of using the complete path information as model input and calling the pre-trained AI model includes: Determine whether the total number of characters in each of the complete path information exceeds the maximum input character number of the AI ​​model; If so, sorting each of the complete path information according to a preset sorting rule, and obtaining an arrangement order corresponding to each of the complete path information; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order; According to each of the arrangement orders, each of the complete path information is used as the model input in turn to call the AI ​​model.

3. The method according to claim 2, characterized in that The step of calling the AI ​​model by sequentially using the complete path information of each of the arrangement orders as a model input includes: Grouping the complete path information according to the maximum number of input characters to obtain a plurality of groups; wherein each complete path information belongs to a group, and at least one group includes a plurality of complete path information, and the complete path information in the same group corresponds to the same functional module to be tested; Determining the execution order corresponding to each of the groups according to the respective arrangement orders; According to the execution order corresponding to each of the groups, the AI ​​model is called in sequence using the complete path information included in each of the groups as model input.

4. The method according to claim 2, characterized in that The step of calling the AI ​​model by sequentially using the complete path information of each of the arrangement orders as a model input includes: According to each of the arrangement orders, sequentially determine the M target path information of the current round in each of the complete path information; wherein M is a preset concurrency number and is a positive integer greater than 1; Each of the M target path information is used as a model input, and the AI ​​model is called concurrently.

5. The method according to any one of claims 2 to 4, characterized in that The obtaining of target test cases according to each of the initial test cases further includes: If the total number of characters exceeds the maximum number of input characters, deduplication and conflict detection are performed on each of the initial test cases returned by the AI ​​model to obtain the target test case.

6. The method according to any one of claims 1 to 4, characterized in that The method of using the complete path information as model input and calling the pre-trained AI model includes: If the total number of characters in each of the complete path information is less than or equal to the maximum number of input characters of the AI ​​model, all of the complete path information is used as model input to call the AI ​​model.

7. A test case generating device, characterized in that: include: A mind map acquisition module is used to acquire a test mind map, wherein the test mind map is used to describe at least one functional module to be tested and the test items required for each functional module to be tested; A hierarchical parsing module is used to parse the hierarchical relationship of the nodes in the test mind map and obtain the complete path information corresponding to each leaf node in the test mind map; A model calling module, configured to use each of the complete path information as a model input, call a pre-trained AI model, and obtain an initial test case returned by the AI ​​model; The use case acquisition module is used to obtain target test cases according to each of the initial test cases.

8. The device according to claim 7, characterized in that The model calling module includes: A judging unit, configured to judge whether the total number of characters in each of the complete path information exceeds the maximum number of input characters of the AI ​​model; a sorting unit, configured to sort each of the complete path information according to a preset sorting rule and obtain an arrangement order corresponding to each of the complete path information when the total number of characters exceeds the maximum number of input characters; wherein the preset sorting rule is sorting according to at least one of node depth, preset function module priority, and preset function module execution order; The first calling unit is used to call the AI ​​model according to each of the arrangement orders and using each of the complete path information as the model input.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the test case generation method according to any one of claims 1 to 6.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the test case generation method according to any one of claims 1 to 6 are performed.