Test case obtaining method and device, equipment, storage medium and program product

By inputting the target business flowchart modeling code and use case format configuration information into the large model, the test cases are automatically output, which solves the problem of inefficient writing test cases in the existing technology and achieves more efficient test case generation.

CN119759767APending Publication Date: 2025-04-04BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411811909.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, the writing efficiency of test cases is low, difficult to reuse, and affects the test progress.

Method used

By obtaining the target business flowchart modeling code and target use case format configuration information, input it into a pre-trained large model, using the large model to analyze the business flowchart code, and automatically output the test cases based on the analysis results and use case format configuration information.

Benefits of technology

It improves the efficiency of test case writing, reduces the need for manual writing, and ensures the smooth progress of the test progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759767A_ABST
    Figure CN119759767A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a test case obtaining method and device, equipment, a storage medium and a program product. The test case obtaining method comprises the steps that a target business flow chart modeling code and target case format configuration information are obtained; inputting the target business flow chart modeling code and the target case format configuration information into a large model obtained by pre-training to enable the large model to analyze the target business flow chart modeling code, and outputting a test case based on an analysis result and the target case format configuration information; and obtaining a target test case set according to the test cases output by the large model. By applying the technical scheme provided by the embodiment of the invention, the writing efficiency of the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a test case acquisition method, device, equipment, storage medium and program product. Background Art

[0002] In software product testing, test cases are the core resource of quality assurance (QA), and their writing quality directly affects the quality and reliability of software products.

[0003] At present, test cases are mostly written manually by testers. This method takes a long time, and the test cases written by different testers may have different formats, making them difficult to reuse. The test case writing efficiency is low, which can easily affect the test progress. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a test case acquisition method, device, equipment, storage medium and program product to improve the efficiency of test case writing and ensure the smooth progress of the test. The specific technical solution is as follows:

[0005] In a first aspect, a method for obtaining a test case is provided, comprising:

[0006] Obtaining a target business process diagram modeling code and target use case format configuration information, wherein the target business process diagram modeling code is a code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate test case format requirements;

[0007] Input the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, so that the large model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results and the target use case format configuration information;

[0008] According to the test cases output by the large model, a target test case set is obtained.

[0009] Optionally, the inputting the target business process diagram modeling code and the target use case format configuration information into a pre-trained large model so that the large model analyzes the target business process diagram modeling code and outputs a test case based on the analysis result and the target use case format configuration information includes:

[0010] Inputting the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model multiple times, so that the large model analyzes the target business process diagram modeling code, and outputs test cases multiple times based on the analysis results and the target use case format configuration information;

[0011] The step of obtaining a target test case set according to the test cases output by the large model includes:

[0012] According to the test cases outputted multiple times by the large model, a target test case set is obtained.

[0013] Optionally, obtaining a target test case set according to the test cases outputted multiple times by the large model includes:

[0014] Among the test cases outputted multiple times by the large model, determine the result containing the largest number of test cases in one output;

[0015] A set of test cases included in the determined results is determined as a target test case set.

[0016] Optionally, the big model is associated with knowledge base information, and the target business process diagram modeling code and the target use case format configuration information are input into the big model so that the big model analyzes the target business process diagram modeling code and outputs a test case based on the analysis result and the target use case format configuration information, including:

[0017] The target business process diagram modeling code and the target use case format configuration information are input into the big model so that the big model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results, the knowledge base information and the target use case format configuration information.

[0018] Optionally, inputting the target business process diagram modeling code and the target use case format configuration information into a pre-trained large model includes:

[0019] Point the code variable in the prompt word of the large model obtained by pre-training to the target business process diagram modeling code, wherein the code variable is a parameter used to represent the business process diagram modeling code;

[0020] The configuration variable in the prompt word is pointed to the target use case format configuration information, wherein the configuration variable is a parameter used to represent the use case format configuration information.

[0021] Optionally, the target use case format configuration information is obtained by following the steps below:

[0022] Get a custom use case format template or a common use case format template;

[0023] Determine the test case format requirements according to the custom test case format template or the general test case format template;

[0024] Based on the test case format requirements, target test case format configuration information is generated.

[0025] In a second aspect, a test case obtaining device is provided, comprising:

[0026] An acquisition module is used to acquire a target business process diagram modeling code and target use case format configuration information, wherein the target business process diagram modeling code is a code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate test case format requirements;

[0027] A processing module, used for inputting the target business process diagram modeling code and the target use case format configuration information into a pre-trained large model, so that the large model analyzes the target business process diagram modeling code, and outputs a test case based on the analysis result and the target use case format configuration information;

[0028] The acquisition module is used to obtain a target test case set according to the test cases output by the large model.

[0029] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0030] Memory, used to store computer programs;

[0031] The processor is used to implement the steps of the test case obtaining method described in the first aspect when executing the program stored in the memory.

[0032] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the test case obtaining method described in the first aspect are implemented.

[0033] In a fifth aspect, a computer program product is provided, which includes computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that an electronic device having the processor performs the steps of the test case acquisition method described in the first aspect.

[0034] Applying the technical solution provided in the embodiment of the present application, first obtain the target business process diagram modeling code and the target use case format configuration information, and then input the target business process diagram modeling code and the target use case format configuration information into the big model, so that the big model analyzes the target business process diagram modeling code, and outputs test cases based on the analysis results and the target use case format configuration information, and obtains the target test case set based on the test cases output by the big model. The target business process diagram modeling code is the code obtained by describing the target business process diagram using a modeling language. The target business process diagram modeling code is analyzed by the big model, and then based on the analysis results and the target use case format configuration information, the test cases can be automatically output, and then based on the test cases output by the big model, the target test case set can be obtained, without the need for manual writing of test cases, which improves the efficiency of test case writing and helps to ensure the smooth progress of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0036] Figure 1 This is a flowchart of a method for obtaining a test case in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of a business process in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of an example of obtaining a test case in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of the structure of a test case obtaining device in an embodiment of the present application;

[0040] Figure 5 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0042] The core of this application is to provide a test case acquisition method, which can be applied to software product testing scenarios.

[0043] First, the target business process diagram modeling code and the target use case format configuration information are obtained, and then the target business process diagram modeling code and the target use case format configuration information are input into the big model, so that the big model analyzes the target business process diagram modeling code, and outputs test cases based on the analysis results and the target use case format configuration information, and obtains the target test case set based on the test cases output by the big model. The target business process diagram modeling code is the code obtained by describing the target business process diagram using a modeling language. The target business process diagram modeling code is analyzed by the big model, and then the test cases can be automatically output based on the analysis results and the target use case format configuration information, and then the target test case set can be obtained based on the test cases output by the big model, without the need to manually write test cases, which improves the efficiency of test case writing and helps to ensure the smooth progress of the test.

[0044] See also Figure 1 FIG. 1 is a flowchart of a method for obtaining a test case provided by an embodiment of the present application. The method may include the following steps:

[0045] S110: Obtain target business process diagram modeling code and target use case format configuration information.

[0046] The target business process diagram modeling code is the code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate the test case format requirements.

[0047] In an embodiment of the present application, when conducting business combing, Business Process Modeling Notation (BPMN) or Unified Modeling Language (UML) can be used instead of ProcessOn (an online drawing tool). Because the former has a relatively standard modeling language, such as start events, end events, conditional judgments, continuous lines, etc., all have fixed element labels to represent. Taking BPMN as an example, BPMN is a graphical representation tool specifically used for business process modeling. Through this tool, business process diagrams can be described in a code-like modeling language, including events, gateways, link objects and other elements. The advantage of using such tools is that the subsequent large model can analyze the code content, which is simpler to understand the code content than to understand the image content, and reduces the difficulty of analysis during the automation process, making the accuracy of the test cases output by the large model higher.

[0048] Users can sort out the target business process according to the target business needs and the specified drawing standards, and draw the target business process diagram. Figure 2As shown, taking the target business as logging in to the application (application, app) as an example, the start event is logging in to the app, opening the login page, and determining the login method through the gateway. If the login method is to select a mobile phone number, then login is through the mobile phone number. If the login method is to select WeChat, then login is through WeChat. If the login method is to select an account and password, then login is through the account and password. Various login methods are gateway conditions, and then a gateway is used to verify whether the login is successful. If successful, the login is confirmed to be successful. If failed, the login failure is confirmed. Login success and login failure are end events.

[0049] After obtaining the target business process diagram drawn by the user, the target business process diagram drawn by the user is described using a modeling language to obtain a modeling code of the target business process diagram.

[0050] For example, after the user sorts out the target business process according to the prescribed BPMN drawing standard and draws the target business process diagram, the BPMN diagram code can be obtained based on the target business process diagram. The BPMN diagram code is the target business process diagram modeling code.

[0051] The target case format configuration information is used to indicate the test case format requirements. The target case format configuration information can be generated by one of the following templates:

[0052] Customized use case format template;

[0053] Generic use case format template.

[0054] It can be understood that in terms of the test case format, the target case format configuration information can be generated through the general case format template, and the target case format configuration information can also be generated through the custom case format template. Different business parties may have different requirements for the test case format. Custom case format templates can be configured according to their respective needs. Custom case format templates of different business parties may be the same or different. For example, in terms of the naming rules of the test case name, some business parties require that it must be named in the "CASE_NUM_XXX" format, and some business parties require that it must be named in the "TEST_XXX" format.

[0055] An example of a general use case format template or a custom use case format template is as follows:

[0056] a) **Use Case Name**: The format is "Decision Name + Value_Task Name_Decision Name + Value_Task Name_...+Decision Name + Value_Task Name". The name cannot contain ID values ​​and letters such as Event, Gateway, Activity, etc. It should be described in words; the name cannot contain an ending mark;

[0057] b) **Priority**: There are four levels, from P1 to P4;

[0058] c) **Test steps**: Output each judgment, task, and sequence flow in the path in order and give a sequence number. "data.result" cannot appear in the test steps; "for example" and other situations cannot appear in the test steps; if the start event has no content, omit the start event;

[0059] d) **Expected result**: Output the content of the end event. Use “#” to mark the end after the expected result.

[0060] Exemplarily, the target use case format configuration information generated by the custom use case format template or the general use case format template is as follows:

[0061] 1) Use case name: Use "gateway judgment name and value" + "_" + "task name" + "_" + "gateway judgment name and value" + "_" + "task name" + ... to link all judgment names, judgment values, and all task names. Do not repeat the name, and do not allow id values ​​such as Event, Gateway, and Activity to appear in the name. Use text descriptions, and do not allow end tags in the name;

[0062] 2) Priority: divided into four levels, from P1 to P4;

[0063] 3) Test steps: Output each judgment, task, and sequence flow in the path in order and give a sequence number. "data.result" cannot appear in the test steps; "for example" and other situations cannot appear in the test steps; if the start event has no content, omit the start event;

[0064] 4) Expected result: The content of the end event is output as the expected result. Note that when there are many judgment conditions involved in the branch, you can check repeatedly to ensure that the expected result is corresponding. Use a # to separate the expected result.

[0065] After obtaining the target business process diagram modeling code and target use case format configuration information, you can proceed to the subsequent steps.

[0066] S120: Input the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, so that the large model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results and the target use case format configuration information.

[0067] In an embodiment of the present application, a large model can be pre-trained to output test cases based on the business process diagram modeling code and use case format configuration information.

[0068] After obtaining the target business process diagram modeling code and the target use case format configuration information, the target business process diagram modeling code and the target use case format configuration information can be used as input and input into the big model for processing by the big model. The big model analyzes the target business process diagram modeling code, obtains the analysis result of the code content, and then outputs the test case based on the analysis result and the target use case format configuration information.

[0069] The large model analyzes the modeling code of the target business process diagram, and the analysis complexity is lower than directly analyzing the image content of the flowchart.

[0070] S130: Obtain a target test case set according to the test cases output by the large model.

[0071] In an embodiment of the present application, the target business process diagram modeling code and the target use case format configuration information are input into the large model, and the large model analyzes the target business process diagram modeling code, and outputs the test case based on the analysis result and the target use case format configuration information. Then, the target test case set can be obtained according to the test case output by the large model. For example, the set consisting of the test cases output by the large model can be directly determined as the target test case set. For another example, the target test case set can be determined by combining the test cases output by the large model multiple times.

[0072] Applying the method provided by the embodiment of the present application, first obtain the target business process diagram modeling code and the target use case format configuration information, and then input the target business process diagram modeling code and the target use case format configuration information into the big model, so that the big model analyzes the target business process diagram modeling code, and outputs test cases based on the analysis results and the target use case format configuration information, and obtains the target test case set based on the test cases output by the big model. The target business process diagram modeling code is the code obtained by describing the target business process diagram using a modeling language. The target business process diagram modeling code is analyzed by the big model, and then based on the analysis results and the target use case format configuration information, the test cases can be automatically output, and then based on the test cases output by the big model, the target test case set can be obtained, and there is no need to manually write test cases, which improves the efficiency of test case writing and helps to ensure the smooth progress of the test.

[0073] In some embodiments of the present application, step S120 inputs the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model so that the large model analyzes the target business process diagram modeling code and outputs the test case based on the analysis result and the target use case format configuration information, which may include the following steps:

[0074] Inputting the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model multiple times, so that the large model analyzes the target business process diagram modeling code, and outputs test cases multiple times based on the analysis results and the target use case format configuration information;

[0075] Step S130 obtains a target test case set according to the test cases output by the large model, which may include the following steps:

[0076] According to the test cases output by the large model multiple times, the target test case set is obtained.

[0077] It is understandable that the large model has a certain degree of uncertainty, and there may be different outputs for the same input, and the test cases generated by the large model may be missing with a small probability. Therefore, in an embodiment of the present application, after obtaining the target business process diagram modeling code and the target use case format configuration information, the target business process diagram modeling code and the target use case format configuration information can be input into the large model multiple times. For each input, the large model analyzes the target business process diagram modeling code, and outputs the test case corresponding to the current input based on the analysis results and the target use case format configuration information. Each input corresponds to a corresponding test case output result.

[0078] According to the test cases output by the large model multiple times, the target test case set is obtained. For example, if the test cases output by the large model twice are obtained, the target test case set is obtained according to the test cases output by the large model twice.

[0079] Optionally, the test cases output by the large model multiple times can be deduplicated and integrated to obtain a target test case set.

[0080] Optionally, among the test cases outputted multiple times by the large model, a result outputted once containing the largest number of test cases may be determined, and a set of test cases contained in the determined result may be determined as a target test case set.

[0081] For example, the target business process diagram modeling code and target use case format configuration information are input into the big model for the first time, and the output result of the big model includes 10 test cases. The target business process diagram modeling code and target use case format configuration information are input into the big model for the second time, and the output result of the big model includes 30 test cases. The target business process diagram modeling code and target use case format configuration information are input into the big model for the third time, and the output result of the big model includes 15 test cases. It can be determined that the second output contains the largest number of test cases, and the set of test cases outputted for the second time can be determined as the target test case set.

[0082] By inputting the target business process diagram modeling code and the target use case format configuration information into the big model multiple times, the test cases output multiple times by the big model can be obtained, and then based on the test cases output multiple times by the big model, a relatively complete and accurate target test case set can be obtained.

[0083] In some embodiments of the present application, the big model is associated with knowledge base information, and step S120 inputs the target business process diagram modeling code and the target use case format configuration information into the big model, so that the big model analyzes the target business process diagram modeling code, and outputs the test case based on the analysis result and the target use case format configuration information, which may include the following steps:

[0084] The target business process diagram modeling code and the target use case format configuration information are input into the big model so that the big model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results, knowledge base information and the target use case format configuration information.

[0085] In an embodiment of the present application, the large model is associated with knowledge base information, and the knowledge base information may include at least one of the following:

[0086] Historical test case information;

[0087] Test dataset information;

[0088] Interface documentation information.

[0089] It is understandable that the target business process diagram modeling code based on which the big model generates test cases is the code obtained by describing the target business process diagram using the modeling language. Generating test cases requires a lot of information, which may not be fully reflected in the target business process diagram. In this case, a knowledge base can be built to express more information needed to generate test cases through the knowledge base information. In this way, the big model can take the knowledge base information into account when generating test cases, making the generated test cases more accurate.

[0090] The knowledge base information may include at least one of historical test case information, test data set information, and interface document information, and may also include other information required for generating test cases.

[0091] For example, the interface document information is as follows, including field name, field meaning, field type and other information:

[0092] #c6600b30-405f-4fea-ac7

[0093] Request parameter name: danmuContent Required: Y Type: String Description: Danmu text. Please urlencode special characters such as [].

[0094] #187c900f-c92f-4e0e-b58

[0095] Request parameter name: danmuIdRequired item: YType: LongDescription: Danmu ID

[0096] #790f0061-a54d-4925-82e

[0097] Request parameter name: token Required item: Y Type: String Description: Business party access token, please apply for it from the service owner

[0098] #264b46d1-b472-4f14-b7a

[0099] Request parameter name: source Required item: Y Type: String Description: Business source, please apply to the server owner

[0100] #f27d5eb9-ef69-4c2d-a39

[0101] Request parameter name: videold Required item: Y Type: Long Description: The ID of the video to which the bullet comment belongs

[0102] For example, when generating a test case for the "danmuContent" field, you can clearly know that the field type is a string and is a required parameter, which makes the generated test case more accurate.

[0103] The big model is associated with the knowledge base information. After the target business process diagram modeling code and the target use case format configuration information are input into the big model, the big model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results, knowledge base information and the target use case format configuration information, which can make the test cases output by the big model more accurate.

[0104] In some embodiments of the present application, step S120 inputs the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, which may include the following steps:

[0105] Point the code variable in the prompt word of the pre-trained large model to the target business process diagram modeling code, where the code variable is a parameter used to represent the business process diagram modeling code;

[0106] The configuration variable in the prompt word points to the target use case format configuration information, where the configuration variable is a parameter used to represent the use case format configuration information.

[0107] For the convenience of description, the above steps are combined for explanation.

[0108] In an embodiment of the present application, the prompt word (Prompt) of the large model includes an explanation of the label of the modeling language, which can also be understood as an explanation of the label of the modeling language, which helps to improve the accuracy of the large model's analysis of the target business process diagram modeling code.

[0109] For example, the prompt has the following description: "The rule for converting BPMN diagram to use case is that the start event label startEvent is used as the use case input, the task event is the test step, the end event label endEvent is the expected result, exclusiveGateway represents a judgment condition, and sequenceFlow marks the specific value."

[0110] For example, the prompt has the following description:

[0111] As a test student, please convert the given BPMN diagram into a detailed test case. The target test case format configuration information is {{Case_Rule}};

[0112] Please convert the following BPMN diagram code into a test case. The BPMN diagram code is {{Bpmn_Code}}.

[0113] Among them, Case_Rule in the description is a configuration variable, which is a parameter used to represent the use case format configuration information, and Bpmn_Code is a code variable, which is a parameter used to represent the business process diagram modeling code.

[0114] By pointing the code variable in the prompt word to the target business process diagram modeling code and the configuration variable in the prompt word to the target use case format configuration information, the large model can know the specific business process diagram modeling code and use case format configuration information on which the test case is to be generated.

[0115] In other words, the prompt words of the big model are compatible, so it is convenient to generate test cases with different format requirements for different business lines. The prompt words of the big model provide configuration variables and code variables, such as the configuration variable is {{caseInfo}}, and the code variable is {{code}}. After obtaining the target business process diagram modeling code and the target use case format configuration information, the code variable in the prompt words of the big model can be pointed to the target business process diagram modeling code, and the configuration variable in the prompt words can be pointed to the target use case format configuration information. In this way, the big model can know through the prompt words that the target business process diagram modeling code needs to be analyzed, and that the test case needs to be output based on the analysis results and the target use case configuration information, which helps to improve the accuracy of the test cases output by the big model.

[0116] It is understandable that the large model is mainly implemented based on prompt words. The business process diagram modeling codes of different business parties are different, and the use case format configuration information may also be inconsistent. Therefore, the embodiment of the present application does not solidify the prompt words of the large model, but configures them according to actual needs. In the prompt words, two variables are used to point to the specific business process diagram modeling code and use case format configuration information respectively, so that the corresponding test cases can be automatically generated for the business process diagram modeling code and use case format configuration information of different business parties.

[0117] In some embodiments of the present application, the target use case format configuration information may be obtained by following the steps below:

[0118] Get a custom use case format template or a common use case format template;

[0119] Determine the test case format requirements based on the custom test case format template or the general test case format template;

[0120] Generate target test case format configuration information based on test case format requirements.

[0121] For the convenience of description, the above steps are combined for explanation.

[0122] In an embodiment of the present application, when there is a need to generate a test case, a custom use case format template or a general use case format template can be obtained according to actual needs, and then the custom use case format template or the general use case format template can be analyzed to determine the test case format requirements, and then based on the test case format requirements, the target use case format configuration information can be generated.

[0123] By generating target use case format configuration information through a custom use case format template or a general use case format template, the target use case format configuration information can be standardized to a certain extent, which is helpful for accurate understanding of the large model.

[0124] The technical solutions provided in the embodiments of the present application are described above. For ease of understanding, the technical solutions provided in the embodiments of the present application are described below by way of specific examples.

[0125] like Figure 3 As shown, the process is as follows:

[0126] Use BPMN diagram to sort out the business process and obtain BPMN diagram code;

[0127] Get the use case format configuration information, and encapsulate the BPMN diagram code and the use case format configuration information through the encapsulation service;

[0128] Input the BPMN diagram code and the use case format configuration information into the big model, trigger the big model processing twice in succession, and the big model outputs the test case based on the BPMN diagram code, the use case format configuration information, and the knowledge base information to obtain the test case output by the big model for the first time and the test case output by the second time;

[0129] Compare the number of test cases contained in the test cases output by the large model twice;

[0130] The output results with more test cases are saved, and the output results with fewer test cases are discarded.

[0131] The technical solution provided by the embodiment of the present application is mainly based on the automatic generation of test cases based on large models and business process diagrams, which helps to improve the efficiency of test case writing. Compared with the solution of developing a case design platform to generate test cases in related technologies, the development and maintenance costs of the embodiment of the present application are lower, the application scope is wider, and it can adapt to changing test requirements.

[0132] Corresponding to the above method embodiment, the embodiment of the present application further provides a test case obtaining device, and the test case obtaining device described below and the test case obtaining method described above can refer to each other.

[0133] See also Figure 4 As shown, the test case obtaining device 400 may include the following modules:

[0134] The acquisition module 410 is used to acquire the target business process diagram modeling code and the target use case format configuration information, wherein the target business process diagram modeling code is the code obtained by describing the target business process diagram using the modeling language, and the target use case format configuration information is used to indicate the test case format requirements;

[0135] Processing module 420, used to input the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, so that the large model analyzes the target business process diagram modeling code and outputs the test case based on the analysis result and the target use case format configuration information;

[0136] The acquisition module 430 is used to obtain a target test case set according to the test cases output by the large model.

[0137] By using the device provided in the embodiment of the present application, the target business process diagram modeling code and the target use case format configuration information are first obtained, and then the target business process diagram modeling code and the target use case format configuration information are input into the large model, so that the large model analyzes the target business process diagram modeling code, and outputs test cases based on the analysis results and the target use case format configuration information, and obtains the target test case set according to the test cases output by the large model. The target business process diagram modeling code is the code obtained by describing the target business process diagram using a modeling language. The target business process diagram modeling code is analyzed by the large model, and then the test cases can be automatically output based on the analysis results and the target use case format configuration information, and then the target test case set can be obtained based on the test cases output by the large model, without the need for manual writing of test cases, which improves the efficiency of test case writing and helps to ensure the smooth progress of the test.

[0138] In some embodiments of the present application, the processing module 420 is specifically configured to:

[0139] Inputting the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model multiple times, so that the large model analyzes the target business process diagram modeling code, and outputs test cases multiple times based on the analysis results and the target use case format configuration information;

[0140] The acquisition module 430 is specifically used for:

[0141] According to the test cases output by the large model multiple times, the target test case set is obtained.

[0142] In some embodiments of the present application, the obtaining module 430 is specifically used to:

[0143] Among the test cases that are output multiple times by the large model, determine the result that contains the most test cases in one output;

[0144] A set of test cases included in the determined results is determined as a target test case set.

[0145] In some embodiments of the present application, the large model is associated with the knowledge base information, and the processing module 420 is specifically used to:

[0146] The target business process diagram modeling code and the target use case format configuration information are input into the big model so that the big model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results, knowledge base information and the target use case format configuration information.

[0147] In some embodiments of the present application, the processing module 420 is specifically configured to:

[0148] Point the code variable in the prompt word of the pre-trained large model to the target business process diagram modeling code, where the code variable is a parameter used to represent the business process diagram modeling code;

[0149] The configuration variable in the prompt word points to the target use case format configuration information, where the configuration variable is a parameter used to represent the use case format configuration information.

[0150] In some embodiments of the present application, the acquisition module 410 is specifically used to acquire the target use case format configuration information through the following steps:

[0151] Get a custom use case format template or a common use case format template;

[0152] Determine the test case format requirements based on the custom test case format template or the general test case format template;

[0153] Generate target test case format configuration information based on test case format requirements.

[0154] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0155] The present application also provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0156] Memory 503, used for storing computer programs;

[0157] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:

[0158] Obtaining a target business process diagram modeling code and target use case format configuration information, wherein the target business process diagram modeling code is a code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate test case format requirements;

[0159] Input the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, so that the large model analyzes the target business process diagram modeling code and outputs the test case based on the analysis result and the target use case format configuration information;

[0160] According to the test cases output by the large model, the target test case set is obtained.

[0161] The communication bus 504 mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 504 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0162] The communication interface 502 is used for communication between the terminal and other devices.

[0163] The memory 503 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory 503 may also be at least one storage device located away from the aforementioned processor.

[0164] The above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0165] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the steps of the test case obtaining method in any one of the above embodiments.

[0166] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of the test case obtaining method in any one of the above embodiments.

[0167] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

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

[0169] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0170] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the protection scope of the present application.

Claims

1. A test case obtaining method, characterized in that: include: Obtaining a target business process diagram modeling code and target use case format configuration information, wherein the target business process diagram modeling code is a code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate test case format requirements; Input the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model, so that the large model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results and the target use case format configuration information; According to the test cases output by the large model, a target test case set is obtained.

2. The method according to claim 1, characterized in that The step of inputting the target business process diagram modeling code and the target use case format configuration information into a pre-trained large model so that the large model analyzes the target business process diagram modeling code and outputs a test case based on the analysis result and the target use case format configuration information includes: Inputting the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model multiple times, so that the large model analyzes the target business process diagram modeling code, and outputs test cases multiple times based on the analysis results and the target use case format configuration information; The step of obtaining a target test case set according to the test cases output by the large model includes: According to the test cases outputted multiple times by the large model, a target test case set is obtained.

3. The method according to claim 2, characterized in that The step of obtaining a target test case set according to the test cases outputted multiple times by the large model includes: Among the test cases outputted multiple times by the large model, determine the result containing the largest number of test cases in one output; A set of test cases included in the determined results is determined as a target test case set.

4. The method according to claim 1, characterized in that: The large model is associated with knowledge base information, and the target business process diagram modeling code and the target use case format configuration information are input into the large model so that the large model analyzes the target business process diagram modeling code and outputs a test case based on the analysis result and the target use case format configuration information, including: The target business process diagram modeling code and the target use case format configuration information are input into the big model so that the big model analyzes the target business process diagram modeling code and outputs test cases based on the analysis results, the knowledge base information and the target use case format configuration information.

5. The method according to claim 1, characterized in that: The step of inputting the target business process diagram modeling code and the target use case format configuration information into the pre-trained large model includes: Point the code variable in the prompt word of the large model obtained by pre-training to the target business process diagram modeling code, wherein the code variable is a parameter used to represent the business process diagram modeling code; The configuration variable in the prompt word is pointed to the target use case format configuration information, wherein the configuration variable is a parameter used to represent the use case format configuration information.

6. The method according to any one of claims 1 to 5, characterized in that Obtain the target use case format configuration information by following the steps below: Get a custom use case format template or a common use case format template; Determine the test case format requirements according to the custom test case format template or the general test case format template; Based on the test case format requirements, target test case format configuration information is generated.

7. A test case acquisition device, characterized in that: include: An acquisition module is used to acquire a target business process diagram modeling code and target use case format configuration information, wherein the target business process diagram modeling code is a code obtained by describing the target business process diagram using a modeling language, and the target use case format configuration information is used to indicate test case format requirements; A processing module, used for inputting the target business process diagram modeling code and the target use case format configuration information into a pre-trained large model, so that the large model analyzes the target business process diagram modeling code, and outputs a test case based on the analysis result and the target use case format configuration information; The acquisition module is used to obtain a target test case set according to the test cases output by the large model.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, configured to implement the steps of the test case obtaining method as described in any one of claims 1 to 6 when executing a program stored in a memory.

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

10. A computer program product, comprising computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that an electronic device having the processor performs the steps of the test case acquisition method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Method and device for constructing business model, equipment and storage medium

    CN120560620A