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

Processing requirement documents and generating test cases through large language models solves the problems of manual writing of test cases that are time-consuming and labor-intensive and has poor flexibility, achieving efficient and accurate test case generation and flexible demand response.

CN118779223APending Publication Date: 2024-10-15BEIJING RENKE INTERACTIVE NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410839839.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In existing software testing, manually writing test cases is time-consuming and labor-intensive, prone to errors, and cannot flexibly respond to changes in requirements, affecting testing efficiency and quality.

Method used

The natural language processing module of the large language model is used to convert requirement documents into standard expressions in the business knowledge base, filter and classify business function fragments, generate test cases, and present them through mind mapping tools.

Benefits of technology

It achieves efficient and accurate test case generation, saves human resources, improves testing efficiency, and flexibly responds to demand changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779223A_ABST
    Figure CN118779223A_ABST
Patent Text Reader

Abstract

The invention provides a test case generation method and device, electronic equipment and a storage medium, and relates to the technical field of software testing. The test case generation method comprises the following steps: converting a natural statement related to a business function in a target document into a standard expression in a business knowledge base to obtain a plurality of business function fragments; according to the test keyword, screening out a first service function segment containing the test keyword and a second service function segment having an association relationship with the test keyword from the plurality of service function segments; classifying the first service function segment and the second service function segment according to different service functions to obtain a service function segment set corresponding to each service function; and utilizing a natural language processing module of the large language model to obtain a test case corresponding to each business function according to the business function fragment set corresponding to each business function. According to the invention, the test case can be efficiently and accurately generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing technology, and in particular to a test case generation method, device, electronic equipment and storage medium. Background Art

[0002] In the current software development and testing process, the generation of business function test cases mainly relies on manual writing by testers, which has many problems. First of all, manual writing of test cases not only consumes a lot of time and energy of testers, but also may affect the progress and quality of testing under tight development cycles. Furthermore, manual writing of test cases is prone to errors and lacks accuracy; different testers have different ability levels, which may lead to unreasonable design of test cases or omission of important test points due to negligence, misunderstanding or lack of experience, thus affecting the test effect. In addition, the traditional manual test case generation method usually requires the definition of test scenarios and conditions in advance, and cannot flexibly respond to rapidly changing requirements. When the requirements change or the software functions change, the test cases need to be redesigned and written, which will affect the test efficiency and quality. In addition, the traditional manual test case generation method is usually designed only based on current test data and test results, and cannot make full use of historical data and knowledge and experience.

[0003] Therefore, how to generate test cases efficiently and accurately is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a test case generation method, device, electronic device and storage medium for efficiently and accurately generating test cases.

[0005] The present invention provides a test case generation method, comprising the following steps.

[0006] Obtain a target document and a test keyword; wherein the target document includes a demand document and an interaction document based on natural language; utilize the natural language processing module of the large language model to convert the natural sentences related to the business function in the target document into standard expressions in the business knowledge base to obtain a plurality of business function fragments; based on the test keyword, filter out a first business function fragment containing the test keyword and a second business function fragment associated with the test keyword from the plurality of business function fragments; classify the first business function fragment and the second business function fragment according to different business functions to obtain a set of business function fragments corresponding to each business function; utilize the natural language processing module of the large language model to obtain a test case corresponding to each business function based on the set of business function fragments corresponding to each business function.

[0007] According to a test case generation method provided by the present invention, the method further includes: using a mind map generation tool to obtain a mind map of the test cases corresponding to each business function according to the test cases corresponding to each business function.

[0008] According to a test case generation method provided by the present invention, the natural language processing module of the large language model is used to convert the natural sentences related to the business functions in the target document into standard expressions in the business knowledge base to obtain multiple business function fragments, including: calling the natural language processing module of the large language model to parse each sentence in the target document; comparing the semantic features of each sentence obtained by parsing with the semantic features of the standardized expressions stored in the business knowledge base; and extracting the natural sentences related to the business functions in the target document according to the comparison results, and using the corresponding standard expressions in the business knowledge base as the business function fragments.

[0009] According to a test case generation method provided by the present invention, a second business function fragment having an association relationship with the test keyword is screened out from the multiple business function fragments in the following manner: based on the test keyword, using a preset method, information of an associated function module having an association relationship with the function module corresponding to the test keyword is obtained; and from the multiple business function fragments, a second business function fragment involving the associated function module is screened out.

[0010] According to a test case generation method provided by the present invention, the information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword is obtained in a preset manner according to the test keyword, including: according to the test keyword, from the association information between functional modules stored in the business knowledge base, the information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword is obtained; or using the plug-in provided by the large language model to obtain the information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword.

[0011] According to a test case generation method provided by the present invention, the natural language processing module of the large language model is used to obtain the test case corresponding to each business function according to the set of business function fragments corresponding to each business function, including: using the natural language processing module of the large language model, based on the test case vocabulary, the set of business function fragments corresponding to each business function is processed to obtain text described using the test case vocabulary, and using it as the test case corresponding to the business function.

[0012] The present invention also provides a test case generation device, comprising the following modules: a first acquisition module, used to acquire a target document and a test keyword; wherein the target document includes a requirement document and an interaction document based on natural language; a second acquisition module, used to use a natural language processing module of a large language model to convert natural sentences related to business functions in the target document into standard expressions in a business knowledge base to obtain multiple business function fragments; a third acquisition module, used to screen out a first business function fragment containing the test keyword and a second business function fragment associated with the test keyword from the multiple business function fragments according to the test keyword; a fourth acquisition module, used to classify the first business function fragment and the second business function fragment according to different business functions to obtain a set of business function fragments corresponding to each business function; a fifth acquisition module, used to use the natural language processing module of the large language model to obtain a test case corresponding to each business function according to the set of business function fragments corresponding to each business function.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the test case generation methods described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the test case generation method described in any one of the above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the test case generating method described above is implemented.

[0016] The test case generation method, device, electronic device and storage medium provided by the present invention use the natural language processing module of the large language model to convert the natural sentences related to the business function in the target document into the standard expression in the business knowledge base to obtain multiple business function fragments; according to the test keyword, from the multiple business function fragments, the first business function fragment containing the test keyword and the second business function fragment having an association relationship with the test keyword are screened; according to different business functions, the first business function fragment and the second business function fragment are classified to obtain a set of business function fragments corresponding to each business function; using the natural language processing module of the large language model, according to the set of business function fragments corresponding to each business function, a test case corresponding to each business function is obtained. Due to the use of the powerful language processing ability of the large language model and the standard expression stored in the business knowledge base, only by uploading the target document and the input test keyword, test cases for various business functions can be generated efficiently and accurately. Therefore, a large amount of human resources can be saved in the software testing link and the development progress of the project can be accelerated. In addition, due to the use of a modular processing method, when the business requirements change, only the content in the business knowledge base needs to be updated, so that the testing efficiency of subsequent other software products can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of the test case generation method provided by the present invention.

[0019] Figure 2 It is a flowchart of a method for acquiring multiple business function fragments provided by the present invention.

[0020] Figure 3 It is a flowchart diagram of a method for screening out second business function fragments associated with a test keyword provided by the present invention.

[0021] Figure 4 It is a process schematic diagram of the test case generation method provided by the present invention.

[0022] Figure 5 It is a schematic diagram of an application scenario of the test case generation method provided by the present invention.

[0023] Figure 6It is a structural schematic diagram of the test case generating device provided by the present invention.

[0024] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] Combine the following Figure 1-Figure 5 The test case generation method of the present invention is described.

[0027] Figure 1 It is a flow chart of the test case generation method provided by the present invention, such as Figure 1 As shown, the method includes the following steps: Step 101, obtaining a target document and a test keyword.

[0028] Target documents may include natural language-based requirement documents and interaction documents.

[0029] A Business Requirements Document (BRD) is a document that records in detail the functions, performance, limitations, and constraints that a system, software, or product needs to meet.

[0030] The interaction document (DRD, Design Requirement Document) is a team collaboration document used to carry design plans, interaction prototypes, interaction instructions, etc. It is mainly used to describe the interaction design details of the product and help team members understand the product's operating procedures and user experience.

[0031] The target document can be a formatted file in various formats, such as html, xml, excel, and word. In the specific implementation process, Figure 4 As shown, the document loader can be used to load the target document uploaded by the user. The document loader can quickly complete the identification and decoding of the target document, and execute the processing of the subsequent steps based on the decoded document content. For example, when a user uploads an html file, the document loader will recognize that the file is in html format and use the html decoding library to read the file content. In the specific implementation process, the document loader can be implemented based on plug-ins or open source code, etc., and is not limited by the description of this specification.

[0032] The test keywords may include, but are not limited to, words used to represent the test objectives, such as order, business opportunity, regional model, high seas pool, win rate, etc. In the specific implementation process, the test keywords may be obtained in a variety of ways, which are not limited by the description of this specification. For example, the processing device may obtain the test keywords input by the user through the human-computer interaction interface.

[0033] Step 102: Using the natural language processing module of the large language model, natural sentences related to business functions in the target document are converted into standard expressions in the business knowledge base to obtain multiple business function fragments.

[0034] In the specific implementation process, since the target document is generated by the author using natural language, in order to enable the computer to accurately recognize and process it, the powerful semantic understanding ability of the large language model can be used to convert the natural sentences related to business functions in the target document into standard expressions in the business knowledge base.

[0035] For an embodiment of using a natural language processing module of a large language model to convert natural sentences related to business functions in a target document into standard expressions in a business knowledge base to obtain multiple business function fragments, see Figure 2 The relevant content in will not be repeated here.

[0036] In the specific implementation process, Figure 4 As shown, this step can be performed by a semantic understander. The semantic understander is a piece of code or a plug-in that implements the method of this step. The specific implementation of the semantic understander is not limited by the present invention.

[0037] Step 103 : Filter out, according to the test keyword, a first business function segment containing the test keyword and a second business function segment associated with the test keyword from a plurality of business function segments.

[0038] In the specific implementation process, the business function segment containing the test keyword in the multiple business function segments can be used as the first business function segment, and the business function segment associated with the test keyword in the multiple business function segments can be used as the second business function segment. For example, if a business function segment describes a certain link in the sales process, and this link is closely related to the order (such as "after the sales contract is signed, the corresponding order will be automatically created"), then the business function segment can be used as the second business function segment associated with the test keyword "order".

[0039] In the specific implementation process, the second business function segment associated with the test keyword can be screened out from the multiple business function segments in various ways. Figure 3 The relevant content in will not be repeated here.

[0040] In the specific implementation process, Figure 4 As shown, this step can be performed by a business module decomposer. The business module decomposer is a piece of code or a plug-in that implements the method of this step. The specific implementation of the business module decomposer is not limited by the present invention.

[0041] Step 104: Classify the first business function fragments and the second business function fragments according to different business functions to obtain a set of business function fragments corresponding to each business function.

[0042] The first business function fragment and the second business function fragment will include multiple functions of the product to be tested. For example, using the test keyword "order", the first business function fragment screened out will include multiple functions such as order generation time management, order customer management, and renewal status management. Each function needs to be tested separately. During the specific implementation process, the first business function fragment and the second business function fragment can be classified according to different business functions to obtain a set of business function fragments corresponding to each business function. For example, the first fragment and the second fragment involving the order customer management function are regarded as a set of business function fragments.

[0043] In the specific implementation process, Figure 4 As shown, this step can be performed by a business function translator. The business function translator is a piece of code or a plug-in that implements the method of this step. The specific implementation of the business function translator is not limited by the present invention.

[0044] In the specific implementation process, a preset intersection detection algorithm can be used to detect whether there is intersection between the business function fragments in the business function fragment set (ie, whether there are overlapping or repeated functions), so as to obtain a business function fragment set without redundancy through optimization.

[0045] In the specific implementation process, Figure 4 As shown, the preset intersection detection algorithm can be executed by the functional intersection checker. The present invention does not limit the specific implementation of the functional intersection checker.

[0046] Step 105 : Using the natural language processing module of the large language model, according to the set of business function fragments corresponding to each business function, obtain a test case corresponding to each business function.

[0047] Each business function fragment set obtained in step 104 includes multiple independent business function fragments. In some embodiments, the natural language processing module of the large language model can be used to extract the logical relationship between the sentences from each business function fragment in the business function fragment set, and based on the logical relationship between the sentences, the test case vocabulary stored in the business knowledge base, and the case vocabulary obtained by other means, the test case vocabulary is used to describe each business function fragment in the business function fragment set to obtain the test case corresponding to the business function.

[0048] Just as an example, the following test cases can be obtained using the large oracle model: 1) Create an order normally

[0049] 2) Preconditions: The user has logged in, the product inventory is sufficient, the user has sufficient balance or has selected a payment method.

[0050] 3) Steps: 1. The user selects an item and adds it to the shopping cart.

[0051] 2. The user checks the shopping cart and confirms the order information (quantity of goods, price, delivery address, etc.).

[0052] 3. The user selects a payment method and completes the payment.

[0053] 4) Expected results: The order is successfully created, the user receives order confirmation information, the inventory is reduced, and the payment is successful.

[0054] In the specific implementation process, Figure 4 As shown, this step can be performed by a use case text generator. The use case text generator is a piece of code or a plug-in that implements the method of this step. The present invention does not limit the specific implementation of the use case text generator.

[0055] In some embodiments, a mind map generation tool may be used to obtain a mind map of the test cases corresponding to each business function according to the test cases corresponding to each business function.

[0056] In the specific implementation process, Figure 4 As shown, the document loader, semantic understander and business knowledge base can be integrated into the business document parser; the business module decomposer, business function translator, function intersection checker and use case text generator can be integrated into the test case generator. The business document parser and test case generator can be added to the large language model in the form of plug-ins.

[0057] Figure 2 is a flow chart of a method for obtaining multiple business function fragments provided by the present invention, such as Figure 2 As shown, the method includes the following: Step 201: call the natural language processing module of the large language model to parse each sentence in the target document.

[0058] In the specific implementation process, a general large language model or a fine-tuned large language model can be used to perform this step, which is not limited to the description in this specification.

[0059] As an example only, the natural language processing module of the large language model can be called to parse each sentence in the target document to obtain the semantic features of the sentence.

[0060] Step 202: Compare the semantic features of each sentence obtained through parsing with the semantic features of the standardized expressions stored in the business knowledge base.

[0061] The business knowledge base stores the definitions and explanations of the business-related content of the tested product, as well as the association information between various functional modules. For example, on an e-commerce platform, the definition of "order" may include the order generation, payment, delivery, return and other status.

[0062] In the specific implementation process, the semantic features of each sentence parsed in step 201 can be compared with the semantic features of the standardized expressions stored in the business knowledge base. In the case of a standardized expression whose semantic feature similarity is higher than a preset threshold value obtained by querying from the business knowledge base, it is confirmed that the sentence is related to the business function, and the standardized expression is used as the business function fragment corresponding to the sentence.

[0063] Step 203: extract the natural sentences related to the business functions in the target document according to the comparison results, and use the corresponding standard expressions in the business knowledge base as business function fragments.

[0064] In the specific implementation process, all natural sentences related to the business functions in the target document can be extracted according to the comparison result in step 202, and the standard expressions in the business knowledge base corresponding to all natural sentences can be used as multiple business function fragments.

[0065] Figure 3 is a flow chart of a method for screening out second business function segments associated with a test keyword provided by the present invention, such as Figure 3 As shown, the method includes the following: Step 301: According to a test keyword, information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword is obtained in a preset manner.

[0066] In some embodiments, information of associated functional modules associated with the functional modules corresponding to the test keyword can be obtained from the association information between functional modules stored in the business knowledge base according to the test keyword. For example, if the business knowledge base stores the association between the order function and the inventory management function modules, then by querying the business knowledge base, the associated functional modules associated with the functional modules corresponding to the test keyword "order" include the inventory management function module.

[0067] In some embodiments, a plug-in provided by a large language model may be used to obtain information on associated functional modules that have an associated relationship with the functional module corresponding to the test keyword.

[0068] Step 302: Filter out a second business function segment involving an associated function module from a plurality of business function segments.

[0069] As just an example, the second business function fragment related to the associated function module may be screened out from the plurality of business function fragments according to the name keyword (eg, inventory) of the associated function module.

[0070] Figure 5 It is a schematic diagram of an application scenario of the test case generation method provided by the present invention.

[0071] like Figure 5 As shown, the large language model runs on the server. After the user uploads the target document (requirement document or interaction document) from the client and enters the test keywords, the server uses the large language model to extract the test cases corresponding to each business function from the requirement document or interaction document according to the input test keywords, and returns them to the client in the form of a mind map.

[0072] The test case generating device provided by the present invention is described below. The test case generating device described below and the test case generating method described above can be referred to each other.

[0073] Figure 6 is a schematic diagram of the structure of the test case generation device provided by the present invention, such as Figure 6 As shown, the test case generating device 600 includes the following modules: The first acquisition module 610 is used to acquire a target document and a test keyword; wherein the target document includes a demand document and an interaction document based on natural language.

[0074] The second acquisition module 620 is used to use the natural language processing module of the large language model to convert the natural sentences related to the business function in the target document into standard expressions in the business knowledge base to obtain multiple business function fragments.

[0075] The third acquisition module 630 is used to filter out, according to the test keyword, a first business function segment containing the test keyword and a second business function segment associated with the test keyword from the multiple business function segments.

[0076] The fourth acquisition module 640 is used to classify the first business function fragments and the second business function fragments according to different business functions to obtain a business function fragment set corresponding to each business function.

[0077] The fifth acquisition module 650 is used to obtain the test case corresponding to each business function according to the set of business function fragments corresponding to each business function by using the natural language processing module of the large language model.

[0078] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call the logic instructions in the memory 730 to execute the test case generation method, which includes: obtaining a target document and a test keyword; wherein the target document includes a requirement document and an interaction document based on natural language; using the natural language processing module of the large language model, converting the natural sentences related to the business function in the target document into standard expressions in the business knowledge base to obtain multiple business function fragments; according to the test keyword, from the multiple business function fragments, screening out a first business function fragment containing the test keyword and a second business function fragment associated with the test keyword; according to different business functions, classifying the first business function fragment and the second business function fragment to obtain a set of business function fragments corresponding to each business function; using the natural language processing module of the large language model, according to the set of business function fragments corresponding to each business function, obtaining a test case corresponding to each business function.

[0079] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0080] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the test case generation method provided by the above methods, which method includes: obtaining a target document and a test keyword; wherein the target document includes a requirement document and an interaction document based on natural language; using a natural language processing module of a large language model, converting natural sentences related to business functions in the target document into standard expressions in a business knowledge base to obtain multiple business function fragments; according to the test keyword, screening out a first business function fragment containing the test keyword and a second business function fragment having an association with the test keyword from the multiple business function fragments; according to different business functions, classifying the first business function fragment and the second business function fragment to obtain a set of business function fragments corresponding to each business function; using the natural language processing module of the large language model, according to the set of business function fragments corresponding to each business function, obtaining a test case corresponding to each business function.

[0081] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the test case generation method provided by the above-mentioned methods, the method comprising: obtaining a target document and a test keyword; wherein the target document comprises a requirement document and an interaction document based on natural language; using a natural language processing module of a large language model, converting natural sentences related to business functions in the target document into standard expressions in a business knowledge base to obtain a plurality of business function fragments; based on the test keyword, screening out a first business function fragment containing the test keyword and a second business function fragment having an association with the test keyword from the plurality of business function fragments; classifying the first business function fragment and the second business function fragment according to different business functions to obtain a set of business function fragments corresponding to each business function; using the natural language processing module of the large language model, obtaining a test case corresponding to each business function based on the set of business function fragments corresponding to each business function.

[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A test case generation method, characterized in that: include: Obtaining a target document and test keywords; wherein the target document includes a demand document and an interaction document based on natural language; Using the natural language processing module of the large language model, natural sentences related to the business functions in the target document are converted into standard expressions in the business knowledge base to obtain multiple business function fragments; According to the test keyword, from the multiple business function fragments, a first business function fragment containing the test keyword and a second business function fragment associated with the test keyword are screened out; Classifying the first business function fragments and the second business function fragments according to different business functions to obtain a business function fragment set corresponding to each business function; By utilizing the natural language processing module of the large language model, a test case corresponding to each business function is obtained according to a set of business function fragments corresponding to each business function.

2. The test case generation method according to claim 1, characterized in that: The method further comprises: A mind map generation tool is used to obtain a mind map of the test cases corresponding to each business function according to the test cases corresponding to each business function.

3. The test case generation method according to claim 1, characterized in that: The natural language processing module using the large language model converts the natural sentences related to the business functions in the target document into standard expressions in the business knowledge base to obtain multiple business function fragments, including: Calling the natural language processing module of the large language model to parse each sentence in the target document; Comparing the semantic features of each parsed statement with the semantic features of the standardized expressions stored in the business knowledge base; According to the comparison result, natural sentences related to the business function in the target document are extracted, and the corresponding standard expressions in the business knowledge base are used as the business function fragments.

4. The test case generation method according to claim 1, characterized in that: The second business function fragment associated with the test keyword is selected from the plurality of business function fragments in the following manner: According to the test keyword, using a preset method, obtaining information of an associated functional module having an associated relationship with the functional module corresponding to the test keyword; A second business function fragment related to the associated function module is screened out from the multiple business function fragments.

5. The test case generation method according to claim 4, characterized in that: The obtaining, according to the test keyword, information of an associated functional module having an associated relationship with the functional module corresponding to the test keyword in a preset manner includes: According to the test keyword, obtaining information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword from the association information between functional modules stored in the business knowledge base; or By using the plug-in provided by the large language model, information of associated functional modules having an associated relationship with the functional module corresponding to the test keyword is obtained.

6. The test case generation method according to claim 1, characterized in that: The natural language processing module using the large language model obtains a test case corresponding to each business function according to a set of business function fragments corresponding to each business function, including: The natural language processing module of the large language model is used to process the set of business function fragments corresponding to each business function based on the test case vocabulary to obtain text described using the test case vocabulary, which is used as the test case corresponding to the business function.

7. A test case generating device, characterized in that: include: A first acquisition module is used to acquire a target document and a test keyword; wherein the target document includes a demand document and an interaction document based on natural language; A second acquisition module is used to convert the natural sentences related to the business function in the target document into standard expressions in the business knowledge base using the natural language processing module of the large language model to obtain multiple business function fragments; A third acquisition module is used to filter out, from the plurality of business function fragments, a first business function fragment containing the test keyword and a second business function fragment associated with the test keyword according to the test keyword; a fourth acquisition module, configured to classify the first business function fragments and the second business function fragments according to different business functions, and obtain a business function fragment set corresponding to each business function; The fifth acquisition module is used to utilize the natural language processing module of the large language model to obtain the test case corresponding to each business function according to the set of business function fragments corresponding to each business function.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the test case generation method as described in any one of claims 1 to 6 is implemented.

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

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