Use case generation method, apparatus, device, and storage medium
By obtaining the functional descriptions of functional modules and the number of recommended test cases in the knowledge base, and combining them with a generative language model to generate test cases, the problem of inappropriate specification of the number of test cases in existing technologies is solved, and a comprehensive and accurate evaluation of the functional module testing process is achieved.
Patent Information
- Application Number
- CN202411815876.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In existing technologies, improper specification of the number of test cases can lead to an inability to fully evaluate the testing process of functional modules, or the generation of too many redundant test cases, making it impossible to accurately evaluate the testing process of functional modules.
By obtaining the functional descriptions of the functional modules and utilizing the functional descriptions and recommended test cases stored in the knowledge base, combined with a generative language model, test cases are generated. The matching algorithm determines the precise number and description of test cases, thus generating comprehensive and accurate test cases.
It enables a comprehensive and accurate evaluation of the functional module testing process, improves the comprehensiveness and accuracy of test case generation, and avoids the problem of too many or too few test cases.
Smart Images

Figure CN119645871B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a use case generation method and device, equipment and storage medium. BACKGROUND
[0002] A use case is a description of how a system reacts to external requests in software engineering or system engineering, including functional description of software engineering or system engineering, process description of reacting to external requests, and result description of reacting to external requests.
[0003] In related technologies, for a product, test cases of each functional module of the product need to be generated to show the test process of each functional module. The functional description of the functional module needs to be obtained first, and input information is generated in combination with the number of use cases specified by the test personnel, and the number of test cases corresponding to the functional module is generated by a large language model according to the input information.
[0004] However, since the number of use cases is specified by the test personnel, if the specified number of use cases is small, the generated test cases cannot fully evaluate the test process of the functional module, and if the specified number of use cases is large, the generated test cases are too redundant and cannot accurately evaluate the test process of the functional module. SUMMARY
[0005] Embodiments of the present application provide a use case generation method, device, equipment and storage medium. The technical solutions provided by the embodiments of the present application are as follows:
[0006] According to an aspect of an embodiment of the present application, a use case generation method is provided, the method comprising:
[0007] obtaining a functional description of a first functional module, the first functional module being a functional module of a first product;
[0008] obtaining functional descriptions and recommended numbers of use cases corresponding to each functional module of the first product stored in a knowledge base, and obtaining functional descriptions and numbers of use cases corresponding to at least one functional module matched with the first functional module;
[0009] generating at least one test case by a first generative language model according to the functional description of the first functional module, the functional descriptions and numbers of use cases corresponding to the at least one functional module, the at least one test case including test cases corresponding to the at least one functional module.
[0010] According to an aspect of an embodiment of the present application, a use case generation device is provided, the device comprising:
[0011] The description acquisition module is configured to acquire a function description of a first function module, the first function module being a function module of a first product;
[0012] The function matching module is configured to obtain, according to the function description corresponding to each function module of the first product and the number of recommended use cases corresponding to each function module of the first product stored in the knowledge base, the function description and the number of use cases corresponding to at least one function module matched with the first function module.
[0013] The use case generation module is configured to generate, by a first generative language model, at least one test use case according to the function description of the first function module, the function description and the number of use cases corresponding to the at least one function module, the at least one test use case including test use cases corresponding to the at least one function module.
[0014] According to an aspect of an embodiment of the present application, a computer device is provided, the computer device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the use case generation method described above.
[0015] According to an aspect of an embodiment of the present application, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, the computer program being loaded and executed by a processor to implement the use case generation method described above.
[0016] According to an aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being loaded and executed by a processor to implement the use case generation method described above.
[0017] The technical solutions provided by the embodiments of the present application can bring the following beneficial effects:
[0018] By matching the first function module with each function module of the first product stored in the knowledge base through the matching algorithm, the function description and the number of recommended use cases corresponding to at least one function module matched with the first function module are obtained, and the number of use cases corresponding to the at least one function module is determined according to the number of recommended use cases corresponding to the at least one function module. Compared with the related art in which the number of use cases is specified by a test personnel to generate test use cases, the function description and the number of use cases corresponding to the at least one function module obtained through the matching algorithm can provide more accurate function description reference and use case quantity reference for use case generation, thereby controlling the number of test use cases corresponding to each function module, achieving the effect of controlling the granularity of use case generation, and enabling the generated at least one test use case to comprehensively and accurately evaluate the test process of the first function module, improving the comprehensiveness and accuracy of use case generation. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a schematic diagram of a scheme implementation environment provided by an embodiment of the present application;
[0020] Figure 2 is a flowchart of a use case generation method provided by an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of a determination process of a number of use cases corresponding to each of at least one functional module provided by an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of an implementation of a number of use cases corresponding to a functional module provided by an embodiment of the present application;
[0023] Figure 5 is a flowchart of a use case generation method provided by another embodiment of the present application;
[0024] Figure 6 is a block diagram of a use case generation apparatus provided by an embodiment of the present application;
[0025] Figure 7 is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0026] To make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0027] Reference is made to Figure 1 which shows a schematic diagram of a scheme implementation environment provided by an embodiment of the present application. The scheme implementation environment can be implemented as a use case generation system. The scheme implementation environment can include a terminal device 10 and a server 20.
[0028] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a game console, an e-book reader, a multimedia playback device, a wearable device, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, etc.
[0029] A client of a target application can be installed in the terminal device 10, the target application having a functional description of a functional module according to user input, a function of generating a test use case, optionally, the target application can be an application that needs to be downloaded and installed, or an application that can be used immediately after being clicked, which is not limited in the present application.
[0030] The server 20 is configured to provide background services for the client of the target application program installed and running in the terminal device 10. For example, the server 20 can be a background server of the target application program. The server 20 can be a physical server, a server cluster composed of multiple servers, or a cloud computing service center. Alternatively, the server 20 provides background services for multiple target application programs in the terminal device 10. The terminal device 10 and the server 20 can communicate with each other through a network.
[0031] In the embodiments of the present application, the target application program is an application program that implements the use case generation function based on a generative language model and a knowledge base. The use case generation method provided by the present application can be implemented on the terminal device side or on the server side, and the present application is not limited in this regard. The user inputs the function description of the first function module in the target application program. The computer device (the client of the target application program or the server providing background services for the client of the target application program) obtains the function description corresponding to each function module of the first product and the number of recommended use cases corresponding to each function module according to the function description corresponding to each function module of the first product stored in the knowledge base. Then, the first generative language model generates at least one test use case according to the function description of the first function module, the function description corresponding to each function module, and the number of use cases corresponding to each function module. The at least one test use case is used to guide the modification of the function description of the first function module in the knowledge base.
[0032] Please refer to Figure 2 , which shows a flowchart of the use case generation method provided by an embodiment of the present application. The execution subject of each step of the method can be a computer device. The method can include at least one of the following steps 210-230:
[0033] Step 210, obtaining the function description of the first function module, the first function module being a function module of the first product.
[0034] Optionally, if the execution subject of the use case generation method provided by the present application is a terminal device, the user inputs the function description of the first function module in the target application program, and the client of the target application program obtains the function description of the first function module.
[0035] Optionally, if the execution subject of the use case generation method provided by the present application is a server, the client of the target application program sends the function description of the first function module to the server after the user inputs the function description of the first function module in the target application program, and the server receives the function description of the first function module.
[0036] The first function module is a function module of the first product. The first product can be a physical product, such as a vehicle, an air conditioner, a television, a sweeping robot, etc. The first product can also be a virtual product, such as a program, a music program, a video program, a tool program, etc. The present application does not limit the first product.
[0037] Optionally, the target application program can be an application program corresponding to the first product. The application program corresponding to the first product has a function of generating a test case corresponding to a function description according to the function description. For example, if the first product is a vehicle, the target application program can be a vehicle control program. For another example, if the first product is a music program, the target application program can be an application program corresponding to the music program. Optionally, the target application program can also be another application program unrelated to the first product. The target application program can be a function application program having a function of generating a test case according to a function description input by a user.
[0038] The first product has at least one function module. The first function module is any one of the at least one function module of the first product. For example, if the first product is a vehicle, the function modules of the first product include, but are not limited to, a start function module, a parking function module, a speed control module, an illumination function module, an air conditioning function module, etc. The first function module can be any one of the at least one function module of the vehicle. For example, if the first product is a music program, the function modules of the first product include, but are not limited to, a song playing module, a song collection module, a song comment module, a song sharing module, etc. The first function module can be any one of the at least one function module of the music program.
[0039] The first function module has at least one function. The function description of the first function module is used to comprehensively describe the at least one function of the first function module. For example, if the first product is a music program and the first function module is a song playing module of the music program, the at least one function of the first function module includes, but is not limited to, a progress bar dragging function, a function of starting playing a song, a function of playing a song to a climax, a function of playing a song to an end, a function of automatically switching a song after playing a song to an end, etc. The function description of the song playing module is used to comprehensively describe the functions of the song playing module.
[0040] It should be noted that the function description of the first function module is a function description customized by a user. Therefore, the function description of the first function module obtained in step 210 can not comprehensively describe all functions of the first function module.
[0041] At step 220, the function description and the number of recommended use cases corresponding to each function module matching the first function module are obtained according to the function description corresponding to each function module of the first product stored in the knowledge base and the number of recommended use cases corresponding to each function module of the first product.
[0042] Each function module can be implemented as one or more use cases, each use case corresponding to the function module is used to describe the implementation process of a function of the function module, and each use case specifically includes the description of the function of the function module, the description of the implementation process of the function of the function module, and the description of the implementation result of the function of the function module. For example, for the progress bar dragging function of the song playing module, the use case corresponding to the progress bar dragging function is used to describe the implementation process of the progress bar dragging function, and the use case includes the description of the progress bar dragging function, the description of the implementation process of the progress bar dragging function, and the description of the implementation result of the progress bar dragging function.
[0043] The number of use cases corresponding to the function module is determined by the functions of the function module, that is, the more functions the function module has, the more use cases the function module corresponds to. The number of recommended use cases corresponding to each function module of the first product stored in the knowledge base is determined in advance according to each function of each function module of the first product, and the number of recommended use cases corresponding to the function module is used to indicate the number of functions of the function module.
[0044] The function description corresponding to each function module of the first product stored in the knowledge base is obtained in advance according to each function of each function module of the first product, so that the function description of the function module stored in the knowledge base can comprehensively describe all functions of the function module.
[0045] Optionally, the knowledge base can be a knowledge base for the first product, in which the function description corresponding to each function module of the first product and the number of recommended use cases corresponding to each function module of the first product are stored, or a knowledge base for multiple products, in which the function description corresponding to each function module of the multiple products and the number of recommended use cases corresponding to each function module of the multiple products are stored.
[0046] The function description corresponding to each function module of the first product stored in the knowledge base and the recommended case number corresponding to each function module are used to provide a determination condition for obtaining the function description and the case number corresponding to each function module matched with the first function module. The at least one function module matched with the first function module is determined according to the function description corresponding to each function module of the first product stored in the knowledge base, the function description corresponding to each function module is obtained from the knowledge base after the at least one function module is determined, and the recommended case number corresponding to each function module is determined according to the recommended case number corresponding to each function module of the first product stored in the knowledge base.
[0047] In step 230, the first generative language model generates at least one test case according to the function description of the first function module, the function description and the case number corresponding to each function module, and the at least one test case includes the test case corresponding to each function module.
[0048] The first generative language model is a model obtained by fine-tuning training a large language model according to the first training sample. The large language model herein can be any publicly available large language model, such as a natural language model based on a transformer structure trained with a large amount of data, and the amount of data can reach a sample level of hundreds of millions or more, which is not limited in the present application.
[0049] The training process of the first generative language model is as follows: at least one first training sample of the first generative language model is obtained, each first training sample includes the function description of a sample function module and at least one first sample test case, and the sample function module is a function module of the first product. According to the function description corresponding to each function module of the first product stored in the knowledge base and the recommended case number corresponding to each function module, the function description and the case number corresponding to each function module matched with the sample function module are obtained. At least one predicted test case is generated by the first generative language model according to the function description of the sample function module, the function description and the case number corresponding to each function module matched with the sample function module. The parameters of the large language model are adjusted to reduce the difference between the at least one first sample test case and the at least one predicted test case as the training target, and the first generative language model is obtained.
[0050] According to the function description of the first function module, the function description corresponding to each of the at least one function module, and the number of use cases, a prompt information is obtained, and the prompt information is used to instruct the first generative language model to generate the at least one test case according to the function description of the first function module, the function description corresponding to each of the at least one function module, and the number of use cases. The function description of the first function module, the function description corresponding to each of the at least one function module, the number of use cases, and the prompt information are input into the first generative language model, and the at least one test case is output.
[0051] The function description corresponding to each of the at least one function module is used to instruct the first generative language model to generate the test case corresponding to each of the at least one function module, the function description of the first function module is used to assist the first generative language model to generate the test case corresponding to each of the at least one function module, and the number of use cases corresponding to each of the at least one function module is used to guide the number of use cases of the test case corresponding to each of the at least one function module generated by the first generative language model.
[0052] The at least one test case includes the test case corresponding to each of the at least one function module, the number of use cases of the test case corresponding to each function module is determined by the number of use cases corresponding to the function module, but the number of use cases of the test case corresponding to each function module is not necessarily the same as the number of use cases corresponding to the function module. The number of use cases of the test case corresponding to the function module can be greater than, less than, or equal to the number of use cases corresponding to the function module.
[0053] Optionally, the number of use cases of the test case corresponding to the function module can be greater than the number of use cases corresponding to the function module. For example, the function description of the first function module can include function description content that is not included in the function description of a certain function module. Therefore, the test case corresponding to the function module generated by the first generative language model can include the test case corresponding to the function description content, so that the number of test cases corresponding to the function module is greater than the number of use cases corresponding to the function module.
[0054] Optionally, the number of use cases of the test case corresponding to the function module can be less than the number of use cases corresponding to the function module. For example, the number of functions described in the function description of a certain function module can be less than the number of use cases corresponding to the function module. Therefore, the test case corresponding to the function module generated by the first generative language model can only include the test case corresponding to the function description of the function module, so that the number of test cases corresponding to the function module is less than the number of use cases corresponding to the function module.
[0055] Optionally, the number of test cases corresponding to each function module can be equal to the number of test cases corresponding to each function module. For example, the function description of the first function module does not contain the function description content that is not contained in the function description of another function module, and the number of functions described in the function description of each function module is equal to the number of test cases corresponding to the function module. Therefore, the number of test cases corresponding to each function module generated by the first generative language model is equal to the number of test cases corresponding to each function module.
[0056] For example, the function description corresponding to at least one function module includes the function description corresponding to function module a and the function description corresponding to function module b. The number of test cases corresponding to function module a is 10, and the number of test cases corresponding to function module b is 15. Therefore, the at least one test case generated by the first generative language model includes the test case corresponding to function module a and the test case corresponding to function module b. The number of test cases corresponding to function module a can be less than 10, greater than 10, or equal to 10. The number of test cases corresponding to function module b can be less than 15, greater than 15, or equal to 15.
[0057] The technical scheme provided by the embodiments of the present application matches the first function module and each function module of the first product stored in the knowledge base by using a matching algorithm, obtains the function description and the recommended number of test cases corresponding to at least one function module matched with the first function module, and determines the number of test cases corresponding to at least one function module according to the recommended number of test cases corresponding to at least one function module. Compared with the related art in which the number of test cases is specified by a test personnel, the function description and the number of test cases corresponding to at least one function module obtained by the above matching algorithm can provide more accurate function description reference and test case number reference for test case generation, thereby controlling the number of test cases corresponding to each function module and achieving the effect of controlling the granularity of test case generation. The at least one test case generated can comprehensively and accurately evaluate the test process of the first function module, and improve the comprehensiveness and accuracy of test case generation.
[0058] In some embodiments, step 220 includes at least one of sub-steps 221-223.
[0059] In sub-step 221, at least one function module matched with the first function module is obtained according to the function description corresponding to each function module stored in the knowledge base and the function description of the first function module.
[0060] The matching algorithm matches each functional module in the knowledge base with the first functional module according to the function description corresponding to each functional module stored in the knowledge base and the function description of the first functional module. The following detailed example is a matching algorithm.
[0061] In some embodiments, sub-step 221 includes at least one of sub-steps 2211-2214.
[0062] Sub-step 2211 performs text vectorization on the function description of the first functional module to obtain a function description vector corresponding to the first functional module.
[0063] Text vectorization is the process of converting text into numerical vectors and is a basic technology in natural language processing. Through text vectorization, text can be represented in a form that can be processed by computer devices, thereby facilitating subsequent analysis and mining work. In this process, first, word segmentation is performed to divide text into individual words or tokens, and then a vocabulary table is constructed to collect all words or tokens appearing in the text and assign a unique index to each word or token. Next, each text sample is represented as a numerical vector, usually by taking the word frequency of each word as a feature value to form a vector. Finally, the feature vector can be standardized to eliminate differences between different text lengths and feature scales.
[0064] Common text vectorization methods include bag-of-words, TF-IDF (Term Frequency-Inverse Document Frequency), Word2vec, Doc2vec, etc. Bag-of-words is the earliest text vectorization method that takes words as the basic processing unit. It treats text as a collection of words, ignoring word order and grammatical structure. TF-IDF is a statistical method based on word frequency, used to evaluate the importance of a word to a file set or a document in a corpus. Word2vec can obtain the similarity relationship between words by training a large amount of corpus.
[0065] The quality of text vectorization directly affects the performance of the entire natural language processing system, so when performing text vectorization, appropriate methods and parameters need to be selected and necessary optimization and adjustment need to be performed to obtain better results.
[0066] Text vectorization is performed on the function description of the first functional module to obtain a function description vector corresponding to the first functional module, and the function description vector corresponding to the first functional module is used to represent the function description of the first functional module in the form of a numerical vector.
[0067] In substep 2212, the function description vectors respectively corresponding to the function modules are obtained.
[0068] The function description vectors respectively corresponding to the function modules can be obtained by performing text vectorization on the function descriptions respectively corresponding to the function modules stored in the knowledge base in advance. The function description vectors respectively corresponding to the function modules are used to represent the function descriptions of the function modules in the form of numerical vectors.
[0069] In substep 2213, the similarity between the function description vector corresponding to the first function module and the function description vectors respectively corresponding to the function modules is calculated to obtain the similarities respectively corresponding to the function modules.
[0070] The similarity between the function description vector corresponding to the first function module and the function description vectors respectively corresponding to the function modules is calculated by using a similarity calculation method to obtain the similarities respectively corresponding to the function modules. The similarity calculation method includes, but is not limited to, cosine similarity, Euclidean distance, Manhattan distance, Hamming distance, etc.
[0071] The similarity corresponding to each function module refers to the similarity between the function description vector corresponding to the function module and the function description vector corresponding to the first function module.
[0072] In substep 2214, the function modules with similarities greater than or equal to the first threshold value in the similarities respectively corresponding to the function modules are determined as the at least one function module.
[0073] The specific value of the first threshold value is set by the tester according to the use case generation requirement, and the present application does not make any limitation.
[0074] The at least one function module is determined according to the similarity between the function description vector corresponding to the first function module and the function description vectors respectively corresponding to the function modules, so that the function of the determined at least one function module is the same as or similar to the function of the first function module. Therefore, at least one test case is generated based on the function descriptions respectively corresponding to the at least one function module and the number of use cases, and the generated at least one test case can more comprehensively and accurately evaluate the test process of the first function module, which helps to improve the comprehensiveness and accuracy of the use case generation.
[0075] In some embodiments, feature extraction is performed on the function description of the first function module to obtain a function description feature corresponding to the first function module; the function description features corresponding to each function module are obtained; similarity between the function description feature corresponding to the first function module and the function description features corresponding to each function module is calculated to obtain second similarities corresponding to each function module; and the function modules with the second similarities greater than or equal to a second threshold value in the second similarities corresponding to each function module are determined as the at least one function module.
[0076] Sub-step 222: obtaining, from the knowledge base, the function description corresponding to each of the at least one function module and the number of recommended use cases corresponding to each of the at least one function module.
[0077] After obtaining the at least one function module matching the first function module, the function description corresponding to each of the at least one function module and the number of recommended use cases corresponding to each of the at least one function module are obtained from the knowledge base according to the at least one function module.
[0078] Sub-step 223: obtaining, according to the number of recommended use cases corresponding to each of the at least one function module, the number of use cases corresponding to each of the at least one function module.
[0079] The number of use cases corresponding to each of the at least one function module is determined by the number of recommended use cases corresponding to each of the at least one function module, and the specific determination manner can refer to the following embodiments.
[0080] By determining the at least one function module matching the first function module first, then obtaining the function description corresponding to each of the at least one function module, and obtaining the number of use cases corresponding to each of the at least one function module according to the number of recommended use cases corresponding to each of the at least one function module, the number of use cases corresponding to each of the at least one function module is determined by an algorithm rather than specified by a tester in the related art, so that the number of use cases can control the number of test cases corresponding to each function module, avoiding generating too many or too few test cases and affecting the comprehensiveness and accuracy of case generation.
[0081] The number of use cases corresponding to each of the at least one function module can include the following two determination manners.
[0082] Manner one: the number of recommended use cases corresponding to each of the at least one function module is determined as the number of use cases corresponding to each of the at least one function module.
[0083] Manner one is to directly determine the number of recommended use cases corresponding to each of the at least one function module obtained in sub-step 222 as the number of use cases corresponding to each of the at least one function module. That is, the number of use cases corresponding to each function module is equal to the number of recommended use cases corresponding to the function module.
[0084] The second method is to determine the case number corresponding to each of the at least one function module according to the recommended case number corresponding to each of the at least one function module and the historical case number corresponding to each of the at least one function module. The historical case number corresponding to a function module is used to indicate the number of test cases generated by performing case generation on the function module in the historical time period.
[0085] The second method is to determine the case number corresponding to each of the at least one function module according to the recommended case number corresponding to each of the at least one function module and the historical case number corresponding to each of the at least one function module. The historical case number corresponding to a function module is used to indicate the number of test cases generated by performing case generation on the function module in the historical time period.
[0086] Figure 3 The determination process of the case number corresponding to each of the at least one function module is shown. First, a knowledge base is obtained. The knowledge base stores the function description corresponding to each function module of the first product and the recommended case number corresponding to each function module of the first product. According to the function description corresponding to each function module and the function description of the first function module, at least one function module matching the first function module is obtained. Then, the function description corresponding to each of the at least one function module and the recommended case number corresponding to each of the at least one function module are obtained from the knowledge base. The case number corresponding to each of the at least one function module is determined according to the recommended case number corresponding to each of the at least one function module and the historical case number corresponding to each of the at least one function module.
[0087] The historical case number corresponding to a function module is determined by the number of test cases generated by performing case generation on the function module in the historical time period.
[0088] In some embodiments, there is at least one case generation on the function module in the historical time period. The average value of the number of test cases corresponding to each of the at least one case generation is determined as the historical case number corresponding to the function module.
[0089] The historical time period is set by the tester according to the use case generation requirement, and the application is not limited. At least one use case generation is performed on the function module in the historical time period. Optionally, at least one use case generation performed on the function module in the historical time period can be obtained by setting the historical time period. Optionally, the historical time period can also be obtained by setting the number of at least one use case generation. For example, the historical time period can be set to one week, and at least one use case generation performed on the function module in the one week is obtained according to the historical time period, and the number of at least one use case generation is determined by the time length of the historical time period. For example, the number of at least one use case generation can be set to 5, and the historical time period corresponding to the last 5 use case generations is obtained according to the number of at least one use case generation, and the historical time period is determined by the number of at least one use case generation.
[0090] The number of test cases obtained by at least one use case generation performed on the function module in the historical time period is obtained, the average value of the number of test cases corresponding to at least one use case generation is calculated, and the average value of the number of test cases corresponding to at least one use case generation is determined as the historical use case number corresponding to the function module.
[0091] In some embodiments, the maximum value of the number of test cases corresponding to at least one use case generation is determined as the historical use case number corresponding to the function module.
[0092] By averaging or taking the maximum value of the number of test cases obtained by at least one use case generation performed on the function module in the historical time period, the historical use case number corresponding to the function module can fully represent the use case generation in the historical time period, thereby ensuring the accuracy of determining the number of use cases corresponding to each of the at least one function module.
[0093] For the specific implementation of the above-mentioned mode two, the following two modes can be used.
[0094] Mode one: for each function module in the at least one function module, if the historical use case number corresponding to the function module is greater than or equal to the recommended use case number corresponding to the function module, the historical use case number corresponding to the function module is determined as the use case number corresponding to the function module, and if the historical use case number corresponding to the function module is less than the recommended use case number corresponding to the function module, the recommended use case number corresponding to the function module is determined as the use case number corresponding to the function module.
[0095] The implementation process of mode one can refer to Figure 4As shown, for each of the at least one function module, the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module are obtained. The numerical values of the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module are judged, and it is judged whether the historical case quantity corresponding to the function module is greater than or equal to the recommended case quantity corresponding to the function module. If the historical case quantity corresponding to the function module is greater than or equal to the recommended case quantity corresponding to the function module, the historical case quantity corresponding to the function module is selected, and the historical case quantity corresponding to the function module is determined as the case quantity corresponding to the function module. If the historical case quantity corresponding to the function module is less than the recommended case quantity corresponding to the function module, the recommended case quantity corresponding to the function module is selected, and the recommended case quantity corresponding to the function module is determined as the case quantity corresponding to the function module.
[0096] By selecting the greater value of the recommended case quantity and the historical case quantity as the case quantity corresponding to the function module, it is avoided that the smaller value is selected to cause the generated test case to be insufficient to comprehensively evaluate the test process of the first function module, thereby causing the inaccuracy of the case generation.
[0097] Method two: for each of the at least one function module, the average value of the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module is determined as the case quantity corresponding to the function module.
[0098] The implementation process of the implementation manner of method two is: for each of the at least one function module, the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module are obtained, the average value of the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module is calculated, and the average value of the recommended case quantity corresponding to the function module and the historical case quantity corresponding to the function module is determined as the case quantity corresponding to the function module.
[0099] By taking the average value of the recommended case quantity and the historical case quantity as the case quantity corresponding to the function module, the determined case quantity considers the recommended case quantity and the historical case quantity at the same time, which can avoid that the generated test case is insufficient to comprehensively evaluate the test process of the first function module due to the small case quantity, and can also avoid that the generated test case is too redundant due to the large case quantity, thereby improving the comprehensiveness and accuracy of the case generation.
[0100] In some embodiments, step 230 includes at least one of sub-steps 231-232.
[0101] The sub-step 231 is to obtain, for each of the at least one function module, a comprehensive function description of the function module according to the test case corresponding to the function module, the comprehensive function description being used to summarize at least one function of the function module.
[0102] The at least one test case includes test cases corresponding to the at least one function module respectively, and for each of the at least one function module, the test case corresponding to the function module is obtained from the at least one test case. The number of test cases of each function module can be one or multiple, and each test case is used to indicate a test process of a function of the function module corresponding to the test case. The test case corresponding to each function module is used to indicate test processes of functions of the function module.
[0103] The comprehensive function description of the function module is obtained by the language understanding model according to the test case corresponding to the function module, and is a text obtained by integrating the test case corresponding to the function module and used to summarize at least one function of the function module. In addition, if the number of test cases of the function module is one, the comprehensive function description of the function module is the test case of the function module.
[0104] For example, for a song playing module of a music program, the test cases corresponding to the song playing module include a test case of a progress bar dragging function, a test case of a song starting playing function, a test case of a song playing to a climax part function, a test case of a song playing to an ending part function, and a test case of a song automatically switching after a song playing ends function. The comprehensive function description corresponding to the song playing module is obtained according to the test cases corresponding to the song playing module, and is used to summarize functions of the song playing module, that is, the comprehensive function description corresponding to the song playing module is used to summarize the progress bar dragging function, the song starting playing function, the song playing to a climax part function, the song playing to an ending part function, and the song automatically switching after a song playing ends function of the song playing module.
[0105] The sub-step 232 is to update the function description of the function module stored in the knowledge base according to the comprehensive function description of the function module, to obtain an updated function description of the function module.
[0106] After the comprehensive function description of the function module is obtained, the function description of the function module stored in the knowledge base is updated to obtain an updated function description of the function module.
[0107] In some embodiments, the function description of the function module stored in the knowledge base is replaced by the comprehensive function description of the function module, and the updated function description of the function module in the knowledge base is the comprehensive function description of the function module.
[0108] In some embodiments, the updated function description of the function module is obtained by the language understanding model according to the comprehensive function description of the function module and the function description of the function module stored in the knowledge base. The updated function description of the function module is the function description obtained after the semantic fusion of the comprehensive function description of the function module and the function description of the function module stored in the knowledge base.
[0109] By modifying and updating the function description of the function module stored in the knowledge base after obtaining the test case corresponding to the function module, the updated function description of the function module can more accurately represent at least one function of the function module, so that the accuracy of the case generation can be improved when the case generation of the first function module is executed again subsequently.
[0110] Please refer to Figure 5 which shows a flowchart of a case generation method provided by another embodiment of the present application. The execution subject of each step of the method can be a computer device. The method can include at least one of the following steps 510-530:
[0111] Step 510, obtaining a function description of a first function module, the first function module being a function module of a first product.
[0112] Step 520, obtaining a case number corresponding to a second function module matched with the first function module according to the function description corresponding to each function module of the first product stored in the knowledge base and the recommended case number corresponding to each function module, the second function module being the function module corresponding to the maximum value of the similarity.
[0113] The maximum value of the similarity refers to the maximum value in the similarity between the function description corresponding to the first function module and the function description corresponding to each function module.
[0114] In some embodiments, text vectorization is performed on the function description of the first function module to obtain a function description vector corresponding to the first function module; the function description vector corresponding to each function module is obtained; the similarity between the function description vector corresponding to the first function module and the function description vector corresponding to each function module is calculated to obtain the similarity corresponding to each function module; the function module corresponding to the maximum value of the similarity in the similarity corresponding to each function module is determined as the second function module. The maximum value of the similarity refers to the maximum value in the similarity between the function description vector corresponding to the first function module and the function description vector corresponding to each function module.
[0115] In some embodiments, feature extraction is performed on the function description of the first function module to obtain a function description feature corresponding to the first function module; function description features corresponding to each function module are obtained; similarity between the function description feature corresponding to the first function module and the function description features corresponding to each function module is calculated to obtain second similarities corresponding to each function module; and a function module corresponding to a maximum value of the second similarities in the second similarities corresponding to each function module is determined as the second function module. The maximum value of the similarities refers to a maximum value in the similarities between the function description feature corresponding to the first function module and the function description features corresponding to each function module.
[0116] Optionally, the second function module can be the same function module as the first function module. Optionally, the second function module can also be a function module with the highest similarity in function description to the function description of the first function module.
[0117] After the second function module is obtained, a function description corresponding to the second function module and a recommended number of use cases corresponding to the second function module are obtained from the knowledge base, and a number of use cases corresponding to the second function module is obtained according to the recommended number of use cases corresponding to the second function module.
[0118] In some embodiments, the recommended number of use cases corresponding to the second function module is determined as the number of use cases corresponding to the second function module.
[0119] In some embodiments, in a case where a historical number of use cases corresponding to the second function module is greater than or equal to the recommended number of use cases corresponding to the second function module, the historical number of use cases corresponding to the second function module is determined as the number of use cases corresponding to the second function module. In a case where the historical number of use cases corresponding to the second function module is less than the recommended number of use cases corresponding to the second function module, the recommended number of use cases corresponding to the second function module is determined as the number of use cases corresponding to the second function module.
[0120] In some embodiments, an average of the recommended number of use cases corresponding to the second function module and the historical number of use cases corresponding to the function module is determined as the number of use cases corresponding to the second function module.
[0121] In step 530, a test use case corresponding to the first function module is generated by the second generative language model according to the function description of the first function module and the number of use cases corresponding to the second function module.
[0122] The second generative language model is a model obtained by fine-tuning training the large language model according to second training samples. The training process of the second generative language model is as follows: at least one second training sample of the second generative language model is obtained, each second training sample includes a function description of a sample function module and a second sample test case, and the sample function module is a function module of the first product. According to the function description corresponding to each function module of the first product stored in the knowledge base and the number of recommended test cases corresponding to each function module, the number of test cases corresponding to the second function module matched with the sample function module is obtained. The second generative language model generates a predicted test case corresponding to the sample function module according to the function description of the sample function module and the number of test cases corresponding to the second function module matched with the sample function module. The parameters of the large language model are adjusted to obtain the second generative language model, with the training target of reducing the difference between the second sample test case and the predicted test case corresponding to the sample function module.
[0123] According to the function description of the first function module and the number of test cases corresponding to the second function module, the prompt information is obtained, and the prompt information is used to instruct the second generative language model to generate a test case corresponding to the first function module according to the function description of the first function module and the number of test cases corresponding to the second function module. The function description of the first function module, the number of test cases corresponding to the second function module and the prompt information are input into the second generative language model, and a test case corresponding to the first function module is output.
[0124] The number of test cases corresponding to the first function module is determined by the number of test cases corresponding to the second function module, but the number of test cases corresponding to the second function module is not necessarily the same as the number of test cases corresponding to the second function module. The number of test cases corresponding to the second function module can be greater than, less than, or equal to the number of test cases corresponding to the second function module.
[0125] In some embodiments, according to the test case corresponding to the second function module, a comprehensive function description of the second function module is obtained, and the function description of the second function module stored in the knowledge base is updated according to the comprehensive function description of the second function module to obtain an updated function description of the second function module. Optionally, the updated function description of the second function module can be the comprehensive function description of the second function module, or a function description obtained by performing semantic fusion on the comprehensive function description of the second function module and the function description of the second function module stored in the knowledge base.
[0126] It should be noted that the input data of the second generative language model can not include the function description of the second function module stored in the knowledge base, and the test case corresponding to the first function module is generated only according to the function description of the first function module and the number of use cases corresponding to the second function module.
[0127] In some embodiments, the second generative language model generates the test case corresponding to the first function module according to the function description of the first function module, the function description corresponding to the second function module, and the number of use cases corresponding to the second function module.
[0128] The matching algorithm is used to determine the second function module that best matches the first function module, and the function description and the number of use cases corresponding to the second function module are obtained, so that the second generative language model generates the test case corresponding to the first function module according to the function description of the first function module and the number of use cases corresponding to the second function module, and the generated test case corresponding to the first function module can more accurately represent the test process of the second function module, thereby improving the accuracy of the use case generation.
[0129] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.
[0130] Please refer to Figure 6 , which shows a block diagram of a use case generation apparatus according to an embodiment of the present application. The apparatus has the function of implementing the above-mentioned use case generation method, which can be realized by hardware or corresponding software executed by hardware. The apparatus can be the computer device introduced above, or can be arranged in the computer device. As Figure 6 shown, the apparatus 600 can include a description acquisition module 610, a function matching module 620, and a use case generation module 630.
[0131] The description acquisition module 610 is configured to acquire the function description of the first function module, wherein the first function module is a function module of a first product.
[0132] The function matching module 620 is configured to obtain the function description and the number of use cases corresponding to at least one function module matched with the first function module according to the function description and the number of recommended use cases corresponding to each function module of the first product stored in the knowledge base.
[0133] The use case generation module 630 is configured to generate at least one test case by the first generative language model according to the function description of the first function module, the function description and the number of use cases corresponding to the at least one function module, wherein the at least one test case includes the test case corresponding to the at least one function module.
[0134] In some embodiments, the function matching module 620 is configured to:
[0135] obtain the at least one function module matched with the first function module according to the function description corresponding to each function module stored in the knowledge base and the function description of the first function module;
[0136] obtain the function description corresponding to each of the at least one function module and the number of recommended use cases corresponding to each of the at least one function module from the knowledge base;
[0137] obtain the number of use cases corresponding to each of the at least one function module according to the number of recommended use cases corresponding to each of the at least one function module.
[0138] In some embodiments, the function matching module 620 is configured to:
[0139] perform text vectorization on the function description of the first function module to obtain a function description vector corresponding to the first function module;
[0140] obtain the function description vector corresponding to each function module;
[0141] calculate the similarity between the function description vector corresponding to the first function module and the function description vector corresponding to each function module to obtain the similarity corresponding to each function module;
[0142] determine the function module with a similarity greater than or equal to a first threshold value in the similarity corresponding to each function module as the at least one function module.
[0143] In some embodiments, the apparatus 600 further comprises a second generation module configured to:
[0144] obtain the number of use cases corresponding to a second function module matched with the first function module according to the function description corresponding to each function module stored in the knowledge base and the number of recommended use cases corresponding to each function module, the second function module being the function module corresponding to the maximum value of the similarity;
[0145] generate the test case corresponding to the first function module according to the function description of the first function module and the number of use cases corresponding to the second function module by using a second generative language model.
[0146] In some embodiments, the function matching module 620 is configured to:
[0147] determining the number of use cases corresponding to each of the at least one function module as the recommended number of use cases corresponding to each of the at least one function module respectively;
[0148] or,
[0149] determining the number of use cases corresponding to each of the at least one function module according to the recommended number of use cases corresponding to each of the at least one function module and the historical number of use cases corresponding to each of the at least one function module, wherein the historical number of use cases corresponding to each of the at least one function module is used to indicate the number of test cases generated by performing use case generation on the function module in a historical time period.
[0150] In some embodiments, the function matching module 620 is configured to:
[0151] For each of the at least one function module, if the historical number of use cases corresponding to the function module is greater than or equal to the recommended number of use cases corresponding to the function module, the historical number of use cases corresponding to the function module is determined as the number of use cases corresponding to the function module; if the historical number of use cases corresponding to the function module is less than the recommended number of use cases corresponding to the function module, the recommended number of use cases corresponding to the function module is determined as the number of use cases corresponding to the function module.
[0152] or,
[0153] For each of the at least one function module, an average value of the recommended number of use cases corresponding to the function module and the historical number of use cases corresponding to the function module is determined as the number of use cases corresponding to the function module.
[0154] In some embodiments, the function matching module 620 is configured to:
[0155] determining the historical number of use cases corresponding to each of the at least one function module as an average value of the number of test cases corresponding to each of the at least one use case generation;
[0156] or,
[0157] determining the historical number of use cases corresponding to each of the at least one function module as a maximum value in the number of test cases corresponding to each of the at least one use case generation.
[0158] In some embodiments, the apparatus 600 further comprises a description updating module, and the description updating module is configured to:
[0159] For each of the at least one function module, according to the test case corresponding to the function module, an integrated function description of the function module is obtained, and the integrated function description is used to summarize at least one function of the function module;
[0160] According to the integrated function description of the function module, the function description of the function module stored in the knowledge base is updated to obtain the updated function description of the function module.
[0161] By matching the first function module and each function module of the first product stored in the knowledge base, the function description and the recommended case number corresponding to each of the at least one function module matched with the first function module are obtained, and the case number corresponding to each of the at least one function module is determined according to the recommended case number corresponding to each of the at least one function module. Compared with the case number generated by the test personnel in the related art, the function description and the case number corresponding to each of the at least one function module obtained by the matching algorithm can provide more accurate function description reference and case number reference for case generation, thereby controlling the case number of each function module corresponding to the test case, realizing the effect of controlling the granularity of case generation, and enabling the generated at least one test case to comprehensively and accurately evaluate the test process of the first function module, and improving the comprehensiveness and accuracy of case generation.
[0162] It should be noted that the device provided in the above embodiments is only exemplified by the division of the above function modules when realizing its functions, and in actual application, the above functions can be completed by different function modules according to needs, that is, the content structure of the device is divided into different function modules to complete all or part of the above described functions. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0163] Please refer to Figure 7 which shows a structural block diagram of a computer device 700 provided in an embodiment of the present application. The computer device 700 can be any electronic device with data computing, processing and storage functions. The computer device 700 can be used to implement the case generation method provided in the above embodiments.
[0164] Generally, the computer device 700 includes a processor 701 and a memory 702.
[0165] The processor 701 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field Programmable Gate Array), a PLA (Programmable Logic Array). The processor 701 can also include a main processor and a co-processor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit), and the co-processor being a low-power processor for processing data in a standby state. In some embodiments, the processor 701 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by a display screen. In some embodiments, the processor 701 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
[0166] The memory 702 can include one or more computer-readable storage media that can be non-transitory. The memory 702 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 702 is configured to store a computer program configured to be executed by one or more processors to implement the use case generation method described above.
[0167] Those skilled in the art can understand that, Figure 7 The structure shown in the figure does not constitute a limitation on the computer device 700, and can include more or fewer components than shown, or combine certain components, or adopt a different arrangement of components.
[0168] In the illustrative embodiments, a computer-readable storage medium is also provided, the storage medium storing a computer program, the computer program implementing the use case generation method described above when executed by a processor of a computer device. Optionally, the computer-readable storage medium described above can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0169] In an example embodiment, a computer program product is also provided, which includes a computer program stored in a computer readable storage medium. A processor of a computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device performs the use case generation method described above.
[0170] It should be understood that "multiple" mentioned herein refers to two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A existing alone, A and B existing together, and B existing alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. In addition, the step numbers described herein only exemplarily show a possible execution order between steps. In some other embodiments, the above steps can also be executed in a non-numbered order, such as two steps with different numbers being executed at the same time, or two steps with different numbers being executed in an order opposite to that shown in the figure. The embodiments of the present application are not limited in this regard.
[0171] The above only describes example embodiments of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A use case generation method characterized by, The method comprises: obtaining a function description of a first function module, the first function module being a function module of a first product; obtaining, according to function descriptions respectively corresponding to function modules of the first product and numbers of recommended use cases respectively corresponding to the function modules, function descriptions respectively corresponding to at least one function module matched with the first function module and numbers of recommended use cases respectively corresponding to the at least one function module; obtaining, according to numbers of recommended use cases respectively corresponding to the at least one function module and numbers of historical use cases respectively corresponding to the at least one function module, numbers of use cases respectively corresponding to the at least one function module, the numbers of historical use cases respectively corresponding to the function modules being used to indicate numbers of test cases generated by performing use case generation on the function modules in a historical time period; generating, by a first generative language model, at least one test case according to the function description of the first function module, the function descriptions respectively corresponding to the at least one function module and the numbers of use cases respectively corresponding to the at least one function module, the at least one test case comprising test cases respectively corresponding to the at least one function module; obtaining, according to the function descriptions respectively corresponding to the function modules of the first product and the numbers of recommended use cases respectively corresponding to the function modules, a number of use cases corresponding to a second function module matched with the first function module, the second function module being a function module corresponding to a maximum value of similarities respectively corresponding to the function modules, the similarity respectively corresponding to the function module being a similarity between the function description of the first function module and a function description corresponding to the function module; generating, by a second generative language model, a test case corresponding to the first function module according to the function description of the first function module and the number of use cases corresponding to the second function module.
2. The method of claim 1, wherein, The obtaining, according to function descriptions respectively corresponding to function modules of the first product and numbers of recommended use cases respectively corresponding to the function modules, function descriptions respectively corresponding to at least one function module matched with the first function module and numbers of recommended use cases respectively corresponding to the at least one function module, comprises: obtaining, according to the function descriptions respectively corresponding to the function modules and the function description of the first function module, the at least one function module matched with the first function module; obtaining, from the knowledge base, function descriptions respectively corresponding to the at least one function module and numbers of recommended use cases respectively corresponding to the at least one function module.
3. The method of claim 2, wherein, The obtaining, according to the function descriptions respectively corresponding to the function modules and the function description of the first function module, the at least one function module matched with the first function module, comprises: performing text vectorization on the function description of the first function module to obtain a function description vector corresponding to the first function module; obtaining function description vectors respectively corresponding to the function modules; calculating similarities between the function description vector corresponding to the first function module and function description vectors respectively corresponding to the function modules to obtain similarities respectively corresponding to the function modules; and The function module corresponding to the similarity greater than or equal to the first threshold value is determined as the at least one function module.
4. The method of claim 1, wherein, The at least one function module respectively corresponds to a recommended use case quantity and a historical use case quantity of the at least one function module. For each function module in the at least one function module, if the historical use case quantity corresponding to the function module is greater than or equal to the recommended use case quantity corresponding to the function module, the historical use case quantity corresponding to the function module is determined as the use case quantity corresponding to the function module; if the historical use case quantity corresponding to the function module is less than the recommended use case quantity corresponding to the function module, the recommended use case quantity corresponding to the function module is determined as the use case quantity corresponding to the function module. Or, For each function module in the at least one function module, an average value of the recommended use case quantity corresponding to the function module and the historical use case quantity corresponding to the function module is determined as the use case quantity corresponding to the function module.
5. The method of claim 1, wherein, The historical use case quantity corresponding to the function module is used to indicate a quantity of test cases generated by performing use case generation on the function module in a historical time period, and the method further includes: An average value of quantities of test cases corresponding to the at least one use case generation is determined as the historical use case quantity corresponding to the function module. Or, A maximum value of the quantities of test cases corresponding to the at least one use case generation is determined as the historical use case quantity corresponding to the function module.
6. The method of claim 1, wherein, The method further includes: For each function module in the at least one function module, a comprehensive function description of the function module is obtained according to test cases corresponding to the function module, and the comprehensive function description is used to summarize at least one function of the function module. The function description of the function module stored in the knowledge base is updated according to the comprehensive function description of the function module, to obtain an updated function description of the function module.
7. A use case generation apparatus characterized by comprising: The apparatus includes: A description acquisition module is configured to acquire a function description of a first function module, the first function module being a function module of a first product; A function matching module is configured to obtain function descriptions and recommended use case quantities corresponding to at least one function module matched with the first function module according to function descriptions and recommended use case quantities corresponding to respective function modules of the first product stored in a knowledge base, and obtain use case quantities corresponding to the at least one function module according to recommended use case quantities and historical use case quantities corresponding to the at least one function module, the historical use case quantity of the function module being used to indicate a quantity of test cases generated by performing use case generation on the function module in a historical time period. The use case generation module is configured to generate at least one test case by a first generative language model according to the function description of the first function module, the function description corresponding to each of the at least one function module, and the number of use cases, wherein the at least one test case comprises the test case corresponding to each of the at least one function module; The second generation module is configured to obtain the number of use cases corresponding to a second function module matched with the first function module according to the function description corresponding to each of the function modules stored in the knowledge base and the recommended number of use cases corresponding to each of the function modules, wherein the second function module is the function module corresponding to the maximum value of the similarity of each of the function modules, and the similarity of the function module refers to the similarity between the function description of the first function module and the function description corresponding to the function module; and the second generation module is further configured to generate the test case corresponding to the first function module by a second generative language model according to the function description of the first function module and the number of use cases corresponding to the second function module.
8. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores a computer program, which is loaded and executed by the processor to implement the use case generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which is loaded and executed by the processor to implement the use case generation method according to any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program product comprises a computer program, which is loaded and executed by the processor to implement the use case generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Test case generation system based on large language model
CN117520148A
Test case construction method and system based on knowledge base and storage medium
CN118672920A