Test case generation method and device, storage medium and electronic equipment

By obtaining background knowledge such as agile work items and using big models to generate test case scenarios and groups, the problems of low quality and poor practicality in the existing technology are solved, and high-quality and efficient test case generation is achieved.

CN119597670APending Publication Date: 2025-03-11CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411749252.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art is of low quality and low practicality when generating test cases, and lacks contextual information, making it difficult to use the generated test cases directly.

Method used

By obtaining agile work items, test requirements information and application editing interface information as background knowledge, using two trained large models to determine the test case scenarios and groups separately, users can adjust the scene in real time and select and edit the target test cases from multiple alternative test cases.

Benefits of technology

It significantly improves the quality and practicality of test case generation, reduces the repetitive work of testers in the use case writing process, and improves test coverage and writing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597670A_ABST
    Figure CN119597670A_ABST
Patent Text Reader

Abstract

The invention provides a test case generation method and device, a storage medium and electronic equipment, and relates to the technical field of artificial intelligence. The method comprises the following steps: acquiring agile work items, test demand information and application program editing interface information as background knowledge; inputting the background knowledge and the generation instruction into a first large model, and determining a test case scene; in response to adjustment of the test case scene, inputting the adjusted test case scene and background knowledge into the second large model, and determining a test case group; the test case group comprises a plurality of alternative test cases; the first large model and the second large model are dialogue type large models which are obtained through training and command prompt packaging; and in response to selection of a target test case from the test case group and editing of the target test case, determining an output test case. And the efficiency and the quality of test case generation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Test case is an important document in the software testing process, and the existing test case writing scheme has certain limitations.

[0003] The solution of manually writing test cases is time-consuming, labor-intensive, involves a lot of repetitive work, and is prone to inconsideration due to personal experience and other reasons, resulting in low quality test cases.

[0004] For the solution of test case generation based on a specific model, the specific model generally needs to be trained with a large number of test cases in advance. Under the assumption of a specific model, test cases can be generated using strategies such as equivalence classes, boundary values, and causal diagrams. However, this method requires a large number of test cases as training data in the early stage, and the problem needs to be described in a format that can be recognized by the machine. It is very restrictive and the generated test cases are not very practical.

[0005] Test case generation based on big models usually generates test cases according to user descriptions. This method lacks relevant contextual background information, and due to the uncertainty of the output format of the big model, the generated test cases are of low quality and poor practicality.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] The present disclosure provides a test case generation method and device, a storage medium and an electronic device, which at least to a certain extent overcome the problems of low quality and poor practicality of generated test cases due to related technologies.

[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0009] According to one aspect of the present disclosure, a test case generation method is provided, comprising:

[0010] Obtain agile work items, test requirement information, and application programming interface information as background knowledge;

[0011] Inputting the background knowledge and generation instructions into a first large model to determine a test case scenario;

[0012] In response to the adjustment of the test case scenario, the adjusted test case scenario and the background knowledge are input into the second large model to determine a test case group; the test case group includes a plurality of candidate test cases; the first large model and the second large model are conversational large models that are trained and encapsulated through a command prompt;

[0013] In response to selecting a target test case from the test case group and editing the target test case, an output test case is determined.

[0014] In some embodiments, obtaining agile work items, test requirement information, and application programming interface information as background knowledge includes:

[0015] Connecting to a development and operation platform through a capability exposure interface; the development and operation platform includes agile management functions, test management functions, and application programming interface management functions;

[0016] Acquire agile work items, test requirement information and application programming interface information from the requirement management function, test management function and application programming interface management function;

[0017] Agile work items, test requirement information and application programming interface information are used as background knowledge for test case generation.

[0018] In some embodiments, the background knowledge and the generation instructions are input into the first large model to determine the test case scenario, including:

[0019] Analyze the summary information of the background knowledge and extract test case related information;

[0020] Preprocessing the test case related information to determine background related information;

[0021] The background association information and the generation instruction are input into the first large model, so that the first large model analyzes the background association information according to the generation instruction and outputs the test case scenario in a set format.

[0022] In some embodiments, preprocessing the test case association information to determine background association information includes:

[0023] The test case related information is subjected to format conversion, target information screening, intent recognition, text segmentation and other operations to determine background related information.

[0024] In some embodiments, in response to the adjustment of the test case scenario, the adjusted test case scenario and the background knowledge are input into the second largest model to determine the test case group, including:

[0025] Converting the test case scenario into a scenario mind map; the scenario mind map includes a central node and multiple branches connecting the central node, each branch of the multiple branches consists of multiple steps;

[0026] The scenario mind map and step adjustment guide are displayed to the user; the step adjustment guide is used to guide the user to add steps, delete steps, and adjust the order of steps;

[0027] In response to the user adjusting the scenario mind map according to the step adjustment guide, determining an adjusted test case scenario;

[0028] Inputting the adjusted test case scenario and the background knowledge into the second large model, so that the second large model extracts the test case scenario and determines the test case step description;

[0029] Based on the test case scenario, the adjusted test case scenario and the test case step description, a plurality of candidate test cases are determined to form a test case group.

[0030] In some embodiments, in response to selecting a target test case from the test case group and editing the target test case, determining an output test case includes:

[0031] Presenting multiple alternative test cases included in the test case group to the user;

[0032] In response to a user selecting a target test case from the plurality of candidate test cases, caching the target test case;

[0033] The target test case and the editing instruction are input into the second large model, so that the second large model edits and adjusts the target test case according to the editing instruction to determine the output test case.

[0034] According to another aspect of the present disclosure, there is also provided a test case generating device, comprising:

[0035] A background knowledge acquisition module is used to acquire agile work items, test requirement information, and application program editing interface information as background knowledge;

[0036] A test case scenario determination module, used to input the background knowledge and generation instructions into the first large model to determine the test case scenario;

[0037] A test case group determination module is used to input the adjusted test case scenario and the background knowledge into a second large model in response to the adjustment of the test case scenario, and determine a test case group; the test case group includes a plurality of candidate test cases; the first large model and the second large model are conversational large models that are trained and encapsulated through a command prompt;

[0038] The output test case determination module is used to determine the output test case in response to selecting a target test case from the test case group and editing the target test case.

[0039] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the test case generation methods described above by executing the executable instructions.

[0040] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the test case generation method described in any one of the above is implemented.

[0041] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above test case generation methods.

[0042] The test case generation method and device, storage medium and electronic device provided in the embodiments of the present invention include: obtaining agile work items, test requirement information and application editing interface information as background knowledge; inputting the background knowledge and generation instructions into a first large model to determine a test case scenario; in response to adjustment of the test case scenario, inputting the adjusted test case scenario and background knowledge into a second large model to determine a test case group; the test case group includes multiple alternative test cases; the first large model and the second large model are conversational large models that have been trained and encapsulated through a command prompt; in response to selecting a target test case from the test case group and editing the target test case, determining an output test case. The disclosed embodiment obtains agile work items, test requirement information and application editing interface information as background knowledge, enhances the contextual background information in the test case generation process, and can significantly improve the quality of test case generation; then the background knowledge and generation instructions are input into the first large model to obtain the test case scenario, and through interaction with the user, the user can adjust the test case scenario in real time, avoiding the situation where too much repeated information leads to low quality when the test case is directly output; then the adjusted test case scenario and background knowledge are input into the second large model to determine the test case group consisting of multiple alternative test cases; compared with manual analysis, the first large model and the second large model can fully consider various extreme abnormal situations through comprehensive background information, avoid the situation of missing important scenarios, and improve the coverage of software testing. The user selects the target test case from multiple alternative test cases and edits it, realizing the necessary adjustment of the test case output by the large model at any time, which can improve the practicality of the test case. Using this embodiment can greatly reduce the repetitive work of testers in the case writing process and improve the efficiency of test case writing.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0045] Figure 1 A schematic diagram showing the system structure of a test case generation method in an embodiment of the present disclosure.

[0046] Figure 2 A schematic diagram of a test case generation method in an embodiment of the present disclosure is shown.

[0047] Figure 3 A schematic diagram of a background knowledge determination process of a test case generation method in an embodiment of the present disclosure is shown.

[0048] Figure 4 A schematic diagram of a test case scenario determination process of a test case generation method in an embodiment of the present disclosure is shown.

[0049] Figure 5 A schematic diagram of a test case group determination process of a test case generation method in an embodiment of the present disclosure is shown.

[0050] Figure 6 A schematic diagram of a process of determining an output test case of a test case generation method in an embodiment of the present disclosure is shown.

[0051] Figure 7 A schematic diagram of a test case generating device in an embodiment of the present disclosure is shown.

[0052] Figure 8 A structural block diagram of a computer device for a test case generation method in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0053] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0054] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0055] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:

[0056] A test case is a detailed document in the software testing process that defines how to test specific functions or features of the software. It can help testers systematically verify whether the software functions meet the requirements and discover potential problems. Through detailed test cases, the coverage and efficiency of the test can be improved, ensuring the stability and reliability of the software.

[0057] Large Language Model (LLM) refers to a large machine learning model used in the field of artificial intelligence, especially in natural language processing and computer vision. It can understand and generate natural language by pre-training on large-scale text data.

[0058] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0059] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the test case generation method in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .

[0060] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103, and can be a wired network or a wireless network.

[0061] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0062] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.

[0063] Optionally, the client of the application installed in different terminal devices 101 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.

[0064] The server 103 may be a server that provides various services, such as a background management server that provides support for the device operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.

[0065] Optionally, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.

[0066] Those skilled in the art will know that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs, and the embodiments of the present disclosure do not limit this.

[0067] Under the above system architecture, a test case generation method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.

[0068] In some embodiments, the test case generation method provided in the embodiments of the present disclosure can be executed by a terminal device of the above-mentioned system architecture; in other embodiments, the test case generation method provided in the embodiments of the present disclosure can be executed by a server in the above-mentioned system architecture; in other embodiments, the test case generation method provided in the embodiments of the present disclosure can be implemented by the terminal device and the server in the above-mentioned system architecture through interaction.

[0069] There are some problems when using large models to generate test cases, mainly including: uncertainty in the model output format, lack of contextual information, and the generated test cases are of low quality and poor practicality. Since the test case generation is not associated with the software test management platform, the test cases cannot be used directly. Subsequent format conversion and import into the test management platform are also required, and the efficiency is not high. There is a lack of interaction with users during the generation process, and if the large model is misunderstood, the user cannot correct it.

[0070] Figure 2 A schematic diagram of a test case generation method in an embodiment of the present disclosure is shown. Figure 2 As shown, the test case generation method provided in the embodiment of the present disclosure includes the following steps:

[0071] Step S202: Acquire agile work items, test requirement information, and application program editing interface information as background knowledge;

[0072] Step S204: inputting background knowledge and generation instructions into the first large model to determine the test case scenario;

[0073] Step S206: In response to the adjustment of the test case scenario, the adjusted test case scenario and background knowledge are input into the second large model to determine a test case group; the test case group includes a plurality of candidate test cases; the first large model and the second large model are conversational large models that are trained and encapsulated through a command prompt;

[0074] Step S208: In response to selecting a target test case from the test case group and editing the target test case, an output test case is determined.

[0075] The disclosed embodiment obtains agile work items, test requirement information and application editing interface information as background knowledge, enhances the contextual background information in the test case generation process, and can significantly improve the quality of test case generation; then the background knowledge and generation instructions are input into the first large model to obtain the test case scenario, and through interaction with the user, the user can adjust the test case scenario in real time, avoiding the situation where too much repeated information leads to low quality when the test case is directly output; then the adjusted test case scenario and background knowledge are input into the second large model to determine the test case group consisting of multiple alternative test cases; compared with manual analysis, the first large model and the second large model can fully consider various extreme abnormal situations through comprehensive background information, avoid the situation of missing important scenarios, and improve the coverage of software testing. The user selects the target test case from multiple alternative test cases and edits it, realizing the necessary adjustment of the test case output by the large model at any time, which can improve the practicality of the test case. Using this embodiment can greatly reduce the repetitive work of testers in the case writing process and improve the efficiency of test case writing.

[0076] Figure 3 A schematic diagram of a background knowledge determination process of a test case generation method according to an embodiment of the present disclosure is shown. Figure 3 As shown, in the embodiment, obtaining agile work items, test requirement information, and application program editing interface information as background knowledge includes:

[0077] Step S302: connecting to a development and operation platform through a capability exposure interface; the development and operation platform includes a demand management function, a test management function, and an application editing interface management function;

[0078] Step S304: Obtaining agile work items, test requirement information and application programming interface information from the requirement management function, the test management function and the application programming interface management function;

[0079] Step S306: Use the agile work items, test requirement information and application editing interface information as background knowledge for test case generation.

[0080] The development and operation platform (DevOps) can provide functions such as requirements management, test management, and API (Application Programming Interface) management in software development projects. Agile work items are stored in the requirements management function. Test requirements information is stored in the test management function, generally in the form of test requirements documents. API information is stored in the API management function, generally in the form of API documents.

[0081] The development and operation platform provides a capability exposure interface, through which agile work items, test requirement information and application editing interface information can be queried from the requirement management function, test management function and application editing interface management function. By using agile work items, test requirement information and application editing interface information as background knowledge for test case generation, the relevant contextual background knowledge of the test case can be increased, thereby significantly improving the generation quality of the test case. In some practical applications, the output test cases obtained using the embodiments of the present disclosure have a user adoption rate of 40%, which is nearly 100% higher than the test cases generated by directly inputting user descriptions into the large model, achieving a significant improvement in the quality of test case generation.

[0082] Figure 4 A schematic diagram of the process of determining a test case scenario in a test case generation method according to an embodiment of the present disclosure is shown. Figure 4 As shown, in the embodiment, background knowledge and generation instructions are input into the first large model to determine the test case scenario, including:

[0083] Step S402: Analyze the summary information of the background knowledge and extract the test case related information;

[0084] Step S404: pre-processing the test case related information to determine the background related information;

[0085] Step S406: input the background association information and the generation instruction into the first large model, so that the first large model analyzes the background association information according to the generation instruction and outputs the test case scenario according to the set format.

[0086] In the embodiment, the conversational large model is pre-trained to obtain a conversational large model related to test case generation, and the Prompt project is executed through the command prompt (Prompt), and the trained conversational large model is encapsulated into a first large model and a second large model; wherein the first large model is used to analyze the background association information according to the generation instruction, and output the test case scenario according to the set format. By configuring the setting format for the first large model in advance, the format of the test case scenario output by the first large model is unified, thereby improving the quality and practicality of the generated test case. The second large model is used to extract the test case scenario according to the adjusted test case scenario and background knowledge, and output the test case step description. The generation instruction is used to describe the required generated test scenario, the function and business process of the system under test, and the purpose and type of the test. The generation instruction can be entered in the form of a dialogue edit box.

[0087] The amount of background knowledge data obtained from the development and operation platform DevOps is large and the types are complex. First, the background knowledge needs to be analyzed and summarized to obtain summary information, and the associated information of the summary information is extracted to obtain test case associated information; further, the test case associated information is preprocessed to facilitate semantic understanding and analysis by the first large model. In an embodiment, the test case associated information is preprocessed, including: format conversion, target information screening, intent recognition, text segmentation and other operations on the test case associated information to determine the background associated information.

[0088] Among them, the format conversion operation refers to converting non-text data in the test case associated information into text data, such as converting HTML, Markdown, JSON and other formats into text. Filtering target information refers to extracting content related to the test case from the text of the test case associated information. Intent recognition refers to identifying the user's intention from the text, such as the scenarios that need to be tested, test objectives, etc. Text segmentation refers to converting long texts whose length exceeds the set threshold into a paragraph of text consisting of multiple short sentences, so as to facilitate semantic understanding of the large model and avoid ambiguity.

[0089] The background association information and the generation instructions are input into the first large model. The first large model analyzes the background association information according to the generation instructions and outputs the test case scenario according to the set format. The test case scenario refers to the specific test environment and conditions designed to verify specific functions or features in software testing.

[0090] Figure 5 A schematic diagram of a test case group determination process of a test case generation method in an embodiment of the present disclosure is shown. Figure 5 As shown, in the embodiment, in response to the adjustment of the test case scenario, the adjusted test case scenario and background knowledge are input into the second largest model to determine the test case group, including:

[0091] Step S502: converting the test case scenario into a scenario mind map; the scenario mind map includes a central node and multiple branches connecting the central node, each branch of the multiple branches is composed of multiple steps;

[0092] Step S504: showing the scene mind map and step adjustment guide to the user; the step adjustment guide is used to guide the user to add steps, delete steps and adjust the order of steps;

[0093] Step S506: In response to the user adjusting the scenario mind map according to the step adjustment guide, determining an adjusted test case scenario;

[0094] Step S508: inputting the adjusted test case scenario and background knowledge into the second largest model, so that the second largest model extracts the test case scenario and determines the test case step description;

[0095] Step S5010: According to the test case scenario, the adjusted test case scenario and the test case step description, a plurality of candidate test cases are determined to form a test case group.

[0096] Based on the first large model, the test case scenario is generated, and the user needs to adjust the test case scenario according to the actual situation. Specifically, if a step in the test case scenario is directly modified, it is necessary to traverse other steps associated with the modified step from the test case scenario and modify these other steps in an associated manner. In this way, each time a step is modified, many other associated steps need to be modified, which is very labor-intensive and computationally intensive. Therefore, this embodiment converts the test case scenario into a scenario mind map.

[0097] Mind Map is a graphical thinking tool used to visualize and organize information, ideas, and concepts. It imitates the natural way of thinking in the human brain, radiating branches outward from a central node, each branch represents a sub-topic or related idea, and the branch is a multi-level structure from primary to secondary. This structure helps to better understand and remember information, while promoting creative thinking and problem-solving skills.

[0098] The scene mind map converted in this embodiment includes a central node and multi-level branches connecting the central node, and each branch in the multi-level branches consists of multiple steps. If one of the steps is modified, the other related steps can be directly displayed in the scene mind map, and based on the structure of the multi-level branches, the other steps associated with the current modification can be automatically modified synchronously, saving a lot of manpower and computing resources.

[0099] The scenario mind map obtained above is displayed to the user on the scenario analysis display interface, so that the user can intuitively understand the entire test case scenario. At the same time, the step adjustment guide is further displayed to the user on the scenario mind map, and the step adjustment guide can be used to guide the user to add steps, delete steps, and adjust the step order.

[0100] The user adjusts the steps in the scenario mind map according to the actual test requirements; each time the step is adjusted, the leaf node will generate a corresponding use case; the leaf node refers to the central node of the secondary branch. In response to the user's adjustment of the scenario mind map according to the step adjustment guide, an adjusted test case scenario is obtained.

[0101] The adjusted test case scenario and background knowledge are input into the second largest model, and the second largest model extracts the test case scenario from the adjusted test case scenario and background knowledge input to obtain the test case step description. The test case step description is a very critical part of the test case, which details how to perform the test to verify a specific function or feature. Clear and detailed step descriptions help ensure the consistency and repeatability of the test.

[0102] Finally, multiple candidate test cases are determined based on the test case scenario, the adjusted test case scenario and the test case step description; the multiple candidate test cases are differentiated in the focus of the test to provide users with choices. The multiple candidate test cases constitute a test case group.

[0103] The big model test scenario analysis steps based on the mind map, on the one hand, are more in line with the tester's actual thinking habits for scenario analysis and can avoid scenario omissions; on the other hand, due to the use of a more compact representation, it can avoid some repeated information occupying too many model tokens when directly generating use cases, resulting in a decrease in reasoning quality.

[0104] Figure 6 A schematic diagram of a process of determining an output test case in a test case generation method according to an embodiment of the present disclosure is shown. Figure 6 As shown, in the embodiment, in response to selecting a target test case from a test case group and editing the target test case, determining an output test case includes:

[0105] Step S602: showing a plurality of candidate test cases included in the test case group to the user;

[0106] Step S604: in response to the user selecting a target test case from a plurality of candidate test cases, caching the target test case;

[0107] Step S606: input the target test case and the editing instruction into the second largest model, so that the second largest model edits and adjusts the target test case according to the editing instruction to determine the output test case.

[0108] Based on the multiple alternative test cases generated, they are further displayed to the user in the scenario analysis display interface. The user selects the alternative test cases corresponding to the test focus from the multiple alternative test cases as the target test cases, and caches the visual test cases. The cached visual test cases also support secondary editing and adjustment. In one way, the target test cases and editing instructions are input into the second largest model. The second largest model is also used to edit and adjust the target test cases according to the editing instructions to determine the output test cases. In this way, the editing instructions can be input into the second largest model through a multi-round dialogue mechanism, and the obtained output test cases are cached again. In another way, the user can directly manually edit and adjust the target test cases to obtain the output test cases.

[0109] Introducing human-computer interaction into the test case generation process of large models allows users to make necessary adjustments to the model output at any time, including supporting interactive editing of test scenarios and interactive case editing based on local test case cache, thereby avoiding low-quality generation results.

[0110] Improve the efficiency and quality of testers' use case writing. Improve writing efficiency: It can greatly reduce the repetitive work of testers in the use case writing process. In some tests, the writing time of a single use case can be reduced from 5 minutes to 20 seconds, and the efficiency is improved by about 15 times. Avoid missing important scenarios: Compared with manual analysis, the large model can comprehensively consider various background information and more fully consider various extreme abnormal situations, avoiding the omission of important scenarios.

[0111] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of this disclosure have all been authorized.

[0112] Based on the same inventive concept, the present disclosure also provides a test case generation device, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0113] Figure 7 A schematic diagram of a test case generating device in an embodiment of the present disclosure is shown. Figure 7 As shown, the device comprises:

[0114] Background knowledge acquisition module 701, used to acquire agile work items, test requirement information and application program editing interface information as background knowledge;

[0115] A test case scenario determination module 702 is used to input background knowledge and generation instructions into the first large model to determine the test case scenario;

[0116] The test case group determination module 703 is used to input the adjusted test case scenario and background knowledge into the second large model in response to the adjustment of the test case scenario, and determine the test case group; the test case group includes a plurality of candidate test cases; the first large model and the second large model are conversational large models that are trained and encapsulated by the command prompt;

[0117] The output test case determination module 704 is used to determine the output test case in response to selecting a target test case from the test case group and editing the target test case.

[0118] It should be noted that the above-mentioned background knowledge acquisition module 701, test case scenario determination module 702, test case group determination module 703 and output test case determination module 704 correspond to S202 to S208 in the method embodiment, and the examples and application scenarios implemented by the above-mentioned modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0119] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0120] Refer to the following Figure 8 The electronic device 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0121] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).

[0122] The storage unit stores a program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 810 can execute the following steps of the above method embodiment: obtaining agile work items, test requirement information, and application editing interface information as background knowledge; inputting the background knowledge and generation instructions into the first large model to determine the test case scenario; in response to the adjustment of the test case scenario, inputting the adjusted test case scenario and the background knowledge into the second large model to determine the test case group; the test case group includes multiple alternative test cases; the first large model and the second large model are conversational large models that have been trained and encapsulated by the command prompt; in response to selecting a target test case from the test case group and editing the target test case, determine the output test case.

[0123] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0124] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0125] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0126] The electronic device 800 may also communicate with one or more external devices 840 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0127] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0128] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above test case generation method when executed by a processor.

[0129] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0130] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0131] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0132] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0133] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0134] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0135] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0136] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0137] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A test case generation method, characterized in that: include: Obtain agile work items, test requirement information, and application programming interface information as background knowledge; Inputting the background knowledge and generation instructions into a first large model to determine a test case scenario; In response to the adjustment of the test case scenario, the adjusted test case scenario and the background knowledge are input into the second largest model to determine the test case group; The test case group includes a plurality of alternative test cases; The first large model and the second large model are conversational large models that are trained and packaged through a command prompt; In response to selecting a target test case from the test case group and editing the target test case, an output test case is determined.

2. The test case generation method according to claim 1, characterized in that: Obtain agile work items, test requirement information, and application programming interface information as background knowledge, including: Connecting to a development and operation platform through a capability exposure interface; the development and operation platform includes agile management functions, test management functions, and application programming interface management functions; Acquire agile work items, test requirement information and application programming interface information from the requirement management function, test management function and application programming interface management function; Agile work items, test requirement information and application programming interface information are used as background knowledge for test case generation.

3. The test case generation method according to claim 1, characterized in that: Inputting the background knowledge and generation instructions into the first large model to determine the test case scenario includes: Analyze the summary information of the background knowledge and extract test case related information; Preprocessing the test case related information to determine background related information; The background association information and the generation instruction are input into the first large model, so that the first large model analyzes the background association information according to the generation instruction and outputs the test case scenario in a set format.

4. The test case generation method according to claim 3, characterized in that: Preprocessing the test case related information to determine background related information includes: The test case related information is subjected to format conversion, target information screening, intent recognition, text segmentation and other operations to determine background related information.

5. The test case generation method according to claim 1, characterized in that: In response to the adjustment of the test case scenario, the adjusted test case scenario and the background knowledge are input into the second largest model to determine the test case group, including: Converting the test case scenario into a scenario mind map; the scenario mind map includes a central node and multiple branches connecting the central node, each branch of the multiple branches consists of multiple steps; The scenario mind map and step adjustment guide are displayed to the user; the step adjustment guide is used to guide the user to add steps, delete steps, and adjust the order of steps; In response to the user adjusting the scenario mind map according to the step adjustment guide, determining an adjusted test case scenario; Inputting the adjusted test case scenario and the background knowledge into the second large model, so that the second large model extracts the test case scenario and determines the test case step description; Based on the test case scenario, the adjusted test case scenario and the test case step description, a plurality of candidate test cases are determined to form a test case group.

6. The test case generation method according to claim 1, characterized in that: In response to selecting a target test case from the test case group and editing the target test case, determining an output test case includes: Presenting multiple alternative test cases included in the test case group to the user; In response to a user selecting a target test case from the plurality of candidate test cases, caching the target test case; The target test case and the editing instruction are input into the second large model, so that the second large model edits and adjusts the target test case according to the editing instruction to determine the output test case.

7. A test case generating device, characterized in that: include: A background knowledge acquisition module is used to acquire agile work items, test requirement information, and application program editing interface information as background knowledge; A test case scenario determination module, used to input the background knowledge and generation instructions into the first large model to determine the test case scenario; A test case group determination module, configured to input the adjusted test case scenario and the background knowledge into the second largest model in response to the adjustment of the test case scenario, and determine the test case group; The test case group includes a plurality of alternative test cases; The first large model and the second large model are conversational large models that are trained and packaged through a command prompt; The output test case determination module is used to determine the output test case in response to selecting a target test case from the test case group and editing the target test case.

8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the test case generating method according to any one of claims 1 to 6 by executing the executable instructions.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the test case generating method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the test case generating method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Test case generation method based on test case library and ai automation arrangement

    CN122547696A