Case generation method and device, electronic equipment and storage medium

By automating the generation of scenario test cases through the test case generation model, the problem of low efficiency in traditional manual writing is solved, and efficient and accurate scenario test case generation is achieved.

CN120929359APending Publication Date: 2025-11-11BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410557785.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Traditional methods of writing scenario test cases rely on manual work, requiring testers to have extensive experience and professional knowledge, which leads to low writing efficiency and a high risk of omissions or errors.

Method used

By inputting the document to be analyzed into a pre-configured use case generation model for document parsing, functional point use cases are generated, and scenario use cases are automatically generated through preset merging rules and orchestration algorithms, reducing manual workload.

Benefits of technology

It significantly reduces manual workload, decreases omissions and errors, and improves the efficiency and accuracy of writing scenario use cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929359A_ABST
    Figure CN120929359A_ABST
Patent Text Reader

Abstract

According to the use case generation method and device, the electronic equipment and the storage medium provided by the invention, the to-be-analyzed document is input into the configured use case generation model for document analysis processing, so that the function point use case corresponding to each demand function point in the to-be-analyzed document is obtained; performing merging processing on the function point use cases through a preset merging rule to obtain a text use case; obtaining a corrected text case and an interface document; the corrected text use case is obtained by correcting the text use case, and the interface document is a document formed by a function interface corresponding to each function point use case; and performing use case arrangement processing on the interface document and the corrected text use case through a preset use case arrangement algorithm to obtain a scene use case corresponding to the to-be-analyzed document. Compared with the prior art, the embodiment of the invention has the advantages that the scene use case is automatically generated through the configured use case generation model, so that the workload of workers can be remarkably reduced, omission or errors are reduced, and the compiling efficiency of the scene use case is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a method and apparatus for generating use cases, an electronic device, and a storage medium. Background Technology

[0002] With the rapid development of technology, the writing and maintenance of use cases has become an indispensable part of the software or system development process. Use cases are descriptions of how a system responds to external requests in software engineering or systems engineering. They are a technique for obtaining requirements through user scenarios. Each use case provides one or more scenarios that illustrate how the system interacts with end users or other systems, i.e., what the system can do, thereby obtaining a clear business goal. In order to ensure the quality of software or systems, testers need to spend a lot of time and effort writing, executing and maintaining scenario use cases.

[0003] However, traditional methods of writing scenario test cases rely on manual work. Testers need to have rich experience and professional knowledge to write comprehensive and effective scenario test cases, which increases the requirements for testers and is prone to omissions or errors, resulting in low efficiency in writing scenario test cases. Summary of the Invention

[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for generating test cases. Its main purpose is to address the problem that traditional methods of writing scenario test cases rely on manual work, requiring testers to possess extensive experience and expertise to write comprehensive and effective scenario test cases. This increases the demands on testers and is prone to omissions or errors, leading to low efficiency in scenario test case writing.

[0005] According to a first aspect of this disclosure, a method for generating use cases is provided, comprising:

[0006] The document to be analyzed is input into the configured test case generation model for document parsing and processing to obtain the function point test cases corresponding to each requirement function point in the document to be analyzed. The function point test cases are then merged according to the preset merging rules to obtain text test cases.

[0007] Obtain the corrected text test cases and interface documentation; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documentation is a document consisting of the function interfaces corresponding to each functional point test case;

[0008] The interface document and the revised text test cases are processed by a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed.

[0009] Optionally, the step of inputting the document to be analyzed into a pre-configured use case generation model for document parsing processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed includes:

[0010] The preset document analysis algorithm in the configured use case generation model is used to parse and process each requirement function point in the document to be analyzed, so as to obtain the function point use case corresponding to each requirement function point in the document to be analyzed.

[0011] Optionally, the step of processing the interface document and the corrected text use cases through a preset use case orchestration algorithm to obtain the scenario use cases corresponding to the document to be analyzed includes:

[0012] Each of the revised functional point test cases in the revised text test cases is matched with the corresponding function interface in the interface document; wherein each of the revised functional point test cases contains unique identification information of the corresponding function interface;

[0013] Each corrected function point use case and its corresponding function interface are processed by use case orchestration to obtain the scenario use cases corresponding to the document to be analyzed.

[0014] Optionally, before inputting the document to be analyzed into the configured use case generation model for document parsing and processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed, the method further includes:

[0015] Obtain the preset test case output algorithm corresponding to the preset test case output conditions and the preset document analysis algorithm corresponding to the preset document analysis conditions, and configure the preset test case output algorithm and the preset document analysis algorithm in the test case generation model to obtain the test case generation model to be trained.

[0016] Obtain a training test case dataset; wherein the training test case dataset contains a preset number of training documents to be analyzed and a tag scenario test case corresponding to each training document to be analyzed;

[0017] Based on the training test case generation model, the training analysis document is processed to generate test cases to obtain the training scenario test cases corresponding to the training analysis document.

[0018] Based on the training scenario use cases and the labeled scenario use cases, the training use case generation model is optimized using a preset loss function to obtain the configured use case generation model.

[0019] Optionally, before inputting the document to be analyzed into the configured use case generation model for document parsing and processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed, the method further includes:

[0020] Obtain preset document specification conditions; wherein, the preset document specification conditions are used to impose conditional constraints on the document to be analyzed;

[0021] If the document to be analyzed does not meet the preset document specification conditions, the document to be analyzed is adjusted according to the preset document specification conditions to obtain an adjusted document to be analyzed that meets the preset document specification conditions, and the adjusted document to be analyzed is input into the configured use case generation model;

[0022] If the document to be analyzed meets the preset document specification conditions, the document to be analyzed is input into the configured use case generation model.

[0023] Optionally, after processing the interface document and the revised text test cases using a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed, the method further includes:

[0024] Obtain the inspection results of the scenario use cases;

[0025] If the scenario use case does not conform to the preset use case rules based on the inspection results, obtain the update use case output algorithm and the update document analysis algorithm;

[0026] The update test case output algorithm and the update document analysis algorithm are configured in the configured test case generation model to obtain the test case generation model to be updated.

[0027] Based on the inspection results, the test case generation model to be updated is optimized using a preset optimization algorithm to obtain the updated test case generation model.

[0028] According to a second aspect of this disclosure, an apparatus for use case generation is provided, comprising:

[0029] The parsing unit is used to input the document to be analyzed into the pre-configured test case generation model for document parsing processing, to obtain the function point test cases corresponding to each requirement function point in the document to be analyzed, and to merge the function point test cases according to the preset merging rules to obtain text test cases;

[0030] The first acquisition unit is used to acquire the corrected text test cases and interface documents; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documents are documents consisting of function interfaces corresponding to each functional point test case;

[0031] The orchestration unit is used to perform test case orchestration processing on the interface document and the corrected text test cases through a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed.

[0032] Optionally, the parsing unit is further configured to parse each requirement function point in the document to be analyzed using a preset document analysis algorithm in the configured use case generation model, so as to obtain the function point use case corresponding to each requirement function point in the document to be analyzed.

[0033] Optionally, the orchestration unit includes:

[0034] The matching module is used to match each of the corrected functional point test cases in the corrected text test cases with the corresponding function interface in the interface document to obtain the function interface corresponding to each corrected functional point test case; wherein, each corrected functional point test case contains unique identification information of the corresponding function interface;

[0035] The orchestration module is used to perform test case orchestration processing on each of the corrected function point test cases and the corresponding function interfaces to obtain the scenario test cases corresponding to the document to be analyzed.

[0036] Optionally, the device further includes:

[0037] The second acquisition unit is used to acquire the preset test case output algorithm corresponding to the preset test case output conditions and the preset document analysis algorithm corresponding to the preset document analysis conditions.

[0038] A configuration unit is used to configure the preset test case output algorithm and the preset document analysis algorithm into the test case generation model to obtain the test case generation model to be trained.

[0039] The second acquisition unit is further configured to acquire a training test case dataset; wherein the training test case dataset includes a preset number of training documents to be analyzed and a tag scenario test case corresponding to each training document to be analyzed;

[0040] The generation unit is used to perform test case generation processing on the training analysis document based on the training test case generation model to obtain the training scenario test cases corresponding to the training analysis document.

[0041] The optimization unit is used to optimize the training use case generation model based on the training scenario use cases and the labeled scenario use cases using a preset loss function, so as to obtain the configured use case generation model.

[0042] Optionally, the second acquisition unit is further configured to acquire preset document specification conditions; wherein the preset document specification conditions are used to impose conditional constraints on the document to be analyzed;

[0043] The device further includes:

[0044] The adjustment unit is used to adjust the document to be analyzed according to the preset document specification conditions when the document to be analyzed does not meet the preset document specification conditions, so as to obtain an adjusted document to be analyzed that meets the preset document specification conditions.

[0045] An input unit is used to input the adjusted document to be analyzed into the configured use case generation model;

[0046] The input unit is further configured to input the document to be analyzed into the configured use case generation model if the document to be analyzed meets the preset document specification conditions.

[0047] Optionally, the acquisition unit is further configured to acquire the inspection results of the scenario use cases;

[0048] The second acquisition unit is further configured to acquire, in the case that the scenario use case does not conform to the preset use case rules based on the inspection result, an update use case output algorithm and an update document analysis algorithm.

[0049] The configuration unit is further configured to configure the update test case output algorithm and the update document analysis algorithm into the configured test case generation model to obtain the test case generation model to be updated.

[0050] The optimization unit is further configured to optimize the test case generation model to be updated using a preset optimization algorithm based on the inspection results, so as to obtain an updated test case generation model.

[0051] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0052] At least one processor; and

[0053] A memory communicatively connected to the at least one processor; wherein,

[0054] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect above.

[0055] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described in the first aspect above.

[0056] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in the first aspect above.

[0057] The method, apparatus, electronic device, and storage medium for generating use cases provided in this disclosure input the document to be analyzed into a pre-configured use case generation model for document parsing processing, obtaining function point use cases corresponding to each required functional point in the document to be analyzed, and merging the function point use cases according to a preset merging rule to obtain text use cases; obtaining corrected text use cases and interface documents; wherein, the corrected text use cases are obtained by correcting the text use cases, and the interface documents are documents composed of function interfaces corresponding to each function point use case; the interface documents and the corrected text use cases are processed by a preset use case orchestration algorithm to obtain scenario use cases corresponding to the document to be analyzed. Compared with related technologies, the embodiments of this disclosure automatically generate scenario use cases through a pre-configured use case generation model, which can significantly reduce manual workload, reduce omissions or errors, and improve the efficiency of writing scenario use cases.

[0058] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0059] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0060] Figure 1 A flowchart illustrating a method for generating use cases provided in an embodiment of this disclosure;

[0061] Figure 2 A schematic diagram illustrating the principle of a use case generation method provided in an embodiment of this disclosure;

[0062] Figure 3 This is a flowchart illustrating a configuration method for a use case generation model provided in an embodiment of this disclosure.

[0063] Figure 4 A flowchart illustrating another method for generating use cases provided in an embodiment of this disclosure;

[0064] Figure 5 This is a schematic diagram of the structure of a use case generation device provided in an embodiment of the present disclosure;

[0065] Figure 6A schematic diagram of the apparatus for generating another use case provided in an embodiment of this disclosure;

[0066] Figure 7 This is a schematic block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0067] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0068] The following description, with reference to the accompanying drawings, outlines a method and apparatus for generating use cases according to embodiments of this disclosure, as well as an electronic device and storage medium.

[0069] Figure 1 This is a flowchart illustrating a method for generating use cases provided in an embodiment of this disclosure.

[0070] like Figure 1 As shown, the method includes the following steps:

[0071] Step 101: Input the document to be analyzed into the configured use case generation model for document parsing and processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed. Then, merge the function point use cases according to the preset merging rules to obtain text use cases.

[0072] In this embodiment of the disclosure, the document to be analyzed is a product requirements document or a user story, which contains one or more different requirement function points and needs to be provided as input to the configured use case generation model. The configured use case generation model is used to analyze and understand the functions, rules and business logic described in the document to be analyzed.

[0073] The preset merging rule is a custom merging rule, such as sequential arrangement, random arrangement, etc., which means that all modified function point test cases are classified according to the required function points and arranged one by one. Specifically, this embodiment of the disclosure does not limit the preset merging rule.

[0074] Meanwhile, to facilitate understanding of the implementation process of this disclosure, embodiments of this disclosure provide a schematic diagram illustrating the principle of a use case generation method, such as... Figure 2 As shown, the text use case is Figure 2The data after merging complete use cases as described above includes one or more requirement function point use cases. Each requirement function point use case corresponds one-to-one with the requirement function points in the document to be analyzed. Each requirement function point use case must meet the output conditions of the use case. The requirement function point use case refers to the use case determined in the requirement analysis phase of each requirement during the software or system development process, in order to describe the interaction process between the user and the system in a specific scenario.

[0075] The text test cases must conform to the test case output conditions corresponding to the preset test case output algorithm in the configured test case generation model. These test case output conditions are a series of custom-defined conditions used to standardize and constrain the test cases for the required functional points. For example, the model's understanding of key functional point information is used to write test cases for the required functional points. Each test case for the required functional point must include the following: 1) Test Case Title: Describes the specific function or scenario to be tested, a unique identifier for the required functional point test case, and should accurately reflect the content of the test case for easy understanding and retrieval. 2) Test Objective: Records the main objective of the required functional point test case, defining the desired result of the testing activity. 3) Prerequisites: Specific conditions or existing states that need to be met before executing the required functional point test case (including environment settings, configuration, and user state, which helps ensure the stability and repeatability of the test). 4) Test Steps: Lists the specific steps required for the test, detailing how to conduct the test. Each step should be clear and specific to ensure consistent test execution and accurate results. 5) Input Data: Defines the data or parameters required for testing. These values ​​should be able to trigger or verify test conditions, helping to ensure test coverage and depth. 6) Special Case Verification: Focus on system behavior under abnormal or boundary conditions to ensure reasonable response even in non-standard situations. 7) Expected Results: Predefined results used to determine whether the function executes as required, providing measurable outputs or behaviors for testers to judge whether the test passed. The test in the test case output conditions refers to the testing and verification process of the functional points corresponding to the required functional point test cases.

[0076] To facilitate understanding of the implementation process of this disclosure, a requirement functional point and corresponding use cases are provided for illustration. For example, the requirement functional point is as follows: Requirement Description: Introduce a points system where users can earn points after checking in and making purchases. These points can be redeemed for cash during shopping. System Constraints: The points data type is int, and the points issuance standard is 1 point for every 1 yuan spent, rounded down. Test Conditions: After completing an order, the user should receive the corresponding points; the points details page should correctly display the income and expenditure details; the points redemption function should work according to the rules. Special Cases: In case of network abnormalities, a "Network connection unavailable" message should be displayed, along with an option to refresh the page. Requirement Verification: Ensure that the points system logic is clear, the points calculation is accurate, and the points redemption rules are consistent and operable.

[0077] At this point, the functional test cases obtained after parsing and processing are as follows: Test Case Title: Verify the correctness of the points system and the points redemption function. Test Objective: Ensure that users correctly earn points after completing an order, and that the points details page correctly displays income and expenditure details, and that the points redemption function works correctly according to the rules. Prerequisites: The user is logged in and has completed at least one order; the points system is enabled; and the network connection is normal. Test Steps: [1. The user logs in and enters the mall page, selects a product to purchase, 2. The user completes the order and successfully pays, the payment amount is a specific value, 3. After successful payment, check if the payment success page indicates that points have been earned, 4. Click "Go to View" to enter the "My" homepage, check if the points display is correct, 5. Enter "My - Details Page", check if the points details correctly list the recent points income and expenditure, 6. Try to place another order, the order amount meets the points redemption conditions, 7. On the order confirmation page, select to use points to redeem, confirm if the points redemption amount is calculated correctly, 8. Complete the payment, check if the points are deducted correctly, and if the points details are updated, 9. Simulate network failure, check if the system gives the correct prompt and provides a refresh option]. Input Data: {Order 1 payment amount: 158 yuan, Order 2 payment amount: 80 yuan, Points used: 5000 points}. Expected Results: {Payment Success Page: The system should display the correct number of points earned; for example, Order 1 should show 158 points earned. Points Details Page: The system should correctly display points earned as +158 and points spent as -5000 (if points were used for cash redemption). Points Cash Redemption: The cash redemption calculation should be correct; Order 1 can redeem 50 yuan, and Order 2 can redeem 40 yuan. Network Error Message: The system should display "Network connection unavailable" and provide an option to refresh the page.} Special Case Verification: In the event of a network error, the system should display "Network connection unavailable" and provide an option to refresh the page.

[0078] Step 102: Obtain the corrected text use cases and interface documentation; wherein, the corrected text use cases are obtained by correcting the text use cases, and the interface documentation is a document consisting of the function interfaces corresponding to each function point use case.

[0079] In the embodiments disclosed herein, such as Figure 2 As shown, the revised text use case is the function point use case that has been manually verified and modified by technicians. By having technicians verify and correct the text use case, it can be ensured that the revised text use case is complete, reliable, and executable.

[0080] The interface document contains the function interface corresponding to each requirement function point in the document to be analyzed. The function interface is the programming program corresponding to each requirement function point. The corrected text use cases and interface documents both need to be entered by technical personnel.

[0081] Step 103: The interface document and the corrected text use cases are processed by a preset use case orchestration algorithm to obtain the scenario use cases corresponding to the document to be analyzed.

[0082] In this embodiment of the disclosure, the preset test case orchestration algorithm is a custom-defined algorithm used to bind test cases corresponding to the same requirement function point with the corresponding function interface, such as: Basic Flow, Ordering Flow, etc. Specifically, this embodiment of the disclosure does not impose any restrictions on the preset test case orchestration algorithm.

[0083] The interface document contains the function interface corresponding to each functional requirement in the document to be analyzed. The function interface is the programming program corresponding to each functional requirement, such as... Figure 2 As shown, test case orchestration refers to binding test cases for the same requirement function point together with the corresponding function interface.

[0084] The test case generation method provided in this disclosure involves inputting the document to be analyzed into a pre-configured test case generation model for document parsing processing to obtain function point test cases corresponding to each required functional point in the document. These function point test cases are then merged using a preset merging rule to obtain text test cases. Corrected text test cases and interface documents are then obtained. The corrected text test cases are obtained by correcting existing text test cases, and the interface documents are documents consisting of function interfaces corresponding to each function point test case. The interface documents and the corrected text test cases are then processed using a preset test case orchestration algorithm to obtain scenario test cases corresponding to the document to be analyzed. Compared with related technologies, this disclosure's embodiment automatically generates scenario test cases using a pre-configured test case generation model, significantly reducing manual workload, minimizing omissions or errors, and improving the efficiency of scenario test case writing.

[0085] In one possible implementation of this disclosure, as a refinement of step 101 above, the method for obtaining the use case corresponding to each requirement function point in the document to be analyzed can also be implemented in the following way, but is not limited to: parsing each requirement function point in the document to be analyzed by a preset document analysis algorithm in the configured use case generation model to obtain the use case corresponding to each requirement function point in the document to be analyzed.

[0086] In the embodiments disclosed herein, such as Figure 2 As shown, the document to be analyzed contains multiple requirement function points. These requirement function points are specific functions or tasks that need to be implemented in the software system. They are usually determined based on user needs and are one of the methods used by system designers and developers to describe, test, and estimate software functions. Function point use cases are requirement function point use cases, which are use cases written based on the requirement function points.

[0087] When parsing and processing the functional points of the requirements according to the preset document analysis algorithm, it will be based on preset document analysis conditions. These preset document analysis conditions are custom-defined, standardized conditions to facilitate document parsing. These conditions include, but are not limited to, the following: 1) Requirement Description: A detailed description of the functions or services that the product or system needs to implement, which should be specific and clear; 2) System Constraints: Limitations that may exist in product development, including technical, operational, legal and regulatory restrictions, or inherent design choices such as browser support, operating system compatibility, and multi-language support; 3) Test Conditions: Defines the specific situations to be met or verified, covering both functional and non-functional test conditions; 4) Special Cases: Involves product behavior under uncommon or extreme conditions, including error messages, exception handling, and recovery methods after system crashes, so that these boundary conditions can be fully considered during testing; 5) Requirement Verification: Ensures that the requirements are clear, unambiguous, consistent, and achievable.

[0088] In one possible implementation of this disclosure, as a refinement of step 102 above, the use case orchestration processing of the interface document and the text use cases can also be implemented in the following manner, but is not limited to: matching each of the modified function point use cases in the modified text use cases with the corresponding function interface in the interface document; wherein each modified function point use case contains unique identifier information of the corresponding function interface; and performing use case orchestration processing on each modified function point use case and the corresponding function interface to obtain the scenario use case corresponding to the document to be analyzed.

[0089] In this embodiment of the disclosure, the scenario use case can be obtained by binding the use case of the same requirement function point together with the corresponding function interface.

[0090] In one possible implementation of this disclosure, since the generation of test cases requires the use of a pre-configured test case generation model, the test case generation model needs to be pre-configured before the test case generation process. Therefore, in order to successfully complete the test case generation operation, this disclosure provides a flowchart illustrating a method for configuring a test case generation model, as shown below. Figure 3 As shown, it includes:

[0091] Step 301: Obtain the preset test case output algorithm corresponding to the preset test case output conditions and the preset document analysis algorithm corresponding to the preset document analysis conditions, and configure the preset test case output algorithm and the preset document analysis algorithm in the test case generation model to obtain the test case generation model to be trained.

[0092] In this embodiment of the disclosure, configuring the preset test case output algorithm in the test case generation model enables the text test cases output by the configured test case generation model to satisfy the test case output conditions. Configuring the preset document analysis algorithm in the test case generation model enables the configured test case generation model to apply conditional constraints that satisfy the preset document analysis conditions when parsing the document to be analyzed. The preset test case output algorithm and the preset document analysis algorithm are custom-edited program algorithms. Specifically, this embodiment of the disclosure does not impose any limitations on the preset test case output algorithm and the preset document analysis algorithm.

[0093] The editing content and format of the preset test case output algorithm may include, but are not limited to, the following: As a software engineering testing expert, you need to write professional test cases for this target function point based on the complete requirements document I provide and the key target function points therein.

[0094] Includes the following:

[0095] 1. Test Case Title: Describes the specific function or scenario to be tested. It is a unique identifier for the test case and should accurately reflect the content of the test case for easy understanding and retrieval.

[0096] 2. Test Objective: Record the main objective of this test case, defining the desired result of the test activity.

[0097] 3. Prerequisites: Specific conditions or existing states that need to be met before executing test cases (including environment settings, configurations, and user states, which helps ensure the stability and repeatability of the test).

[0098] 4. Test Steps: List the specific steps required for the test, and explain in detail how to conduct the test. Each step should be clear and specific to ensure consistent test execution and accurate results.

[0099] 5. Input Data: Define the data or parameters that need to be input when conducting tests. These values ​​should be able to trigger or verify test conditions and help ensure test coverage and depth.

[0100] 6. Special case verification: Pay attention to the system behavior under abnormal or boundary conditions to ensure that it can still respond reasonably under non-standard conditions.

[0101] 7. Expected Results: Predefined results used to determine whether the function is executed as needed, providing measurable output or behavior.

[0102] 8. Consider negative scenarios: This helps ensure the comprehensiveness of the test and understand how the system reacts when it encounters unexpected inputs or behaviors.

[0103] 9. Boundary value considerations: Verify the system's behavior under boundary conditions.

[0104] 10. Outlier consideration: Verify system behavior under abnormal input conditions.

[0105] 11. Post-processing: The state the system should be in after the test is completed, including any necessary cleanup or recovery operations.

[0106] Requirements document:

[0107] {prd_doc}

[0108] The target functionalities for which test cases need to be written are:

[0109] {req}

[0110] You must format the answer of each question as a JSON object with the following keys:

[0111]

[0112]

[0113] You must reply to me in this JSON format. Please reply in Chinese, using only JSON format, and only one JSON file. Do not reply with multiple files or any extraneous wording. Note that there may be multiple positive and negative test scenarios; you need to help me determine the number of test scenarios to output based on the requirements analysis.

[0114] The editing content and format of the preset document analysis algorithm may include, but are not limited to, the following: As a software engineering expert, you need to help me analyze each requirement feature in the product requirements document, including:

[0115] 1. Requirements Description: This section details the functions or services that the product or system needs to achieve, and should be specific and clear.

[0116] 2. System Constraints: Potential limitations on product development, including technical, operational, legal, and regulatory restrictions, or inherent design choices such as browser support, operating system compatibility, and multilingual support.

[0117] 3. Test conditions: Define the specific conditions to be met or verified, covering both functional and non-functional test conditions.

[0118] 4. Special Cases: This involves product behavior under uncommon or extreme conditions, including error messages, exception handling, and recovery methods after system crashes, so that these boundary conditions can be fully considered during the testing process.

[0119] 5. Requirements Validation: Ensure that requirements are clear, unambiguous, consistent, and achievable.

[0120] Requirements document:

[0121] {prd_doc}

[0122] You must format the answer of each question as a JSON object with the following keys:

[0123] {{

[0124] "Requirement 1":"

[0125] {{

[0126] "Requirements Description":"",

[0127] "System constraints":"",

[0128] "Test conditions":"",

[0129] "Special Circumstances":"",

[0130] "Requirements Validation":"",

[0131] }}",

[0132] "Requirement 2":"

[0133] {{

[0134] "Requirements Description":"",

[0135] "System constraints":"",

[0136] "Test conditions":"",

[0137] "Special Circumstances":"",

[0138] "Requirements Validation":"",

[0139] }}",

[0140]

[0141] }}

[0142] You must reply to me in this JSON format. Make sure I can convert this JSON object into a Python dictionary. Please reply in Chinese, using only JSON format, and avoid any unnecessary phrasing.

[0143] Step 302: Obtain the training use case dataset; wherein the training use case dataset contains a preset number of training documents to be analyzed and a tag scenario use case corresponding to each training document to be analyzed.

[0144] In this embodiment of the disclosure, the training use case dataset is an existing collection of documents and corresponding use cases, the tagged scenario use cases are existing use cases of training documents to be analyzed that have been written, and the preset number is the number of training documents to be analyzed contained in the training use case dataset, which is a custom-set number. Specifically, this embodiment of the disclosure does not limit the preset number.

[0145] The larger the preset number, the higher the accuracy of the trained and configured test case generation model; the smaller the preset number, the lower the accuracy of the trained and configured test case generation model.

[0146] Step 303: Based on the training test case generation model, perform test case generation processing on the training analysis document to obtain the training scenario test cases corresponding to the training analysis document.

[0147] In this embodiment of the disclosure, the use case generation process includes: Figure 2 The entire process, namely document parsing and test case orchestration, involves the use cases in the training scenarios generated by the test case generation model. The deficiencies of the test case generation model can be identified through the training scenario use cases and the labeled scenario use cases, so as to optimize the test case generation model.

[0148] Step 304: Optimize the training use case generation model using a preset loss function based on the training scenario use cases and the labeled scenario use cases to obtain the configured use case generation model.

[0149] In this embodiment of the disclosure, the preset loss function is a custom-selected function, such as: mean squared error (MSE), mean absolute error (MAE), cross-entropy loss, softmax loss, etc. Specifically, this embodiment of the disclosure does not limit the preset loss function.

[0150] In one possible implementation of this disclosure, when parsing the document to be analyzed using a pre-configured use case generation model, since the parsing is based on the document parsing conditions, only documents that meet the document specification conditions can be accurately parsed. The document specification conditions require that the document to be analyzed contain at least the content specified in the document parsing conditions. Therefore, to accurately parse the document to be analyzed, the following methods can also be used, but are not limited to: obtaining preset document specification conditions; wherein the preset document specification conditions are used to constrain the document to be analyzed; if the document to be analyzed does not meet the preset document specification conditions, adjusting the document to be analyzed according to the preset document specification conditions to obtain an adjusted document to be analyzed that meets the preset document specification conditions, and inputting the adjusted document to be analyzed into the pre-configured use case generation model; if the document to be analyzed meets the preset document specification conditions, inputting the document to be analyzed into the pre-configured use case generation model.

[0151] In this embodiment of the disclosure, the preset document specification conditions are a type of custom setting. The preset document specification conditions require that the document to be analyzed must include at least the following: 1) Requirement description: a detailed description of the functions or services that the product or system needs to implement, which should be specific and clear; 2) System constraints: limitations that may exist in product development, including technical, operational, legal and regulatory restrictions, or inherent design choices, such as browser support, operating system compatibility, multi-language support, etc.; 3) Test conditions: defining the specific situations to be met or verified, covering functional test conditions and non-functional test conditions; 4) Special cases: involving product behavior under uncommon or extreme conditions, including error messages, exception handling, recovery methods after system crashes, etc., so that these boundary conditions can be fully considered during the testing process; 5) Requirement verification: ensuring that the requirements are clear, unambiguous, consistent and achievable.

[0152] When the document to be analyzed does not meet the preset document specification conditions, it is necessary to adjust the document to be analyzed or reselect (or rewrite) the document to be analyzed. When adjusting the document to be analyzed according to the preset document specification conditions, it can be done manually by technical personnel. Similarly, when reselecting (or rewriting) the document to be analyzed, it can also be done manually by technical personnel.

[0153] In one possible implementation of this disclosure, after obtaining the scenario test cases, test engineers need to check and verify whether the automatically generated automated test cases are correct and meet expectations, and feed back the results of the manual inspection to the model for further training and optimization. Therefore, in order to obtain accurate scenario test cases, the following methods can also be used, but are not limited to: obtaining the inspection results of the scenario test cases; if it is determined from the inspection results that the scenario test cases do not conform to the preset test case rules, obtaining the update test case output algorithm and the update document analysis algorithm; configuring the update test case output algorithm and the update document analysis algorithm in the configured test case generation model to obtain the test case generation model to be updated; optimizing the test case generation model to be updated using a preset optimization algorithm based on the inspection results to obtain the updated test case generation model.

[0154] Specifically, to facilitate understanding of the use case generation method described in this disclosure, this disclosure provides a flowchart of another use case generation method, such as... Figure 4 As shown.

[0155] It should also be noted that the configured test case generation model also possesses, but is not limited to, the following functions: 1. Context Understanding: Ensures the model can accurately understand the application's context and business logic, generating meaningful test cases. 2. Templates and Constraints: Uses templates and constraints to guide the model in generating test cases in specific formats to adapt to test management tools or frameworks. 3. Multi-Turn Interaction: May require multiple rounds of interaction to refine test cases, especially when the test case content needs further refinement. 4. Data Generation: For scenarios requiring specific test data, the model needs to be able to generate or provide relevant test data based on the context. 5. Cross-Domain Application: For complex systems involving knowledge from multiple domains, the model needs to have the ability to understand and generate test cases across domains. 6. Continuous Learning: The model should be able to continuously learn and adapt to new requirements and testing paradigms to maintain the timeliness and accuracy of test cases.

[0156] In summary, the embodiments disclosed herein can achieve the following effects:

[0157] 1. The embodiments of this disclosure automatically generate scenario use cases through a pre-configured use case generation model, which can significantly reduce manual workload, reduce omissions or errors, and improve the efficiency of writing scenario use cases.

[0158] 2. The embodiments of this disclosure improve the accuracy of scenario use cases by verifying the effectiveness of scenario use cases manually and determining the automated scenario use cases that meet expectations.

[0159] 3. The embodiments of this disclosure optimize the test case generation model by updating the model's algorithm after identifying undesirable automated scenario test cases, thus ensuring the function of continuous optimization and learning, and maintaining the timeliness and accuracy of test cases.

[0160] Corresponding to the above-described method for generating use cases, this invention also proposes an apparatus for generating use cases. Since the apparatus embodiments of this invention correspond to the method embodiments described above, details not disclosed in the apparatus embodiments can be referred to in the method embodiments described above, and will not be repeated here.

[0161] Figure 5 This is a schematic diagram of the structure of a use case generation device provided in an embodiment of the present disclosure, such as... Figure 6 As shown, it includes:

[0162] The parsing unit 51 is used to input the document to be analyzed into the pre-configured use case generation model for document parsing processing, to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed, and to merge the function point use cases according to the preset merging rules to obtain text use cases;

[0163] The first acquisition unit 52 is used to acquire the corrected text test cases and interface documents; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documents are documents consisting of function interfaces corresponding to each function point test case;

[0164] The orchestration unit 53 is used to perform test case orchestration processing on the interface document and the corrected text test cases through a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed.

[0165] The test case generation apparatus provided in this disclosure inputs the document to be analyzed into a pre-configured test case generation model for document parsing processing, obtaining function point test cases corresponding to each required functional point in the document to be analyzed, and merging the function point test cases according to a preset merging rule to obtain text test cases; obtaining corrected text test cases and interface documents; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documents are documents composed of function interfaces corresponding to each function point test case; the interface documents and the corrected text test cases are processed by a preset test case orchestration algorithm to obtain scenario test cases corresponding to the document to be analyzed. Compared with related technologies, the embodiments of this disclosure automatically generate scenario test cases through a pre-configured test case generation model, which can significantly reduce manual workload, reduce the occurrence of omissions or errors, and improve the efficiency of writing scenario test cases.

[0166] Furthermore, in one possible implementation of this disclosure embodiment, the parsing unit 51 is further configured to parse each requirement function point in the document to be analyzed using a preset document analysis algorithm in the configured use case generation model, so as to obtain the function point use case corresponding to each requirement function point in the document to be analyzed.

[0167] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 6 As shown, the arrangement unit 53 includes:

[0168] The matching module 531 is used to match each of the corrected function point test cases in the corrected text test cases with the corresponding function interface in the interface document to obtain the function interface corresponding to each of the corrected function point test cases; wherein, each of the corrected function point test cases contains unique identification information of the corresponding function interface;

[0169] The orchestration module 532 is used to perform test case orchestration processing on each of the corrected function point test cases and the corresponding function interfaces to obtain the scenario test cases corresponding to the document to be analyzed.

[0170] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 6 As shown, the device further includes:

[0171] The second acquisition unit 54 is used to acquire the preset test case output algorithm corresponding to the preset test case output conditions and the preset document analysis algorithm corresponding to the preset document analysis conditions.

[0172] Configuration unit 55 is used to configure the preset test case output algorithm and the preset document analysis algorithm into the test case generation model to obtain the test case generation model to be trained.

[0173] The second acquisition unit 54 is further configured to acquire a training test case dataset; wherein the training test case dataset includes a preset number of training documents to be analyzed and a tag scenario test case corresponding to each training document to be analyzed;

[0174] The generation unit 56 is used to perform use case generation processing on the training use case to be analyzed document based on the training use case generation model, so as to obtain the training use scenario use cases corresponding to the training use case to be analyzed document.

[0175] The optimization unit 57 is used to optimize the training use case generation model based on the training scenario use cases and the label scenario use cases using a preset loss function to obtain the configured use case generation model.

[0176] Furthermore, in one possible implementation of this embodiment, the second acquisition unit 54 is further configured to acquire preset document specification conditions; wherein the preset document specification conditions are used to impose conditional constraints on the document to be analyzed;

[0177] like Figure 6 As shown, the device further includes:

[0178] The adjustment unit 58 is used to adjust the document to be analyzed according to the preset document specification conditions when the document to be analyzed does not meet the preset document specification conditions, so as to obtain an adjusted document to be analyzed that meets the preset document specification conditions.

[0179] Input unit 59 is used to input the adjusted document to be analyzed into the configured use case generation model;

[0180] The input unit 59 is further configured to input the document to be analyzed into the configured use case generation model if the document to be analyzed meets the preset document specification conditions.

[0181] Furthermore, in one possible implementation of this disclosure embodiment, the acquisition unit 54 is further configured to acquire the inspection results of the scenario use case;

[0182] The second acquisition unit 54 is further configured to acquire, in the case that the scenario use case does not conform to the preset use case rules based on the inspection result, an update use case output algorithm and an update document analysis algorithm.

[0183] The configuration unit 55 is further configured to configure the update test case output algorithm and the update document analysis algorithm into the configured test case generation model to obtain the test case generation model to be updated.

[0184] The optimization unit 57 is further configured to optimize the test case generation model to be updated using a preset optimization algorithm based on the inspection results, so as to obtain an updated test case generation model.

[0185] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of the embodiments of this disclosure, and the principle is the same. Therefore, the embodiments of this disclosure are not limited thereto.

[0186] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0187] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0188] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 702 or a computer program loaded from storage unit 708 into RAM (Random Access Memory) 703. RAM 703 can also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. I / O (Input / Output) interface 705 is also connected to bus 704.

[0189] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0190] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the use case generation method. For example, in some embodiments, the use case generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the aforementioned use case generation method by any other suitable means (e.g., by means of firmware).

[0191] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0192] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0193] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0194] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0195] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0196] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0197] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0198] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0199] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for generating use cases, characterized in that, include: The document to be analyzed is input into the configured test case generation model for document parsing and processing to obtain the function point test cases corresponding to each requirement function point in the document to be analyzed. The function point test cases are then merged according to the preset merging rules to obtain text test cases. Obtain the corrected text test cases and interface documentation; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documentation is a document consisting of the function interfaces corresponding to each functional point test case; The interface document and the revised text test cases are processed by a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed.

2. The method according to claim 1, characterized in that, The step of inputting the document to be analyzed into the pre-configured use case generation model for document parsing and processing, and obtaining the function point use cases corresponding to each requirement function point in the document to be analyzed, includes: The preset document analysis algorithm in the configured use case generation model is used to parse and process each requirement function point in the document to be analyzed, so as to obtain the function point use case corresponding to each requirement function point in the document to be analyzed.

3. The method according to claim 1, characterized in that, The step of arranging the interface document and the corrected text test cases using a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed includes: Each of the functional point test cases in the revised text test cases is matched with the corresponding function interface from the interface document; wherein, each functional point test case contains unique identification information of the corresponding function interface; Each functional point use case and its corresponding function interface are processed by use case orchestration to obtain the scenario use cases corresponding to the document to be analyzed.

4. The method according to claim 1, characterized in that, Before inputting the document to be analyzed into the configured use case generation model for document parsing and processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed, the process also includes: Obtain the preset test case output algorithm corresponding to the preset test case output conditions and the preset document analysis algorithm corresponding to the preset document analysis conditions, and configure the preset test case output algorithm and the preset document analysis algorithm in the test case generation model to obtain the test case generation model to be trained. Obtain a training test case dataset; wherein the training test case dataset contains a preset number of training documents to be analyzed and a tag scenario test case corresponding to each training document to be analyzed; Based on the training test case generation model, the training analysis document is processed to generate test cases to obtain the training scenario test cases corresponding to the training analysis document. Based on the training scenario use cases and the labeled scenario use cases, the training use case generation model is optimized using a preset loss function to obtain the configured use case generation model.

5. The method according to claim 1, characterized in that, Before inputting the document to be analyzed into the configured use case generation model for document parsing and processing to obtain the function point use cases corresponding to each requirement function point in the document to be analyzed, the process also includes: Obtain preset document specification conditions; wherein, the preset document specification conditions are used to impose conditional constraints on the document to be analyzed; If the document to be analyzed does not meet the preset document specification conditions, the document to be analyzed is adjusted according to the preset document specification conditions to obtain an adjusted document to be analyzed that meets the preset document specification conditions, and the adjusted document to be analyzed is input into the configured use case generation model; If the document to be analyzed meets the preset document specification conditions, the document to be analyzed is input into the configured use case generation model.

6. The method according to claim 1, characterized in that, After processing the interface document and the revised text test cases using a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed, the process further includes: Obtain the inspection results of the scenario use cases; If the scenario use case does not conform to the preset use case rules based on the inspection results, obtain the update use case output algorithm and the update document analysis algorithm; The update test case output algorithm and the update document analysis algorithm are configured in the configured test case generation model to obtain the test case generation model to be updated. Based on the inspection results, the test case generation model to be updated is optimized using a preset optimization algorithm to obtain the updated test case generation model.

7. An apparatus for generating use cases, characterized in that, include: The parsing unit is used to input the document to be analyzed into the pre-configured test case generation model for document parsing processing, to obtain the function point test cases corresponding to each requirement function point in the document to be analyzed, and to merge the function point test cases according to the preset merging rules to obtain text test cases; The first acquisition unit is used to acquire the corrected text test cases and interface documents; wherein, the corrected text test cases are obtained by correcting the text test cases, and the interface documents are documents consisting of function interfaces corresponding to each functional point test case; The orchestration unit is used to perform test case orchestration processing on the interface document and the corrected text test cases through a preset test case orchestration algorithm to obtain the scenario test cases corresponding to the document to be analyzed.

8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.