Test case generation method and device based on large model

By applying a test case generation method based on large-models in software testing and using large-models to generate test cases, the problem of inefficient test case generation in the existing technology is solved, and more efficient and accurate test case generation is achieved.

CN119512942APending Publication Date: 2025-02-25PEOPLE'S INSURANCE COMPANY OF CHINA

Patent Information

Application Number
CN202411533896.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the prior art, test cases are mainly written by testers, resulting in inefficient generation, especially when the test scale is large and the demand changes frequently.

Method used

The test case generation method based on large models is adopted to generate test cases based on test points, reference test cases and test documents through large models to improve generation efficiency and accuracy.

Benefits of technology

Generating test cases through large models significantly improves the efficiency and accuracy of test case generation and reduces the time and effort of manual writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512942A_ABST
    Figure CN119512942A_ABST
Patent Text Reader

Abstract

The invention provides a test case generation method and device based on a large model, and the method comprises the steps: obtaining a test document which comprises at least one of a software demand document and a software design document; processing the test document, and determining at least one test point; determining reference test cases corresponding to the test points from a test case library; respectively filling the test document, each test point and the corresponding reference test case into corresponding positions in a cue word template to generate a target cue word corresponding to each test point; and inputting each target cue word into a first large model to obtain a test case corresponding to each test point. Therefore, the test case corresponding to each test point is generated through the large model based on the test points, the reference test cases corresponding to the test points and the test document, and the efficiency and accuracy of generating the test cases are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a test case generation method and device based on a large model. Background Art

[0002] A test case is a set of test steps and input data written during the software testing process to verify whether the software system meets the expected functional and performance requirements. Test cases usually include information such as test purpose, test conditions, test steps, and expected results, and are intended to verify the correctness, stability, reliability, and security of the software system. By executing test cases, defects and problems in the software system can be discovered, and repairs and improvements can be made in a timely manner to improve software quality and user satisfaction.

[0003] In related technologies, test cases are mainly written manually by testers. The main idea of ​​writing test cases is to analyze and study the requirements, combine business implementation logic and personal experience, explore the test scope and test focus, form test ideas, and write corresponding test cases. Since all test cases are completed manually by testers, it takes a lot of time and effort, especially when the test scale is large and the requirements change frequently, which will cause the problem of low efficiency in test case writing. Summary of the invention

[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0005] To this end, the first purpose of this application is to propose a test case generation method based on a big model. Through the big model, based on the test points, the reference test cases corresponding to the test points, and the test documents, a test case corresponding to each test point is generated, thereby improving the efficiency and accuracy of generating test cases.

[0006] The second objective of this application is to propose a test case generation device based on a large model.

[0007] The third objective of the present application is to provide an electronic device.

[0008] A fourth objective of the present application is to provide a computer-readable storage medium.

[0009] A fifth object of the present application is to provide a computer program product.

[0010] To achieve the above objectives, the first embodiment of the present application proposes a test case generation method based on a large model, comprising:

[0011] Acquire a test document, wherein the test document includes at least one of a software requirement document and a software design document;

[0012] Processing the test document to determine at least one test point;

[0013] Determine, from a test case library, a reference test case corresponding to each of the test points;

[0014] Fill the test document, each of the test points and the corresponding reference test case into corresponding positions in the prompt word template to generate a target prompt word corresponding to each of the test points;

[0015] Each of the target prompt words is input into the first large model to obtain a test case corresponding to each of the test points.

[0016] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a test case generation device based on a large model, comprising:

[0017] A first acquisition module is used to acquire a test document, wherein the test document includes at least one of a software requirement document and a software design document;

[0018] A first determination module, configured to process the test document and determine at least one test point;

[0019] A second determination module is used to determine a reference test case corresponding to each of the test points from a test case library;

[0020] A generating module, used to fill the test document, each of the test points and the corresponding reference test case into corresponding positions in the prompt word template, so as to generate a target prompt word corresponding to each of the test points;

[0021] The second acquisition module is used to input each of the target prompt words into the first large model to obtain the test case corresponding to each of the test points.

[0022] To achieve the above-mentioned purpose, the third aspect of the present application provides an electronic device, including:

[0023] A processor, and a memory communicatively connected to the processor;

[0024] The memory stores computer-executable instructions;

[0025] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the embodiment of the first aspect.

[0026] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method as in the first aspect embodiment.

[0027] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, a computer program, which implements the method of the first aspect when executed by a processor.

[0028] In the disclosed embodiment, a test document is obtained, wherein the test document includes at least one of a software requirement document and a software design document, and then the test document is processed to determine at least one test point, and a reference test case corresponding to each test point is determined from a test case library, and the test document, each test point and the corresponding reference test case are respectively filled into the corresponding position of the prompt word template to generate a target prompt word corresponding to each test point, and finally each target prompt word is input into the first large model to obtain a test case corresponding to each test point. Thus, through the large model, based on the test point, the reference test case corresponding to the test point, and the test document, a test case corresponding to each test point is generated, thereby improving the efficiency and accuracy of generating test cases.

[0029] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 A flowchart of a test case generation method based on a large model provided in an embodiment of the present application;

[0032] Figure 2 A flowchart of another method for generating test cases based on a large model provided in an embodiment of the present application; and

[0033] Figure 3 A schematic diagram of the structure of a test case generation device based on a large model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0035] Among them, the test case generation method and device based on a large model of an embodiment of the present application are described below with reference to the accompanying drawings.

[0036] Figure 1 A flowchart of a test case generation method based on a large model provided in an embodiment of the present application.

[0037] like Figure 1 As shown, the test case generation method based on the large model includes the following steps:

[0038] Step 101, obtaining a test document, wherein the test document includes at least one of a software requirement document and a software design document.

[0039] Among them, the software requirements document is a key input in the software development process. It describes in detail the functions, performance, design constraints, user interface and other requirements that the software product must meet. Its main purpose is to ensure that all project stakeholders (including developers, testers, project managers, customers, etc.) have a common understanding of the software requirements, thereby ensuring that the developed software product can meet the expectations and needs of customers.

[0040] Among them, the software design document is an output document in the software development process, which describes in detail the software architecture design, module division, interface definition, data structure design, algorithm selection, etc. Its main purpose is to provide clear guidance for developers to ensure that they develop according to a unified design idea, thereby ensuring the quality and maintainability of the software product.

[0041] Step 102: Process the test document to determine at least one test point.

[0042] Test points refer to key locations or scenarios for testing specific functions, features or modules in software products or systems. These test points are usually determined based on software requirements documents and design documents to ensure that the software can work properly and meet the expected functional and performance requirements in various situations.

[0043] In some embodiments, the test points may cover the following aspects: functional test points, boundary condition test points, exception handling test points, compatibility test points, performance test points, etc.

[0044] In some embodiments, the function points included in the test document can be determined first; the function points and the second prompt word can be input into the second largest model to obtain at least one test point corresponding to each function point, wherein the second prompt word is used to prompt the second largest model to determine the test point based on the function point.

[0045] In some embodiments, one or more function points may be input into the second large model, which is not limited in the present disclosure.

[0046] For example, the second prompt word may be:

[0047] "As a senior test engineer, please analyze the test points required for the following functional tests and output them point by point, covering all functions. Note: only output functions, operation steps, and results, and do not output other irrelevant content. The functional points are as follows:

[0048] New notification function

[0049] Save notification function

[0050] Release notification function

[0051] Required field check

[0052] Prompt information display

[0053] Confirm button operation

[0054] The message "Successful publishing" is displayed.

[0055] Then the output result of the second largest model, that is, the test point can be:

[0056] “1. New notification function

[0057] Function: Add notification

[0058] Operation steps: Click the "Add notification" button

[0059] Result: The new notification interface is opened successfully

[0060] 2. Save notification function

[0061] Function: Save notification

[0062] Operation steps: After filling in the notification content, click the "Save" button

[0063] Result: The notification content is saved successfully and can be viewed or edited

[0064] 3. Release notification function

[0065] Function: Publish notification

[0066] Operation steps: After saving the notification, click the "Publish" button

[0067] Result: The notification is successfully sent to the specified recipient and appears in the notification list of the sender and the recipient. 4. Verify the required fields

[0068] Function: Input validation

[0069] Operation steps: Submit if the required fields such as title and body are not filled in

[0070] Result: The system displays an error message and asks you to fill in the required fields

[0071] 5. Prompt information display

[0072] Function: Prompt information

[0073] Operation steps: Check the prompts when making incorrect input or successful operation

[0074] Result: Displays an appropriate error message when an error occurs, and displays a corresponding success message when a success occurs

[0075] 6. Confirm button operation

[0076] Function: Operation confirmation

[0077] Operation steps: Click the "OK" button

[0078] Result: The expected action is performed, such as saving the notification or previewing it

[0079] 7. Successful publishing prompt message is displayed

[0080] Function: Prompt information

[0081] Operation steps: Check the prompt information after publishing the notification

[0082] Result: After the release is successful, the prompt message "Release success" is displayed.

[0083] In some embodiments, keyword matching is performed on the test document based on a preset functional keyword library to obtain functional points contained in the test document.

[0084] In some embodiments, when the test document includes a software requirement document and a software design document, keyword matching is performed on the software requirement document based on a preset function keyword library to obtain a first function point included in the software requirement document; keyword matching is performed on the software design document based on a preset function keyword library to obtain a second function point included in the software design document, and the union of the first function point and the second function point is determined as the function point included in the test document. This improves the comprehensiveness of the determined function points.

[0085] In some embodiments, the test document and the third prompt word may be input into the third largest model to obtain the function points contained in the test document, wherein the third prompt word is used to prompt the third largest model to extract the function points from the test document.

[0086] For example, the third prompt word can be: "As a requirements analyst, please analyze the specific functions implemented by the following test document, which only includes the functional points included in the requirements, without expansion or explanation. The test document is as follows:"

[0087] The test document can be:

[0088] “Requirements for issuing notifications:

[0089] 1. This function is a new publishing function for message notifications. Users can save and publish new message notifications;

[0090] 2. Before the pop-up window appears, you need to verify the required items of the new page; if there are required items that are not entered, a prompt message needs to be given;

[0091] 3. Click [OK], the message will be published successfully, and a prompt message will be given indicating the success of the publication.

[0092] The output of the third model, i.e. the function points, can be:

[0093] “The function points of publishing notification are as follows:

[0094] New notification function

[0095] Save notification function

[0096] Release notification function

[0097] Required field check

[0098] Prompt information display

[0099] Confirm button operation

[0100] The message "Successful publishing" is displayed.

[0101] Step 103: Determine a reference test case corresponding to each test point from the test case library.

[0102] In some embodiments, keyword matching is performed between the test point and the title of each test case in the test case library to obtain the initial test case corresponding to the test point; when the number of initial test cases is less than a preset number, the initial test case is determined as the reference test case corresponding to the test point; or, when the number of initial test cases is greater than or equal to a preset number, a preset number of initial test cases are randomly selected as the reference test cases corresponding to the test point.

[0103] Step 104 , fill the test document, each test point and the corresponding reference test case into the corresponding positions in the prompt word template respectively, so as to generate the target prompt word corresponding to each test point.

[0104] For example, the prompt word template may be; "As an asset test engineer, please generate test cases based on the test documents and test points. Note: Output according to the reference test case format. The test document is: XXX; the test case is: XXX; the reference test case is: XXX".

[0105] Step 105, input each target prompt word into the first large model to obtain a test case corresponding to each test point.

[0106] In some embodiments, the first large model and the second large model may be the same large model or different large models, which is not limited in the present disclosure.

[0107] In the disclosed embodiment, a test document is obtained, wherein the test document includes at least one of a software requirement document and a software design document, and then the test document is processed to determine at least one test point, and a reference test case corresponding to each test point is determined from a test case library, and the test document, each test point and the corresponding reference test case are respectively filled into the corresponding position of the prompt word template to generate a target prompt word corresponding to each test point, and finally each target prompt word is input into the first large model to obtain a test case corresponding to each test point. Thus, through the large model, based on the test point, the reference test case corresponding to the test point, and the test document, a test case corresponding to each test point is generated, thereby improving the efficiency and accuracy of generating test cases.

[0108] Figure 2 The following is a flow chart of a method for generating test cases based on a large model provided in an embodiment of the present application. Figure 2 As shown, the test case generation method based on the large model may include the following steps:

[0109] Step 201, obtaining a test document, wherein the test document includes at least one of a software requirement document and a software design document.

[0110] Step 202: Process the test document to determine at least one test point.

[0111] Step 203: Determine a reference test case corresponding to each test point from the test case library.

[0112] Step 204 , fill the test document, each test point and the corresponding reference test case into the corresponding positions in the prompt word template respectively, so as to generate the target prompt word corresponding to each test point.

[0113] Step 205: input each target prompt word into the first large model to obtain a test case corresponding to each test point.

[0114] The specific implementation forms of steps 201 to 205 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.

[0115] Step 206: Obtain a test case template corresponding to the type of the test case.

[0116] The types of test cases may include UI testing, interface testing, front-end function testing, background automatic task testing, scenario testing, etc. This disclosure does not limit this.

[0117] It should be noted that different types of functional tests have different test case templates. For example, functional testing focuses on whether the function works as expected, so the test case template will include the verification of input, operation and output; while performance testing focuses on indicators such as system response time and throughput, so the test case template will include testing and monitoring of system performance indicators.

[0118] Step 207: Match the test case with the test case template to obtain a matching result.

[0119] The matching result is a successful match or a failed match.

[0120] Step 208: display the matching results.

[0121] In the disclosed embodiment, the matching result can be displayed on the display screen. Thus, the staff can be prompted whether the test case generated by the first large model can be directly used for testing. If the matching result is a successful match, it can be directly used for testing; if the matching result is a failed match, it cannot be directly used for testing, and the test case generated by the large model can be manually modified before being put into testing.

[0122] In some embodiments, when the matching result is a successful match, the test case is added to the test case library, thereby increasing the data volume of the test case library, and then obtaining a reference test case that better matches the test point in the subsequent test case generation process.

[0123] In some embodiments, in the event of a match failure, the reason for the match failure may also be determined.

[0124] For example, the test case template for the interface test includes "use SQL to check whether the xxx data in the library table 1xxx is deleted successfully", but the test case generated by the first model does not include this step, which can be used as the reason for the matching failure.

[0125] In some embodiments, when the matching result is a matching failure, the reason for the matching failure is displayed, so that the staff can modify the test case generated by the first large model based on the failure reason.

[0126] In the disclosed embodiment, after generating a test case corresponding to a test point based on the first large model, a test case template corresponding to the type of the test case is obtained, the test case is matched with the test case template to obtain a matching result, and the matching result is displayed. Thus, after generating a test case based on the first large model, the accuracy of the test case generated by the first large model can be further judged based on the test case template, so that if the test case is inaccurate, the test case generated by the first large model can be directly modified, thereby improving the efficiency of the generated test case while reducing labor costs.

[0127] In some embodiments, the first large model, the second large model, and the third large model may be the same or different, and the present disclosure is not limited to this.

[0128] Large Language Model (LLM), or large model, is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks such as text summarization, question answering, translation, etc.

[0129] In order to implement the above embodiments, the present application also proposes a test case generation device based on a large model.

[0130] Figure 3 A schematic diagram of the structure of a test case generation device based on a large model provided in an embodiment of the present application. Figure 3 As shown, the test case generation device based on the large model includes:

[0131] A first acquisition module 301 is used to acquire a test document, wherein the test document includes at least one of a software requirement document and a software design document;

[0132] A first determination module 302, configured to process the test document and determine at least one test point;

[0133] A second determination module 303 is used to determine a reference test case corresponding to each test point from the test case library;

[0134] A generating module 304 is used to fill the test document, each test point and the corresponding reference test case into the corresponding positions in the prompt word template to generate a target prompt word corresponding to each test point;

[0135] The second acquisition module 305 is used to input each target prompt word into the first large model to obtain the test case corresponding to each test point.

[0136] In some embodiments, a display module is further included for:

[0137] Get the test case template corresponding to the type of the test case;

[0138] Match the test case with the test case template to obtain a matching result;

[0139] Display matching results.

[0140] In some embodiments, the display module is further configured to:

[0141] If the matching result is successful, the test case is added to the test case library; or,

[0142] If the matching result is a matching failure, the reason for the matching failure is displayed.

[0143] In some embodiments, the first determining module 302 is configured to:

[0144] Determine the functional points included in the test document;

[0145] The function point and the second prompt word are input into the second largest model to obtain at least one test point corresponding to each function point, wherein the second prompt word is used to prompt the second largest model to determine the test point based on the function point.

[0146] In some embodiments, the first determining module 302 is configured to:

[0147] Based on the preset functional keyword library, keyword matching is performed on the test document to obtain the functional points contained in the test document; or

[0148] The test document and the third prompt word are input into the third largest model to obtain the function points contained in the test document, wherein the third prompt word is used to prompt the third largest model to extract the function points from the test document.

[0149] In some embodiments, the second determining module 303 is configured to:

[0150] Perform keyword matching between the test point and the title of each test case in the test case library to obtain the initial test case corresponding to the test point;

[0151] When the number of initial test cases is less than the preset number, the initial test cases are determined as reference test cases corresponding to the test points; or,

[0152] When the number of initial test cases is greater than or equal to a preset number, a preset number of initial test cases are randomly selected as reference test cases corresponding to the test points.

[0153] The test case generation method and device based on the big model provided by the present application obtains a test document, wherein the test document includes at least one of a software requirement document and a software design document, then processes the test document, determines at least one test point, determines a reference test case corresponding to each test point from a test case library, and fills the test document, each test point and the corresponding reference test case into the corresponding position in the prompt word template respectively to generate a target prompt word corresponding to each test point, and finally inputs each target prompt word into the first big model to obtain a test case corresponding to each test point. Thus, through the big model, based on the test point, the reference test case corresponding to the test point, and the test document, a test case corresponding to each test point is generated, thereby improving the efficiency and accuracy of generating test cases.

[0154] In order to implement the above embodiments, the present application also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.

[0155] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.

[0156] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.

[0157] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0158] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0159] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0160] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0161] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0162] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0163] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0164] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0165] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0167] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A test case generation method based on a large model, characterized in that: The following steps are involved: Acquire a test document, wherein the test document includes at least one of a software requirement document and a software design document; Processing the test document to determine at least one test point; Determine, from a test case library, a reference test case corresponding to each of the test points; Fill the test document, each of the test points and the corresponding reference test case into corresponding positions in the prompt word template to generate a target prompt word corresponding to each of the test points; Each of the target prompt words is input into the first large model to obtain a test case corresponding to each of the test points.

2. The method according to claim 1, characterized in that: After inputting each of the target prompt words into the first large model to obtain a test case corresponding to each of the test points, the method further comprises: Obtain a test case template corresponding to the type of the test case; Matching the test case with the test case template to obtain a matching result; The matching results are displayed.

3. The method according to claim 2, characterized in that After matching the test case with the test case template to obtain a matching result, the method further includes: If the matching result is successful, adding the test case to the test case library; or, When the matching result is a matching failure, the reason for the matching failure is displayed.

4. The method according to claim 1, characterized in that: The processing of the test document to determine at least one test point includes: Determining the functional points included in the test document; The function point and the second prompt word are input into the second large model to obtain at least one test point corresponding to each function point, wherein the second prompt word is used to prompt the second large model to determine the test point based on the function point.

5. The method according to claim 4, characterized in that The determining of the functional points included in the test document comprises: Based on a preset functional keyword library, keyword matching is performed on the test document to obtain the functional points contained in the test document; or, The test document and the third prompt word are input into the third largest model to obtain the function points contained in the test document, wherein the third prompt word is used to prompt the third largest model to extract the function points from the test document.

6. The method according to claim 1, characterized in that Determining a reference test case corresponding to each of the test points from a test case library includes: Perform keyword matching on the test point and the title of each test case in the test case library to obtain an initial test case corresponding to the test point; In the case where the number of the initial test cases is less than a preset number, the initial test cases are determined as reference test cases corresponding to the test points; or, When the number of the initial test cases is greater than or equal to a preset number, a preset number of initial test cases are randomly selected as reference test cases corresponding to the test points.

7. A test case generation device based on a large model, characterized in that: include: A first acquisition module is used to acquire a test document, wherein the test document includes at least one of a software requirement document and a software design document; A first determination module, configured to process the test document and determine at least one test point; A second determination module is used to determine a reference test case corresponding to each of the test points from a test case library; A generating module, used to fill the test document, each of the test points and the corresponding reference test case into corresponding positions in the prompt word template, so as to generate a target prompt word corresponding to each of the test points; The second acquisition module is used to input each of the target prompt words into the first large model to obtain the test case corresponding to each of the test points.

8. The device according to claim 7, characterized in that Also includes matching modules for: Obtain a test case template corresponding to the type of the test case; The test case is matched with the test case template to obtain a matching result.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

Citation Information

Patent Citations

  • Software testing method and device, equipment and storage medium

    CN114780386A

  • Test case generation method and target test case generation model training method

    CN117707929A

  • Test case code generation method and related equipment

    CN117707983A

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

    CN117971698A

Cited By

  • Test case generation method and device

    CN120973690A

  • Test case generation method and apparatus

    CN120973690B

  • Test case generation method and device, equipment and computer program product

    CN121070344A

  • Large language model security assessment method and device

    CN121808780A