Test case generation method and device, equipment and storage medium

By splitting and aggregating requirements information between servers and generating test cases using large language models, the problem of time-consuming and low coverage of manual design test cases is solved, and the test cases quality and coverage of complex product requirements is improved.

CN119025413APending Publication Date: 2024-11-26BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411028366.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing technology relies on artificially designed test cases in software testing, which is time-consuming and has low coverage. The number of test cases generated by artificial intelligence is limited and the quality is poor, making it difficult to meet the needs of complex products.

Method used

By splitting and aggregating requirements information between servers, using large language models to generate subtest cases, and aggregating them on the client side to form target test cases, improving the generation efficiency and quality of test cases.

Benefits of technology

It solves the problem of limited number of test cases when complex product demands, significantly improves the quality of test cases, and avoids the problem of incomplete test coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025413A_ABST
    Figure CN119025413A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and particularly provides a test case generation method and device, equipment and a storage medium, the method comprises the following steps: a first server obtains first demand information and sends the first demand information to a second server, and the second server splits the first demand information into a plurality of pieces of second demand information; the first server receives a plurality of pieces of second demand information, and constructs a use case corresponding to each piece of second demand information to generate a cue word; the first server sends multiple pieces of second demand information and case generation cue words corresponding to the second demand information to a second server, and the second server generates sub test cases based on the case generation cue words and the second demand information; and the first server aggregates the plurality of sub test cases to obtain a target test case. According to the embodiment of the invention, the problem that the number of generated tests is limited when complex and diversified product requirements are met is solved, the quality of the test cases of the complex product requirements is improved, and incomplete test coverage caused by insufficient test cases is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a test case generation method, apparatus, device and storage medium. Background Art

[0002] As the types and quantity of software installed in smart devices increase, it is necessary to test the various functions of the software before releasing it, which requires the use of test cases. A test case is a description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document.

[0003] In related technologies, designing test cases mainly relies on manual operations, which is a time-consuming and complicated process. Especially in complex systems, there are many input and output situations that need to be considered. Manual design is difficult to cover all possible situations, resulting in low test coverage.

[0004] In addition, although the existing artificial intelligence generated content (Artificial Intelligence Generated Content, AIGC) technology can assist in the generation of test cases, the number of test cases it generates is limited. The more complex the product requirements and the more content there is, the worse the quality of the test cases generated by AIGC technology. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a test case generation method, apparatus, device and storage medium to improve the test case generation efficiency and test case quality.

[0006] In a first aspect, the present application provides a test case generation method, which is applied to a first server, and the method includes: obtaining first requirement information; sending the first requirement information to a second server, so that the second server splits the first requirement information into multiple second requirement information; receiving multiple second requirement information sent by the second server, and constructing a use case generation prompt word corresponding to each second requirement information; sending multiple second requirement information and a use case generation prompt word corresponding to each second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; receiving multiple sub-test cases sent by the second server, aggregating the multiple sub-test cases, and obtaining a target test case.

[0007] In the second aspect, the present application provides a test case generation method, which is applied to a second server, and the method includes: receiving first requirement information sent by the first server; splitting the first requirement information into multiple second requirement information; sending multiple second requirement information to the first server, so that the first service constructs a use case generation prompt word based on the second requirement information; receiving multiple second requirement information sent by the first server and the use case generation prompt words corresponding to each second requirement information, and for each second requirement information, generating a sub-test case based on the second requirement information and the use case generation prompt words corresponding to the second requirement information; sending the sub-test case to the first server, so that the first server aggregates the multiple sub-test cases to obtain the target test case.

[0008] In a third aspect, the present application provides a test case generation method, the method comprising: using a first server to obtain first requirement information; using the first server to send the first requirement information to a second server; using the second server to split the first requirement information into multiple second requirement information; using the second server to send multiple second requirement information to the first server; using the first server to receive multiple second requirement information sent by the second server, and constructing a use case generation prompt word corresponding to each second requirement information; using the first server to send multiple second requirement information and use case generation prompt words corresponding to each second requirement information to the second server; using the second server to generate a sub-test case based on the use case generation prompt word and the second requirement information; using the second server to send the sub-test case to the first server; using the first server to receive multiple sub-test cases sent by the second server, aggregating the multiple sub-test cases to obtain a target test case.

[0009] In a fourth aspect, the present application provides a test case generation system, the system comprising a first server and a second server; the first server is used to execute the test case generation method as in the first aspect above; the second server is used to execute the test case generation method as in the second aspect above.

[0010] In the fifth aspect, the present application provides a test case generation device, which is configured on a first server, and the device includes: an information acquisition module, used to acquire first requirement information; a first sending module, used to send the first requirement information to the second server, so that the second server splits the first requirement information into multiple second requirement information; a first receiving module, used to receive multiple second requirement information sent by the second server, and construct a use case generation prompt word corresponding to each second requirement information; a second sending module, used to send multiple second requirement information and a use case generation prompt word corresponding to each second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; a test case aggregation module, used to receive multiple sub-test cases sent by the second server, aggregate the multiple sub-test cases, and obtain a target test case.

[0011] In the sixth aspect, the present application provides a test case generation device, which is configured on a second server, and the device includes: a second receiving module, used to receive first requirement information sent by the first server; an information splitting module, used to split the first requirement information into multiple second requirement information; a third sending module, used to send multiple second requirement information to the first server, so that the first service constructs a use case generation prompt word based on the second requirement information; the third receiving module is used to receive multiple second requirement information sent by the first server and the use case generation prompt word corresponding to each second requirement information, and the test case generation module is used to generate a sub-test case for each second requirement information based on the second requirement information and the use case generation prompt word corresponding to the second requirement information; the fourth sending module is used to send the sub-test case to the first server, so that the first server aggregates the multiple sub-test cases to obtain the target test case.

[0012] In the seventh aspect, the present application provides a test case generation device, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the test case generation method as described in the first aspect or the second aspect above.

[0013] In an eighth aspect, the present application provides a storage medium, which may be a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the test case generation method in the first aspect or the second aspect described above is implemented.

[0014] In a ninth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the test case generation method in the first aspect or the second aspect described above is implemented.

[0015] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:

[0016] The embodiment of the present application provides a test case generation method, device, equipment and storage medium, the method comprising: a first server obtains first requirement information; the first server sends the first requirement information to the second server, the second server splits the first requirement information into multiple second requirement information and sends it to the second server; the first server receives multiple second requirement information sent by the second server, and constructs a use case generation prompt word corresponding to each second requirement information; the first server sends multiple second requirement information and use case generation prompt words corresponding to each second requirement information to the second server, and the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; the first server receives multiple sub-test cases sent by the second server, and the first server aggregates multiple sub-test cases to obtain a target test case. In the embodiment of the present application, the first requirement information is split into multiple second requirement information by the second server, and a corresponding sub-test case is generated for each second requirement information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved, the quality of test cases for complex requirements is greatly improved, and the problem of incomplete test coverage caused by insufficient test cases is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 A flowchart of a method for generating a test case executed by a first server provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a user interface of a first client provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of a test case format conversion method provided in an embodiment of the present application;

[0022] Figure 4 A flowchart of a method for generating a test case executed by a second server provided in an embodiment of the present application;

[0023] Figure 5 A flowchart of a test case generation method provided in an embodiment of the present application;

[0024] Figure 6 A flowchart of a method for generating interactive test cases provided in an embodiment of the present application;

[0025] Figure 7 A schematic diagram of the structure of a test case generation system provided in an embodiment of the present application;

[0026] Figure 8 A schematic diagram of the structure of a test case generation device provided in an embodiment of the present application;

[0027] Fig. 9 A schematic diagram of the structure of another test case generation device provided in an embodiment of the present application;

[0028] Fig.10 A schematic diagram of the structure of a test case generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The test case generation method provided by the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0035] Figure 1 This is a flowchart of a test case generation method in an embodiment of the present application. This embodiment can be applied to the situation of automatically generating software test cases. The method can be executed by a test case generation device. The test case generation device can be implemented in software and / or hardware. The test case generation device can be configured in the first server.

[0036] like Figure 1 As shown, the test case generation method provided in the embodiment of the present application mainly includes steps S101 to S105.

[0037] S101. Obtain first demand information.

[0038] Among them, the first server can be understood as a server that processes information related to test cases. The first server is connected to its corresponding first client, which is used to receive information related to test cases input by users, or to display relevant information processed by the first server.

[0039] The requirement information generally refers to a document or specification that describes in detail how a software product should work, such as functional requirements, performance requirements, user interface requirements, and security requirements. The requirement information defines the functions and features that the software product should have, and how users interact with it. The first requirement information can be understood as the requirement information of the software product input by the user through the user interface of the first client.

[0040] In an embodiment of the present application, a user interface diagram of a first client is provided. Figure 2 As shown, the user interface displays the content that needs to be input to generate a test case, mainly including: prompt words, requirement information, and options corresponding to sub-directories.

[0041] The generated test cases are displayed in the terminal display area in the form of a view or a mind map. However, the test cases may be incomplete or new test cases may need to be generated due to the update and iteration of the software product. In this case, the user operates at the directory location or node location where the new test case is needed, and the terminal display area displays the following. Figure 2 The input window for generating a test case is shown. The above operations include left clicking, double clicking, right clicking, etc., which are not specifically limited in the embodiments of the present application.

[0042] A prompt usually refers to text input to a large language model to guide or instruct the large prediction model to generate a specific output. The prompt can be a question, instruction, description, or any form of text. In an embodiment of the present application, the prompt may be an analysis method to be used in designing a test case, normal scenarios and abnormal scenarios to be considered, etc. The above analysis methods include: equivalence class partitioning, boundary value analysis, error speculation, etc. The user enters a prompt related to the test case in the prompt text box, and the first client obtains the prompt related to the test case entered by the user.

[0043] The first requirement information refers to the clear, specific and structured product requirements / technical documents / business background knowledge entered by the user in the requirement information text box. Clear, specific and structured requirement information can help the second server understand the requirements more accurately and generate high-quality test cases.

[0044] The options corresponding to the subdirectory mainly include: do not generate subdirectory, AIGC generate subdirectory, and view subdirectory. The subdirectory option is used to determine the specific type of directory used by the generated test case based on the user's selection. For example: do not generate subdirectory means that the newly generated test case is directly added under the directory or node selected by the user, and the corresponding subdirectory is not generated for the newly generated test case. AIGC generates subdirectory means that the second server determines whether the newly generated test case needs to generate a subdirectory based on the first requirement information and related information such as prompt words. View subdirectory refers to organizing the subdirectory of the test case according to the view corresponding to the newly generated test case.

[0045] The first client receives the user's Figure 2 The relevant information of the test case input in the window shown; for example: prompt word, first requirement information and sub-directory options. The first client sends the received relevant information of the test case to the first server to which it is connected, and the first server receives the relevant information of the test case sent by the first client. Specifically, the first server receives the prompt word, first requirement information and sub-directory options sent by the first client.

[0046] S102: Send the first demand information to the second server, so that the second server splits the first demand information into multiple pieces of second demand information.

[0047] The second server can be understood as a server that can generate test cases based on the large language model. The first server and the second server can be two server ends deployed in one device, or two server ends deployed in different devices. The large language model is deployed in the second server, and the large language model can be an AIGC model.

[0048] In a possible implementation, after the first server verifies the relevant information of the test case, the first requirement information is sent to the second server.

[0049] In such Figure 2 In the window shown, the requirement information and sub-directory options are mandatory items, and the first server verifies the mandatory items, that is, verifies whether the requirement information is filled in and whether the sub-directory options are checked. After the requirement information is filled in and the sub-directory options are checked, the second server usage is determined.

[0050] Specifically, the judgment of the usage of the second server mainly includes: obtaining the number of test case generation times and the number of tasks currently being executed; judging whether the number of test case generation times is less than the first set value, judging whether the number of tasks currently being executed is greater than the second set value, and when the number of test case generation times is less than the first set value and the number of tasks currently being executed is greater than the second set value, judging whether the first demand information meets the first set condition.

[0051] The number of test case generation times refers to the number of times the first server calls the second server to generate test cases, and the number of currently executing tasks refers to the number of test case generation tasks being executed in the second server.

[0052] The first preset value is a value used to characterize the number of times the second server can execute a task in one day. For example, the first preset value is 100. That is, the number of times the first server can call the second server to generate test cases in one day is 100. If the number of test case generation times is greater than or equal to the first preset value, it means that the number of times the first server called the second server to generate test cases today has reached the first preset value, and the first server can no longer call the second server to generate test cases today. If the number of test case generation times is less than the first preset value, it means that the number of times the first server called the second server to generate test cases today has not reached the first preset value, and the first server can call the second server to generate test cases today.

[0053] The second preset value is the maximum value used to characterize the tasks that can be executed by the second server at the same time. For example: the second preset value is 5. That is, the number of tasks that the second server can execute to generate test cases at the same time is 5. If the number of tasks currently being executed is greater than or equal to the second preset value, it means that the number of tasks currently being executed by the second server has reached the second preset value. In order to avoid overloading the second server, the test case generation task will no longer be assigned to the second server. If the number of tasks currently being executed is less than the second preset value, it means that the number of tasks currently being executed by the second server has not reached the second preset value, and the test case generation task can continue to be assigned to the second server.

[0054] In one possible implementation, the number of test case generation times and the number of currently executing tasks are obtained; when the number of test case generation times is less than the first set value, and the number of currently executing tasks is greater than the second set value, at this time, the first server meets the conditions for calling the second server to generate test cases, and at this time, the task information of the test case generation task needs to be recorded.

[0055] Specifically, a task data model is pre-established in the database corresponding to the first server, and the task data model is used to store task information of the test case generation task. When it is detected that the first server meets the conditions for calling the second server to generate a test case, a task information is generated and stored in the task data model. The above task information mainly includes task identification, task status, and task completion status (success or failure).

[0056] Furthermore, when the first server meets the condition of calling the second server to generate a test case, a serializer is created in the database corresponding to the first server, and the serializer is used to process the serialization and deserialization of the task data.

[0057] It should be noted that the first server obtains the number of test case generation times and the number of tasks currently being executed. When the number of test case generation times is less than the first set value and the number of tasks currently being executed is greater than the second set value, the task information of the test case generation task is stored, and after the serializer is created, the first demand information is sent to the second server.

[0058] In one possible implementation, sending first demand information to a second server includes: determining whether the first demand information satisfies a first set condition; generating a demand splitting prompt word if the first demand information satisfies the first set condition; and sending the first demand information and the demand splitting prompt word to the second server, the demand splitting prompt word being used to instruct the second server to split the first demand information.

[0059] The first set condition is an indicator for judging the complexity of the demand information. If the first demand information meets the first set condition, it means that the first demand information is complex and diversified. Directly using the first demand information to generate test cases may result in low quality test cases. In this case, the first demand information needs to be split. If the first demand information does not meet the first set condition, it means that the first demand information is not so complex, and the first demand information is directly used to generate test cases.

[0060] In one possible implementation, determining whether the first requirement information satisfies a first set condition includes: counting the number of words in the text included in the first requirement information; determining whether the number of words in the text is greater than the set number of words; if the number of words in the text is greater than the set number of words, determining that the first requirement information satisfies the first set condition.

[0061] The first set condition may include that the word count of the demand information exceeds a set word count, and the set word count may be set according to actual conditions, for example, the set word count is 100. The word count of the text refers to the number of characters included in the first demand information.

[0062] Counting the number of characters in the text included in the first demand information includes: using a character counting function to count the number of characters in the first demand information, or using other character processing tools to count the number of characters in the first demand information.

[0063] Specifically, if the number of words in the text of the first requirement information exceeds the set number of words, it indicates that the first requirement information meets the first set condition, that is, the first requirement information is complex and diversified, and directly using the first requirement information to generate test cases may result in low quality of test cases, so the first requirement information needs to be split. If the first requirement information does not exceed the set number of words, the first requirement information does not meet the first set condition, that is, the first requirement information is relatively simple, and the quality of directly generating test cases is relatively high, so the first requirement information is directly used to generate test cases.

[0064] In an embodiment of the present application, the first server calls a service asynchronous interface in the second server and sends first demand information to the service asynchronous interface of the second server.

[0065] In another implementation, when the first server determines that the first demand information meets the first preset condition, a demand splitting prompt word is generated, and the first server sends the demand splitting prompt word and the first demand information to the service asynchronous interface of the second server. The splitting prompt word is used to instruct the second server to split the first demand information.

[0066] Among them, the demand splitting prompt word may only include a demand splitting instruction, for example: the demand splitting prompt word is "split the following demand information into multiple sub-demand information", which only instructs the second server to split the received demand information, but does not indicate the rules for splitting.

[0067] Specifically, the demand splitting prompt words include demand splitting instructions and demand splitting rules; wherein the demand splitting rules include: splitting according to the directory structure of the first demand information.

[0068] The demand splitting rule can be understood as a splitting strategy that instructs the second server to split the demand information. Exemplarily, the demand splitting rule can limit the splitting structure, for example: the demand splitting prompt is "split the following demand information into multiple sub-demand information according to the directory structure of the demand information." The prompt includes a demand splitting instruction and a demand splitting rule, wherein the demand splitting instruction is "split the following demand information into multiple sub-demand information", and the demand splitting rule is "split according to the directory structure of the demand information."

[0069] Exemplarily, the requirement splitting rule can limit the number of words in the text of the second requirement information, for example: the requirement splitting prompt is "split the following requirement information into multiple sub-requirement information, and the number of words in the text of each sub-requirement information cannot exceed 100 words." The prompt includes a requirement splitting instruction and a requirement splitting rule, wherein the requirement splitting instruction is "split the following requirement information into multiple sub-requirement information", and the requirement splitting rule is "the number of words in the text of each sub-requirement information cannot exceed 100 words".

[0070] Exemplarily, the requirement splitting rule may require other splitting methods, for example: the requirement splitting prompt is "split the following requirement information into multiple sub-requirement information according to contextual semantic information". The prompt includes a requirement splitting instruction and a requirement splitting rule, wherein the requirement splitting instruction is "split the following requirement information into multiple sub-requirement information", and the requirement splitting rule is "split according to contextual semantic information".

[0071] Furthermore, the requirement splitting rules may include multiple splitting rules at the same time, and the requirement splitting rules may include splitting according to the directory structure of the first requirement information, and the number of text words in the second requirement information after splitting shall not exceed the set number of words. For example: the requirement splitting prompt is "According to the directory structure of the requirement information, split the following requirement information into multiple sub-requirement information, and the number of text words in each sub-requirement information shall not exceed 100 words." The prompt includes requirement splitting instructions and requirement splitting rules, wherein the requirement splitting instruction is "Split the following requirement information into multiple sub-requirement information", and the requirement splitting rules are "The number of text words in each sub-requirement information shall not exceed 100 words" and "According to the directory structure of the requirement information."

[0072] It should be noted that the embodiments of the present application only illustrate the demand splitting prompt words, but do not limit them. In actual applications, other demand splitting prompt words can be constructed according to actual conditions and requirements.

[0073] After the service asynchronous interface of the second server receives the first demand information, the first demand information is split into a plurality of second demand information, wherein each second demand information satisfies the first preset condition. Exemplarily, the number of words in each second demand information is less than 100 words.

[0074] Specifically, after receiving the demand splitting prompt word and the first demand information, the second server splits the first demand information into a plurality of second demand information based on the demand splitting prompt word, and sends the split plurality of second demand information to the first server.

[0075] In a possible implementation, the first server includes a service batch generation use case interface, and the second server includes a service asynchronous interface. The service asynchronous interface of the first server calls the service batch generation use case interface of the second server and sends multiple second demand information to the service batch generation use case interface of the second server.

[0076] S103: Receive multiple pieces of second demand information sent by the second server, and construct use case generation prompt words corresponding to each piece of second demand information.

[0077] The service batch generation use case interface of the first server receives a plurality of second demand information sent by the service asynchronous interface of the second server, and the first server generates prompt words for the use case corresponding to each second demand information builder.

[0078] In a possible implementation, after receiving the multiple second requirement information sent by the second server, the first server updates the task information corresponding to the first requirement information, for example, adding the multiple second requirement information received as feedback from the second server to the task information.

[0079] After the first server receives multiple second demand information sent by the second server, the first server performs format verification on each second demand information; if the format verification passes, a use case corresponding to the second demand information is constructed to generate prompt words; if the format verification fails, the number of times the format verification fails is counted; if the number of times the format verification fails is less than the set number, the format of the second demand information is optimized, and the step of performing format verification on the second demand information is returned; if the number of times the format verification fails is greater than or equal to the set number, the step of sending the first demand information and the demand splitting prompt words to the second server is returned.

[0080] The format check of the second requirement information is mainly to check whether the second requirement information conforms to the conventional product requirement format. Specifically, the format check of the second requirement information mainly includes: checking the document structure of the second requirement information, checking the consistency of the second requirement information, checking the grammar and spelling of the second requirement information, checking the integrity and clarity of the second requirement information, etc. Among them, the above-mentioned set times can be set according to actual conditions.

[0081] The checking of the document structure of the second demand information includes: checking whether the second demand information complies with a predetermined demand template or structure, for example: whether it includes a title, a subtitle, a paragraph, and the like.

[0082] Verifying the consistency of the second requirement information includes: verifying whether the terms, naming conventions and formats (such as font, font size, color) used in the second requirement information are consistent throughout the text. Verifying the grammar and spelling of the second requirement information includes: verifying whether there are grammatical errors and / or spelling errors in the second requirement information. Verifying the completeness and clarity of the second requirement information includes: verifying whether the second requirement information is complete and no key functional points or features are omitted; verifying whether the description of the second requirement information is clear, specific, unambiguous, and easy to understand.

[0083] Optimizing the format of the second requirement information refers to modifying and correcting the content that failed the verification. For example, when there are spelling errors in the second requirement information, modify the spelling errors to the correct spelling. When the terms used in the second requirement information are inconsistent, adjust all the terms to be consistent. When the second requirement information does not follow the established requirement template, modify the second requirement information according to the established requirement template so that it can follow the established requirement template.

[0084] It should be noted that optimizing the format of the second demand information may include: optimizing the format of the second demand information using a pre-trained demand information optimization model; it may also include: displaying multiple received second demand information in the user interface of the first client, receiving an optimization method input by the user through the first client, and the first server optimizing each second demand information based on the optimization method input by the user.

[0085] In a possible implementation, the setting number of times is taken as an example for explanation. The second requirement information is subjected to a first format check; if the first format check passes, a use case corresponding to the second requirement information is constructed to generate prompt words; if the first format check fails, the number of times the format check fails is counted as 1. At this time, the number of times the format check fails 1 is equal to the set number of times 1, and the process returns to execute the step of sending the first requirement information and the requirement splitting prompt words to the second server. In other words, the second requirement information is subjected to a format check only once. If the format check passes, a use case corresponding to the second requirement information is constructed to generate prompt words. If the format check fails, no format optimization is performed, and the first requirement information and the requirement splitting prompt words are directly sent to the second server, so that the second server re-splits the first requirement information based on the first requirement information and the requirement splitting prompt words to obtain multiple second requirement information.

[0086] In another possible implementation, the setting number of times is taken as an example for explanation. The second requirement information is subjected to a first format check; if the first format check passes, a use case corresponding to the second requirement information is constructed to generate prompt words; if the first format check fails, the number of times the format check fails is counted as 1, at this time, the number of times the format check fails 1 is less than the set number of times 2, the second requirement information is format optimized, and the optimized second requirement information is format checked again, if the format check passes this time, a use case corresponding to the second requirement information is constructed to generate prompt words; if the format check fails this time, the number of times the format check fails is counted as 2, at this time, the number of times the format check fails 2 is equal to the set number of times 2, and the step of sending the first requirement information and the requirement splitting prompt words to the second server is returned. In other words, if the format of the second demand information fails to pass the check, a format optimization can be performed. If the first format check passes or the optimized format check passes, a use case corresponding to the second demand information is constructed to generate prompt words. If the optimized format check still fails, no format optimization is performed, and the first demand information and the demand splitting prompt words are directly sent to the second server, so that the second server re-splits the first demand information based on the first demand information and the demand splitting prompt words to obtain multiple second demand information.

[0087] The specific implementation method of setting the number of times greater than 2 is basically similar to the implementation process of setting the number of times equal to 2. The only difference is the number of times the format optimization is performed. For example, if the number of times is set to 2, the format optimization can be performed once, if the number of times is set to 3, the format optimization can be performed twice, if the number of times is set to 4, the format optimization can be performed three times, and so on.

[0088] It should be noted that in order to avoid too many format optimization times and reduce data processing efficiency, the set number of times can be set to 2 or 3.

[0089] In one possible implementation, after all the second requirement information has been verified, use case generation prompt words corresponding to each second requirement information are generated; if any second requirement information fails the verification, the first requirement information and the requirement splitting prompt words are sent to the second server, so that the second server re-splits the first requirement information based on the first requirement information and the requirement splitting prompt words to obtain multiple new second requirement information.

[0090] The use case generation prompts are mainly used to guide the second server on how to generate test cases based on the second product requirements. The prompts may include: Test objectives: clarify the purpose of the test, such as functional verification, performance testing, security testing, etc. Test scope: specify which functions or modules need to be tested. Test scenarios: describe the specific situations of the test, including normal operations, edge cases, and abnormal situations. Data input: provide test data samples or describe the rules for generating data. Expected results: define the expected output or behavior under different test conditions. Test steps: guide AI to perform operation steps in sequence. Constraints: limit the format, quantity, complexity, etc. of test cases. Test priority: indicate which test cases are more important or urgent. Test coverage: require test cases to cover specific code paths or requirement points.

[0091] In a possible implementation, after the second requirement information passes verification, the first server updates the task status in the task information corresponding to the first requirement information in the task data model. For example, multiple second requirement information formats are added to the task information and passed verification.

[0092] The process of constructing the use case generation prompt words corresponding to the second requirement information mainly includes: extracting key information from the second requirement information, such as function points, user behavior, system response, input and output data, etc. Determine the goals that the test case needs to verify, such as verifying specific functions, performance indicators or security features. According to product requirements, build actual user usage scenarios, including normal processes and abnormal situations. Determine the input data required for the test case, including valid data, invalid data, boundary values, etc. Clearly define the expected output or system behavior after the test case is executed based on the second requirement information. Determine the abnormal situations that the software product may encounter and define the corresponding error handling mechanism. Set priorities for test cases based on the importance and risk assessment of the second requirement information. Determine the environmental conditions required for the execution of the test case, including hardware, software and network configuration. Integrate the above information into clear use case generation prompt words to guide the second server to generate test cases.

[0093] S104: Send multiple pieces of second requirement information and use case generation prompt words corresponding to each piece of second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information.

[0094] After the first server determines the second requirement information and constructs a corresponding use case generation prompt word for the second requirement information, the first server calls the service asynchronous interface of the second server and sends the second requirement information and the use case generation prompt word corresponding to the second requirement information to the service asynchronous interface of the second server.

[0095] In one possible implementation, the first server sends the second requirement information and the use case generation prompt words corresponding to the second requirement information to the service asynchronous interface of the second server, including: the first server sends all the second requirement information and the use case generation prompt words corresponding to each second requirement information to the service asynchronous interface of the second server at one time.

[0096] In another possible implementation, the first server sends the second requirement information and the use case generation prompt words corresponding to the second requirement information to the service asynchronous interface of the second server, including: the first server sends the second requirement information and the use case generation prompt words corresponding to the second requirement information to the service asynchronous interface of the second server in turn. In other words, the first server calls the service asynchronous interface to send a second requirement information and the use case generation prompt words corresponding to the second requirement information to the second server, and after receiving the successful reception message sent by the second server, sends the next second requirement information and the use case generation prompt words corresponding to the second requirement information, until all the second requirement information and the use case generation prompt words corresponding to the second requirement information are sent.

[0097] After the first server sends the second requirement information and the use case generation prompt word corresponding to the second requirement information to the second server, the task information corresponding to the first requirement information is updated in the task data model. For example: multiple subtask information is established in the task information, and the number of subtask information is consistent with the number of second requirement information. Each subtask information is used to record the task status of the test case generation task corresponding to each second requirement information.

[0098] After the second server generates a sub-test case based on the use case generation prompt word and the second requirement information, it sends the sub-test case to the first server. The second server calls the service use case conversion interface in the first server and sends the sub-test case to the first server through the service use case conversion interface.

[0099] S105: Receive multiple sub-test cases sent by the second server, aggregate the multiple sub-test cases, and obtain a target test case.

[0100] The second server generates a sub-test case and sends the generated sub-test case to the first server. The first server receives the generated sub-test case sent by the second server.

[0101] After the first server receives the sub-test cases, for each sub-test case, a format check is performed on the sub-test case; if the format check passes, the sub-test case is marked as having passed the format check; if the format check fails, the number of times the format check fails is counted; if the number of times the format check fails is less than a set number, the format of the sub-test case is optimized, and the step of performing format check on the sub-test case is returned to be executed; if the number of times the format check fails reaches a set number, the second requirement information and the use case generation prompt word corresponding to the second requirement information are sent to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information.

[0102] In a possible implementation, the setting number of times is taken as an example for explanation. Perform the first format check on the sub-test case; if the first format check passes, mark the sub-test case as passed in the format check; if the first format check fails, count the number of times the format check fails as 1. At this time, the number of times the format check fails 1 is equal to the set number of times 1, then send the second requirement information and the use case generation prompt word corresponding to the second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information. In other words, perform format check on the sub-test case only once, if the format check passes, mark the sub-test case as passed in the format check, if the format check fails, do not perform format optimization, directly send the second requirement information and the use case generation prompt word corresponding to the second requirement information to the second server, so that the second server generates a new sub-test case based on the use case generation prompt word and the second requirement information.

[0103] In another possible implementation, the setting number of times is 2 as an example for explanation. Perform the first format check on the sub-test case; if the first format check passes, mark the sub-test case as passed in the format check; if the first format check fails, count the number of times the format check fails as 1, at this time, the number of times the format check fails as 1 is less than the set number of times 2, perform format optimization on the sub-test case, re-format check the optimized sub-test case, if the format check passes this time, mark the sub-test case as passed in the format check; if the format check fails this time, count the number of times the format check fails as 2, at this time, the number of times the format check fails as 2 is equal to the set number of times 2, send the second requirement information and the use case generation prompt word corresponding to the second requirement information to the second server, so that the second server generates a new sub-test case based on the use case generation prompt word and the second requirement information. In other words, a format check is performed on the sub-test case. If the format check fails, a format optimization can be performed. If the first format check passes or the optimized format check passes, the sub-test case is marked as having passed the format check. If the optimized format check still fails, no format optimization is performed, and the second requirement information and the use case generation prompt word corresponding to the second requirement information are directly sent to the second server, so that the second server generates a new sub-test case based on the use case generation prompt word and the second requirement information.

[0104] The specific implementation method of setting the number of times greater than 2 is basically similar to the implementation process of setting the number of times equal to 2. The only difference is the number of times the format optimization is performed. For example, if the number of times is set to 2, the format optimization can be performed once, if the number of times is set to 3, the format optimization can be performed twice, if the number of times is set to 4, the format optimization can be performed three times, and so on.

[0105] It should be noted that in order to avoid too many format optimization times and reduce data processing efficiency, the set number of times can be set to 2 or 3.

[0106] If all sub-test cases are marked as format verification passed, it is determined whether each second requirement information has generated a corresponding sub-test case. If it is determined that each second requirement information has generated a corresponding sub-test case, all sub-test cases are aggregated to obtain a target test case.

[0107] Determining that each second requirement information generates a corresponding sub-test case includes: reading task information of each subtask, and if the task information corresponding to each subtask is successfully executed, determining that each second requirement information generates a corresponding sub-test case.

[0108] Determining that each second requirement information generates a corresponding sub-test case includes: recording the number of sub-test cases that pass the verification, and if the number of sub-test cases that pass the verification is consistent with the number of second requirement information, determining that each second requirement information generates a corresponding sub-test case.

[0109] Aggregating multiple sub-test cases to obtain a target test case includes: aggregating each sub-test based on the dependency relationship between each sub-test case.

[0110] Aggregating multiple sub-test cases to obtain a target test case includes: determining the relationship between each sub-test case based on the directory position of each second requirement information in the first requirement information, and aggregating multiple sub-test cases based on the relationship between each sub-test case to obtain the target test case.

[0111] In a possible implementation, after the target test case is aggregated, the target test case is represented in a text language form; the target test case can also be converted from the text language form to a mind map form to help users better understand and discuss the test case.

[0112] The embodiment of the present application provides a test case generation method, which is executed by a first server, and the method includes: obtaining first requirement information; sending the first requirement information to the second server, so that the second server splits the first requirement information into multiple second requirement information; receiving multiple second requirement information sent by the second server, and constructing a use case generation prompt word corresponding to each second requirement information; sending multiple second requirement information and use case generation prompt words corresponding to each second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; receiving multiple sub-test cases sent by the second server, aggregating multiple sub-test cases, and obtaining a target test case. In the embodiment of the present application, the first requirement information is split into multiple second requirement information by the second server, and a corresponding sub-test case is generated for each second requirement information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved. The quality of test cases for complex requirements is greatly improved, and the problem of incomplete test coverage caused by insufficient test cases is avoided.

[0113] On the basis of the above-mentioned embodiment, the embodiment of the present application further optimizes the step of "converting the target test case from the text language form to the mind map form", such as Figure 3 As shown, the process of target test case format conversion provided in the embodiment of the present application mainly includes steps S201 to S204.

[0114] S201. Obtain relevant information of each sub-test case expressed in text language.

[0115] In the above embodiment, the generated target test case is represented in text form, for example, a test case represented in an Excel table. The sub-test case is also represented in text form. In practical applications, in order to facilitate user viewing and understanding, the test case in text form will also be converted into a mind map form, that is, a test case represented in the xmind format. The test case represented in the mind map format is also called a tree structure of the test case, or a mind map form of the test case.

[0116] The relevant information of the test case includes: case name, priority, prerequisites, test steps, predicted results, etc.

[0117] In the embodiment of the present application, relevant information of each sub-test case can be obtained from the target test case, and relevant information of each sub-test case can be obtained directly after the sub-test case is received and checked in S104.

[0118] S202, converting the relevant information expressed in the form of text language into relevant information expressed in the format of a mind map, and obtaining a tree structure corresponding to the test case.

[0119] For each sub-test case, assemble the relevant information of each sub-test into data in xmind format. Construct a child node with the relevant information of each sub-test case. Determine the parent-child relationship between each child node based on the dependency relationship between each sub-test case, and construct a tree structure of the child nodes corresponding to each sub-test case based on the parent-child relationship.

[0120] This conversion method can be directly implemented using a format conversion tool and will not be described in detail in the embodiments of this application.

[0121] S203: Determine the parent node corresponding to each sub-test case.

[0122] The directory to which each piece of second requirement information belongs is obtained, and the parent directory corresponding to each piece of second requirement information is obtained. The node corresponding to the parent directory of the second requirement information is determined as the parent node of the sub-test case generated by the second requirement information.

[0123] For example, if the directory of the second requirement information is 111 and its corresponding parent directory is 11, then the node corresponding to the parent directory is AA, and the child node of the sub-test case generated by the second requirement information is aa, then it can be determined that node AA is the parent node of node aa. Use this method to determine the parent node corresponding to each sub-test case.

[0124] S204: Connect the tree structure corresponding to the target test case as a subtree to the parent node.

[0125] First, determine whether there is a generated test case tree structure, that is, determine whether there is an existing test case represented in the form of a mind map. If there is no generated test case tree structure, take the first requirement information directory as the root node, and use the tree structure constructed by the subnodes of each sub-test case as the test case represented in the form of a mind map.

[0126] If there is a generated test case tree structure, obtain the generated test case tree structure, traverse the test case tree structure, find the position of the parent node in the tree structure, connect the tree structure constructed by the child nodes of each child test case as a subtree under the parent node, and form a new tree structure of the test case.

[0127] In an embodiment of the present application, a method for converting a test case from text form to a mind map format is provided, which can realize the conversion of the test case format without the user's knowledge, avoiding the problem of manual format conversion after AIGC generates the test case, resulting in waste of human resources and low conversion efficiency, thereby improving the testing efficiency.

[0128] In an embodiment of the present application, a method for generating a test case executed by a second server is provided, such as Figure 4 As shown, the test case generation method provided in the embodiment of the present application mainly includes steps S301 to S306.

[0129] S301. Receive first demand information sent by a first server.

[0130] The first demand information refers to product demand information with complex content, for example, the first demand information has more than 100 words.

[0131] The first server calls the service asynchronous interface of the second server, the first server sends first demand information to the service asynchronous interface of the second server, and the service asynchronous interface of the second server receives the first demand information sent by the first server.

[0132] In a possible implementation, receiving the first demand information sent by the first server includes: receiving the first demand information and the demand splitting prompt word sent by the first server;

[0133] Specifically, the first server sends the first demand information and demand splitting prompt word to the service asynchronous interface of the second server, and the service asynchronous interface of the second server receives the first demand information and demand splitting prompt word sent by the first server. The demand splitting prompt word is used to instruct the second server to split the first demand information into multiple second demand information.

[0134] For other descriptions about the demand splitting prompt words and the first demand information, reference may be made to the description in the above embodiment, which will not be repeated in the embodiment of the present application.

[0135] S302: Split the first demand information into multiple pieces of second demand information.

[0136] After receiving the first demand information, the second server splits the first demand information into multiple simple second demand information. Specifically, after receiving the first demand information and the demand splitting prompt word, the second server splits the first demand information into multiple second demand information based on the demand splitting prompt word.

[0137] The demand splitting prompt words can be set according to the actual situation. Exemplarily, the demand splitting prompt words can be just a demand splitting instruction, for example: the demand splitting prompt words are "split the following demand information into multiple sub-demand information", and after the second server receives the demand splitting prompt words, it splits the first demand information into multiple second demand information according to the AIGC model's own powerful language understanding ability. For example: After the AIGC model performs word segmentation, keyword extraction, sentence segmentation, semantic analysis, topic construction, text clustering, and text splitting according to set rules or algorithms on the first demand information, the first demand information is split into multiple second demand information. Alternatively, the second server is set to split according to the directory structure by default. In this way, if the second server receives the demand splitting instruction and the first demand information, the second server splits the first demand information according to the directory structure by default.

[0138] In addition, the requirement splitting prompt may include not only the sub-requirement splitting instruction but also the requirement splitting rules set by the user. Exemplarily, the requirement splitting rule may require that the number of words in the second requirement information after splitting does not exceed the set number of words. The requirement splitting rule may require splitting according to the directory structure in the first requirement information. The description of the requirement splitting rule may refer to the description in the above embodiment.

[0139] In one possible implementation, the first demand information is split into multiple second demand information based on the demand splitting prompt words; the demand splitting prompt words are parsed to obtain demand splitting instructions and demand splitting rules; wherein the demand splitting rules include: splitting according to the directory structure of the first demand information; extracting the directory structure in the first demand information; splitting the first demand information into multiple second demand information according to the directory structure.

[0140] In one implementation, the demand splitting prompt word includes a demand splitting instruction and a demand splitting rule for splitting according to a directory structure. In this way, if the second server receives the demand splitting prompt word and the first demand information, the second server splits the first demand information according to the directory structure based on the demand splitting instruction.

[0141] Since each text segment corresponding to the directory structure can represent the segmentation of the context semantics in the first requirement information, splitting according to the directory structure can avoid splitting texts with closely connected context semantics into two different second requirement information. This makes the text contexts in the same second requirement information closely connected, thereby improving the quality of sub-test cases.

[0142] In a possible implementation, the first demand information is split into multiple second demand information according to the directory structure, including: taking the first-level directory as the first directory and the first demand information as the current demand information; splitting the current demand information into multiple initial demand information according to the first directory; judging whether the number of text words of each of the initial demand information exceeds the set number of words; for each initial demand information, if the number of text words of the initial demand information exceeds the set number of words, obtaining the subdirectory under the directory corresponding to the initial demand information; taking the subdirectory as the first directory and the initial demand information as the current demand information, and returning to execute the step of splitting the current demand information into multiple initial demand information according to the first directory; until the number of text words of all the initial demand information does not exceed the set number of words, the initial demand information whose text word number does not exceed the set number of words is obtained as the second demand information.

[0143] Specifically, the requirement splitting rule also includes: setting the number of words; the set number of words is used to limit the upper limit of the number of words in the text of the second requirement information. Since the requirement information needs to be split only when the number of words in the first requirement information exceeds the set number of words, if the number of words in the text of the second requirement information after splitting still exceeds the set number of words, then the sub-test cases generated using the second requirement information may be of low quality. Therefore, the upper limit of the number of words in the text of the second requirement information is limited to further improve the quality of the sub-test cases, thereby improving the quality of the entire target test case.

[0144] In the case where the first demand information includes a directory identifier, the relationship between the directories is determined based on the directory identifier, and the first demand information includes a three-level directory as an example. Among them, the first-level directory includes the second-level directory, and the second-level directory includes the third-level directory. The second server extracts the directory identifier in the first demand information according to the directory identifier carried in the first demand information, and determines the directory structure of the first demand information based on the relationship between the identifiers.

[0145] If the first demand information does not include a directory identifier, the AIGC model is used to extract the directory structure in the first demand information through natural language processing technology.

[0146] Take the directory structure including three levels of directories as an example. Take the first-level directory as the first directory, take the first demand information as the current demand information, obtain all the demand information included in each first-level directory, take all the demand information included in each first-level directory as the initial demand information, and for each initial demand information, determine whether the number of words in the text of the initial demand information exceeds the set number of words. If the number of words in the text of the initial demand information exceeds the set number of words, take the initial demand information as the second demand information.

[0147] If the number of words in the text of one or more initial demand information exceeds the set number of words, obtain the second-level directory included in the first-level directory corresponding to the initial demand information, and use the second-level directory as the first directory, and use the initial demand information as the current demand information. For each second-level directory, obtain all the demand information included in each second-level directory, and use all the demand information included in each second-level directory as the initial demand information. For each initial demand information, determine whether the number of words in the text of the initial demand information exceeds the set number of words. If the number of words in the text of the initial demand information exceeds the set number of words, use the initial demand information as a second demand information.

[0148] If the number of words in the text of one or more initial demand information exceeds the set number of words, obtain the third-level directory included in the second-level directory corresponding to the initial demand information, and then continue to perform demand splitting according to the third-level directory and the initial demand information with a text word count exceeding the set number of words, until the number of words in the text of all initial demand information does not exceed the set number of words.

[0149] In the embodiment of the present application, it is limited that the text coefficient in each second requirement information cannot exceed a set number of words, which can improve the quality of the sub-test cases and further improve the quality of the target test cases.

[0150] S303: Send multiple pieces of second demand information to the first server, so that the first service constructs a use case based on the second demand information to generate prompt words.

[0151] The second server splits the first demand information into multiple second demand information and sends them to the first server. Specifically, the second server calls the service batch generation use case interface of the first server, and then the service asynchronous interface of the second server sends multiple second demand information to the service batch generation use case interface of the first server.

[0152] The process of the first server constructing a use case based on the second demand information to generate prompt words can refer to the description in the above embodiment and will not be repeated in the embodiments of the present application.

[0153] S304: Receive multiple pieces of second demand information sent by the first server and use case generation prompt words corresponding to each piece of second demand information.

[0154] In an embodiment of the present application, the first server calls the service asynchronous interface of the second server, and the first server sends the second demand information and the use case generation prompt word corresponding to the second demand information to the service asynchronous interface of the second server. The service asynchronous interface of the second server receives multiple second demand information sent by the first server and the use case generation prompt word corresponding to each second demand information.

[0155] S305 . For each second requirement information, generate a sub-test case based on the second requirement information and a use case generation prompt word corresponding to the second requirement information.

[0156] The second server deploys the AIGC model, and uses the natural language processing technology of the AIGC model to generate corresponding sub-test cases based on the use case generation prompt words and the second requirement information. A sub-test case includes preconditions, test steps, test data, expected results, actual results, etc.

[0157] The AIGC model uses natural language processing technology to generate prompt words based on the use case and the second requirement information to generate corresponding sub-test cases, mainly including: extracting the product's functional points, usage scenarios, business rules, and key test information in the second requirement information, where the key test information includes: input parameters, conditions, expected behaviors, output results, and test purposes. Use AIGC technology to generate test scenarios based on the extracted information, including normal processes, boundary conditions, abnormal situations, and stress tests. For each test scenario, use AIGC to generate detailed test cases, and use AIGC technology to identify and generate edge test cases. Design a test case template, and AIGC can automatically fill in the content according to the template to improve generation efficiency.

[0158] It should be noted that the embodiment of the present application only briefly introduces the process of generating test cases from the AIGC model, but does not limit it. The implementation of the present application does not specifically limit the process of generating test cases from the AIGC model.

[0159] S306: Send the sub-test cases to the first server, so that the first server aggregates the multiple sub-test cases to obtain a target test case.

[0160] The second server generates a sub-test case and sends the generated sub-test case to the first server. The first server receives the generated sub-test case sent by the second server.

[0161] The first server aggregates multiple sub-test cases to obtain the process of the target test case. Please refer to the description in the above embodiment and will not be repeated in the embodiments of the present application.

[0162] The embodiment of the present application provides a test case generation method, the method comprising: a first server obtains first requirement information; the first server sends the first requirement information to the second server, the second server splits the first requirement information into multiple second requirement information and sends them to the second server; the first server receives multiple second requirement information sent by the second server, and constructs a use case generation prompt word corresponding to each second requirement information; the first server sends multiple second requirement information and use case generation prompt words corresponding to each second requirement information to the second server, and the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; the first server receives multiple sub-test cases sent by the second server, and the first server aggregates multiple sub-test cases to obtain a target test case. In the embodiment of the present application, the first requirement information is split into multiple second requirement information by the second server, and a corresponding sub-test case is generated for each second requirement information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved, the quality of test cases for complex requirements is greatly improved, and the problem of incomplete test coverage caused by insufficient test cases is avoided.

[0163] The present application provides a test case generation method, which can be executed by a test case generation system. Figure 5 As shown, the test case generation method provided in the embodiment of the present application mainly includes steps S401 to S409.

[0164] S401: Utilize a first server to obtain first demand information.

[0165] S402: Use the first server to send first demand information to the second server.

[0166] S403: Use the second server to split the first demand information into multiple pieces of second demand information.

[0167] S404: Use the second server to send multiple second demand information to the first server.

[0168] S405: Utilize the first server to receive a plurality of second demand information sent by the second server, and construct a use case generation prompt word corresponding to each second demand information.

[0169] S406: Use the first server to send a plurality of second demand information and a use case generation prompt word corresponding to each second demand information to the second server.

[0170] S407: Generate a sub-test case using the second server based on the use case generation prompt word and the second requirement information.

[0171] S408: Use the second server to send the sub-test case to the first server.

[0172] S409: Utilize the first server to receive multiple sub-test cases sent by the second server, aggregate the multiple sub-test cases, and obtain a target test case.

[0173] The various steps in the embodiments of the present application are the same as the processes in the various steps in the above embodiments. For details, please refer to the description in the above embodiments, and no specific limitations are given in the embodiments of the present application.

[0174] The embodiment of the present application provides a test case generation method, which includes: using a first server to obtain first demand information; using the first server to send the first demand information to the second server; using the second server to split the first demand information into multiple second demand information; using the second server to send multiple second demand information to the first server; using the first server to receive multiple second demand information sent by the second server, and constructing a use case generation prompt word corresponding to each second demand information; using the first server to send multiple second demand information and use case generation prompt words corresponding to each second demand information to the second server; using the second server to generate sub-test cases based on the use case generation prompt word and the second demand information; using the second server to send sub-test cases to the first server; using the first server to receive multiple sub-test cases sent by the second server, aggregating multiple sub-test cases to obtain a target test case. In the embodiment of the present application, the first demand information is split into multiple second demand information by the second server, and a corresponding sub-test case is generated for each second demand information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved. The quality of test cases for complex requirements is greatly improved, and the problem of incomplete test coverage caused by insufficient test cases is avoided.

[0175] Based on the above embodiments, the present application provides a test case generation system, such as Figure 6 As shown, the test case generation system includes a first server 61 and a second server 62, wherein the first server 61 and the second server 62 interact to implement the test case generation method provided in the above embodiment.

[0176] Specifically, Figure 6 As shown, the test case generation method provided in the embodiment of the present application mainly includes:

[0177] S601. The first server 61 obtains first demand information.

[0178] S602 : The first server 61 sends first demand information to the second server 62 .

[0179] S603: The second server 62 splits the first demand information into multiple pieces of second demand information.

[0180] S604 , the second server 62 sends a plurality of the second demand information to the first server 61 .

[0181] S605: The first server 61 constructs a use case generation prompt word corresponding to each of the second demand information.

[0182] S606: The first server 61 sends a plurality of second demand information and a use case generation prompt word corresponding to each piece of second demand information to the second server 62.

[0183] S607 , the second server 62 generates a sub-test case for each second requirement information based on the second requirement information and a use case generation prompt word corresponding to the second requirement information.

[0184] S608 : The second server 62 sends the sub-test case to the first server 61 .

[0185] S609: The first server 61 aggregates the multiple sub-test cases to obtain a target test case.

[0186] S610: The first server 61 converts the target test case from a text language form into a mind map form.

[0187] In the embodiment of the present application, the interaction process between the first server and the second server is introduced. The specific process in each step can refer to the description in the above embodiment and is not specifically limited in the embodiment of the present application.

[0188] The test case system provided in the embodiment of the present application splits the first requirement information into multiple second requirement information through the second server, and generates corresponding sub-test cases for each second requirement information. The first server aggregates the multiple sub-test cases to obtain the target test case. This solves the problem of limited number of tests generated when complex and diversified product requirements are met. It greatly improves the quality of test cases for complex requirements and avoids the problem of incomplete test coverage caused by insufficient test cases.

[0189] Based on the above embodiments, a system block diagram of a method for executing test case generation in an embodiment of the present application is provided. Figure 7 As shown, the system for executing the test case generation method provided in the embodiment of the present application mainly includes: a first client 71, a first server 72, a second server 73, a mind map server 74 and a mind map client 75.

[0190] The first client 71 is used to display Figure 2The window shown guides the user to input the product requirement information, prompt words and sub-directory options required for the test case. The first server 72 is connected to the first client 71 for communication. The first server 72 obtains the product requirement information, prompt words and sub-directory options input by the user through the first client 71, and generates the test case by interacting with the second server 73. After the first server 72 aggregates the target test case, it calls the mind map server 74 to convert the target test case into a mind map. The mind map server 74 sends the tree structure of the test case to the mind map client 75, and the mind map client 75 displays the tree structure of the test case. In addition, the first client 71 Figure 2 The windows shown may be displayed in a nested form in the user interface of the mind mapping client 75 .

[0191] The specific process of the first server 72 and the second server 73 interacting to generate test cases can be found in the description of the above embodiment, and will not be described in detail in the embodiment of the present application.

[0192] In summary, the test case generation method provided by this application mainly includes the following beneficial effects:

[0193] 1) Without the user's awareness, AIGC and the high-quality prompt words given by the system can cleverly split complex and diversified product requirements into multiple sub-requirements, and generate test cases for each sub-requirement, solving the problem of limited number of generated test cases for complex and diversified product requirements, greatly improving the quality of AIGC-generated test cases for complex requirements, and avoiding incomplete test coverage caused by insufficient test cases.

[0194] 2) AIGC technology is used to automatically generate structured test cases based on product requirements / sub-requirements and high-quality prompts given by the system, which improves the efficiency of test case generation and can cover more test scenarios, thereby improving test coverage.

[0195] 3) Automatically convert the structured use cases generated by AIGC into mind map use cases without any perception, eliminating the tedious steps of manual conversion by users and reducing the workload of users.

[0196] Figure 8 is a schematic diagram of the structure of a test case generating device in an embodiment of the present application, such as Figure 8 As shown, the test case generating device 80 provided in the embodiment of the present application mainly includes: an information acquisition module 81, a first sending module 82, a first receiving module 83, a second sending module 84, and a test case aggregation module 85.

[0197] Among them, the information acquisition module 81 is used to acquire the first requirement information; the first sending module 82 is used to send the first requirement information to the second server, so that the second server splits the first requirement information into multiple second requirement information; the first receiving module 83 is used to receive the multiple second requirement information sent by the second server, and construct a use case generation prompt word corresponding to each second requirement information; the second sending module 84 is used to send the multiple second requirement information and the use case generation prompt word corresponding to each second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; the test case aggregation module 85 is used to receive the multiple sub-test cases sent by the second server, aggregate the multiple sub-test cases, and obtain the target test case.

[0198] The embodiment of the present application provides a test case generation device, which is used to perform the following process: obtain first demand information; when the first demand information meets the set conditions, send the first demand information to the second server, so that the second server splits the first demand information into multiple second demand information; receive multiple second demand information sent by the second server, and construct a use case generation prompt word corresponding to each second demand information; send multiple second demand information and use case generation prompt words corresponding to each second demand information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second demand information; receive multiple sub-test cases sent by the second server, aggregate multiple sub-test cases, and obtain a target test case. In the embodiment of the present application, the first demand information is split into multiple second demand information by the second server, and a corresponding sub-test case is generated for each second demand information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved. The quality of test cases for complex requirements is greatly improved, and the incomplete test coverage caused by insufficient test cases is avoided.

[0199] In a possible implementation, the first sending module 82 is specifically used to determine whether the first demand information meets the first set condition; if the first demand information meets the first set condition, generate a demand splitting prompt word; send the first demand information and the demand splitting prompt word to the second server, and the demand splitting prompt word is used to instruct the second server to split the first demand information.

[0200] In a possible implementation, the first sending module 82 is specifically used to count the number of text words included in the first demand information; determine whether the number of text words is greater than the set number of words; if the number of text words is greater than the set number of words, determine that the first demand information meets the first set condition.

[0201] In a possible implementation, the demand splitting prompt word includes a demand splitting instruction and a demand splitting rule; wherein the demand splitting rule includes: splitting according to the directory structure of the first demand information.

[0202] In a possible implementation, the device also includes: a verification optimization module, which is used to perform format verification on the second demand information for each second demand information; if the format verification passes, constructing a use case corresponding to the second demand information to generate prompt words; if the format verification fails, counting the number of times the format verification fails; if the number of times the format verification fails is less than a set number of times, optimizing the format of the second demand information, and returning to execute the step of performing format verification on the second demand information; if the number of times the format verification fails is greater than or equal to the set number of times, returning to execute the step of sending the first demand information and the demand splitting prompt words to the second server.

[0203] In a possible implementation, the target test case is represented in a text language form; the device also includes a format conversion module, which is used to convert the target test case from the text language form to the mind map form.

[0204] In one possible implementation, the format conversion module is specifically used to obtain relevant information of each sub-test case expressed in a text language; convert the relevant information expressed in a text language into relevant information expressed in a mind map format to obtain a tree structure corresponding to the target test case; determine the parent node corresponding to each sub-test case; and connect the tree structure corresponding to the target test case as a subtree to the parent node.

[0205] Fig. 9 is a schematic diagram of the structure of a test case generating device in an embodiment of the present application, such as Fig. 9 As shown, the test case generating device 90 provided in the embodiment of the present application mainly includes: a second receiving module 91, an information splitting module 92, a third sending module 93, a third receiving module 94, a test case generating module 95 and a fourth sending module 96.

[0206] Among them, the second receiving module 91 is used to receive the first demand information sent by the first server; the information splitting module 92 is used to split the first demand information into multiple second demand information; the third sending module 93 is used to send multiple second demand information to the first server, so that the first service constructs a use case generation prompt word based on the second demand information; the third receiving module 94 is used to receive multiple second demand information sent by the first server and the use case generation prompt word corresponding to each second demand information, and the test case generation module 95 is used to generate a sub-test case for each second demand information based on the second demand information and the use case generation prompt word corresponding to the second demand information; the fourth sending module 96 is used to send the sub-test case to the first server, so that the first server aggregates multiple sub-test cases to obtain the target test case.

[0207] In a possible implementation, the second receiving module 91 is specifically used to receive the first demand information and demand splitting prompt words sent by the first server; the information splitting module 92 is specifically used to split the first demand information into multiple second demand information based on the demand splitting prompt words after receiving the demand splitting prompt words.

[0208] In one possible implementation, the information splitting module 92 is specifically used to parse the demand splitting prompt words to obtain demand splitting instructions and demand splitting rules; wherein the demand splitting rules include: splitting according to the directory structure of the first demand information; extracting the directory structure in the first demand information; splitting the first demand information into multiple second demand information according to the directory structure.

[0209] In one possible implementation, the information splitting module 92 is specifically used to take the first-level directory as the first directory and the first demand information as the current demand information; split the current demand information into multiple initial demand information according to the first directory; determine whether the number of text words of each initial demand information exceeds the set number of words; for each initial demand information, if the number of text words of the initial demand information exceeds the set number of words, obtain the subdirectory under the directory corresponding to the initial demand information; take the subdirectory as the first directory and the initial demand information as the current demand information, and return to execute the step of splitting the current demand information into multiple initial demand information according to the first directory; until the number of text words of all initial demand information does not exceed the set number of words, the obtained initial demand information whose text word number does not exceed the set number of words is used as the second demand information.

[0210] The embodiment of the present application provides a test case generation device, which is used to perform the following process: receiving first demand information sent by a first server; splitting the first demand information into multiple second demand information; sending multiple second demand information to the first server, so that the first service constructs a use case generation prompt word based on the second demand information; receiving multiple second demand information sent by the first server and the use case generation prompt word corresponding to each second demand information, for each second demand information, generating a sub-test case based on the second demand information and the use case generation prompt word corresponding to the second demand information; sending the sub-test case to the first server, so that the first server aggregates multiple sub-test cases to obtain a target test case. In the embodiment of the present application, the first demand information is split into multiple second demand information by the second server, and a corresponding sub-test case is generated for each second demand information, and the first server aggregates multiple sub-test cases to obtain a target test case. The problem of limited number of generated tests when complex and diversified product requirements are solved. The quality of test cases for complex requirements is greatly improved, and the incomplete test coverage caused by insufficient test cases is avoided.

[0211] The test case generation device provided in the embodiment of the present application can execute the test case generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0212] Fig.10 Schematic diagram of the structure of a test case generation device provided in this embodiment. Fig.10 As shown, the electronic device 1000 includes a processor 1010, a memory 1020, an input device 1030, and an output device 1040; the number of processors 1010 in the electronic device can be one or more. Fig.10 A processor 1010 is taken as an example; the processor 1010, the memory 1020, the input device 1030 and the output device 1040 in the electronic device can be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0213] The memory 1020, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the test case generation method in the embodiment of the present invention. The processor 1010 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 1020, that is, the test case generation method provided in the embodiment of the present invention is implemented.

[0214] The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 1020 may further include a memory remotely arranged relative to the processor 1010, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0215] The input device 1030 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 1040 may include a display device such as a display screen.

[0216] This embodiment also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the test case generation method provided in the embodiment of the present invention.

[0217] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the test case generation method provided by any embodiment of the present invention.

[0218] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0219] It is worth noting that in the embodiment of the above-mentioned test case generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0220] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0221] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A test case generation method, characterized in that: The method is applied to a first server, and the method includes: Obtaining the first demand information; Sending the first demand information to a second server, so that the second server splits the first demand information into a plurality of second demand information; receiving a plurality of the second demand information sent by the second server, and constructing a use case generation prompt word corresponding to each of the second demand information; Sending a plurality of the second requirement information and a use case generation prompt word corresponding to each of the second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; The plurality of sub-test cases sent by the second server are received, and the plurality of sub-test cases are aggregated to obtain a target test case.

2. The method according to claim 1, characterized in that The sending the first requirement information to the second server includes: Determining whether the first requirement information meets a first set condition; When the first demand information satisfies the first set condition, generating a demand splitting prompt word; The first demand information and the demand splitting prompt word are sent to the second server, where the demand splitting prompt word is used to instruct the second server to split the first demand information.

3. The method according to claim 2, characterized in that Determining whether the first requirement information satisfies a first set condition includes: Counting the number of words in the text included in the first demand information; Determine whether the number of words in the text is greater than a set number of words; If the number of words in the text is greater than the set number of words, it is determined that the first requirement information meets the first set condition.

4. The method according to claim 2, characterized in that: The demand splitting prompt words include demand splitting instructions and demand splitting rules; The demand splitting rule includes: splitting according to the directory structure of the first demand information.

5. The method according to claim 1, characterized in that After receiving the plurality of second demand information sent by the second server, the method further includes: For any of the second requirement information, performing format verification on the second requirement information; If the format check passes, constructing a use case corresponding to the second requirement information to generate prompt words; If the format check fails, counting the number of times the format check fails; If the number of times the format check fails is less than the set number, the format of the second demand information is optimized, and the step of performing format check on the second demand information is returned to be executed; If the number of times the format check fails is greater than or equal to the set number, the process returns to executing the step of sending the first demand information and the demand splitting prompt word to the second server.

6. The method according to claim 1, characterized in that The target test case is expressed in a text language form; the method further comprises: The target test case is converted from a text language form into a mind map form.

7. The method according to claim 6, characterized in that The step of converting the target test case from a text language form into a mind map form includes: Obtaining relevant information of each of the sub-test cases expressed in a text language form; Convert the relevant information expressed in the form of text language into relevant information expressed in the form of a mind map to obtain a tree structure corresponding to the target test case; Determine the parent node corresponding to each of the sub-test cases; The tree structure corresponding to the target test case is connected to the parent node as a subtree.

8. A test case generation method, characterized in that: The method is applied to the second server, and the method includes: Receiving first demand information sent by a first server; Splitting the first demand information into multiple pieces of second demand information; Sending a plurality of the second demand information to the first server, so that the first service constructs a use case based on the second demand information to generate prompt words; receiving a plurality of the second demand information sent by the first server and a use case generation prompt word corresponding to each piece of the second demand information; For each of the second requirement information, generating a sub-test case based on the second requirement information and a use case generation prompt word corresponding to the second requirement information; The sub-test cases are sent to the first server, so that the first server aggregates a plurality of the sub-test cases to obtain a target test case.

9. The method according to claim 8, characterized in that Receiving first demand information sent by a first server, including: Receiving the first demand information and the demand splitting prompt word sent by the first server; The first requirement information is split into a plurality of second requirement information, including: After receiving the demand splitting prompt word, the first demand information is split into a plurality of second demand information based on the demand splitting prompt word.

10. The method according to claim 9, characterized in that Splitting the first demand information into a plurality of second demand information based on the demand splitting prompt word; Parsing the demand splitting prompt words to obtain demand splitting instructions and demand splitting rules; wherein the demand splitting rules include: splitting according to the directory structure of the first demand information; Extracting the directory structure in the first requirement information; The first demand information is split into multiple pieces of second demand information according to the directory structure.

11. The method according to claim 10, characterized in that The demand splitting rules also include: setting the word count; The first requirement information is split into a plurality of second requirement information according to the directory structure, including: The first-level directory is used as the first directory, and the first demand information is used as the current demand information; Splitting the current demand information into multiple initial demand information according to the first directory; Determine whether the number of words in the text of each of the initial demand information exceeds a set number of words; For each initial demand information, if the number of characters in the text of the initial demand information exceeds the set number of characters, obtaining a subdirectory under the directory corresponding to the initial demand information; Taking the subdirectory as the first directory, taking the initial demand information as the current demand information, and returning to execute the step of splitting the current demand information into a plurality of initial demand information according to the first directory; Until the word counts of all the texts of the initial demand information do not exceed the set word count, the initial demand information whose word counts do not exceed the set word count is taken as the second demand information.

12. A test case generation method, characterized in that: The method comprises: Using the first server to obtain first demand information; Using the first server to send the first demand information to the second server; Using the second server to split the first demand information into multiple pieces of second demand information; Using the second server to send a plurality of the second demand information to the first server; Using the first server to receive a plurality of the second demand information sent by the second server, and constructing a use case generation prompt word corresponding to each of the second demand information; Using the first server to send a plurality of the second demand information and a use case generation prompt word corresponding to each of the second demand information to the second server; Using the second server to generate a sub-test case based on the use case generation prompt word and the second requirement information; Using the second server to send the sub-test case to the first server; The first server is used to receive the plurality of sub-test cases sent by the second server, and the plurality of sub-test cases are aggregated to obtain a target test case.

13. A test case generation system, characterized in that: The system includes a first server and a second server; The first server is used to execute the test case generation method according to any one of claims 1 to 7; The second server is used to execute the test case generation method as described in any one of claims 8-11.

14. A test case generating device, characterized in that: The device is configured on a first server, and includes: An information acquisition module, used for acquiring first demand information; A first sending module, configured to send the first demand information to a second server, so that the second server splits the first demand information into a plurality of second demand information; A first receiving module, configured to receive a plurality of the second demand information sent by the second server, and construct a use case generation prompt word corresponding to each of the second demand information; A second sending module, used for sending a plurality of the second requirement information and a use case generation prompt word corresponding to each of the second requirement information to the second server, so that the second server generates a sub-test case based on the use case generation prompt word and the second requirement information; The test case aggregation module is used to receive the multiple sub-test cases sent by the second server, aggregate the multiple sub-test cases, and obtain a target test case.

15. A test case generating device, characterized in that: The device is configured on the second server, and the device includes: A second receiving module, used for receiving the first demand information sent by the first server; An information splitting module, used for splitting the first demand information into a plurality of second demand information; A third sending module is used to send a plurality of the second demand information to the first server, so that the first service constructs a use case based on the second demand information to generate prompt words; The third receiving module is configured to receive a plurality of pieces of the second demand information and a use case generation prompt word corresponding to each piece of the second demand information sent by the first server, A test case generation module, configured to generate a sub-test case for each of the second requirement information based on the second requirement information and a use case generation prompt word corresponding to the second requirement information; The fourth sending module is used to send the sub-test case to the first server, so that the first server aggregates multiple sub-test cases to obtain a target test case.

16. A test case generating device, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the test case generation method as described in any one of claims 1-7, or the test case generation method as described in any one of claims 8-11.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the test case generation method as described in any one of claims 1 to 7 is implemented, or the test case generation method as described in any one of claims 8 to 11 is implemented.