Banking system test case generation method
By constructing a test case training dataset and training large language model, combined with Agent testing smart body and RAG recall tools, the traditional manual test use case compilation is time -consuming and labor -intensive. Cover and accuracy.
Patent Information
- Application Number
- CN202411431511.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-24
AI Technical Summary
Traditional manual test case writing methods are time-consuming and labor-intensive, prone to omissions, incompleteness and poor repetition, and difficult to meet the complex testing needs of modern banking systems.
By constructing test cases to train data sets, train large language models, build Agent test intelligence, use RAG recall tools and MEMORY memory modules to automatically generate test cases of banking systems.
It realizes the generation of highly professional and accurate test cases, improves the effectiveness and comprehensiveness of testing, reduces the cost of manual intervention, and realizes the automation and intelligence of testing.
Smart Images

Figure CN119357014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of banking business systems, and in particular to a method for generating test cases for banking systems. Background Art
[0002] As the complexity of banking business systems continues to increase, traditional manual testing methods face unprecedented challenges. The testing requirements in banking systems often contain a large amount of complex and detailed business logic, which places higher requirements on the writing of test cases. However, existing test cases are almost entirely dependent on manual construction, and test engineers usually manually write test cases based on test requirement documents, user interface (UI) diagrams, and technical solutions. This manual test case writing method is not only time-consuming and labor-intensive, but also prone to omissions, incompleteness, and poor repeatability, which seriously affects test efficiency and test coverage.
[0003] Existing test case generation technologies mainly focus on different types of functional testing, such as interface testing and interface element testing. Currently, the degree of automation is high in interface testing, while other aspects still rely on manual writing of test cases. Although these solutions can partially alleviate the pressure of manually writing test cases, they are costly to implement, lack comprehensiveness, and the tests of different categories cannot communicate with each other, and still rely on a lot of manual intervention.
[0004] As the complexity of banking systems increases and development cycles shorten, traditional manual test case construction methods can no longer meet the testing needs of modern banking systems. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a method for generating test cases for a banking system that overcomes the above problems or at least partially solves the above problems.
[0006] According to one aspect of the present invention, a method for generating test cases for a banking system is provided, the method comprising:
[0007] Step S1: construct a test case training data set;
[0008] Step S2: training a large language model according to the training data set;
[0009] Step S3: constructing an Agent test agent based on the large language model;
[0010] Step S4: injecting the test case information into the knowledge base of the RAG recall tool of the Agent test agent;
[0011] Step S5: parsing the business requirement document and extracting text content as the input part of the Agent test intelligent body;
[0012] Step S6: The Agent test agent disassembles the test case construction rule elements to form a generation process;
[0013] Step S7: the Agent test agent generates various elements of the test case by calling the knowledge base of the RAG recall tool and stores them;
[0014] Step S8: Combine the elements generated by the Agent test agent according to the process to obtain the final test case.
[0015] Optionally, the step S1: constructing a test case training data set specifically includes: collecting test domain knowledge and existing test cases in a database, and constructing a test case training data set.
[0016] Optionally, the step S2: training a large language model according to the training data set specifically includes: training a large language model based on a constructed test case training data set.
[0017] Optionally, the step S3: constructing an Agent test agent based on the large language model specifically includes: constructing an Agent test agent based on the large language model using a RAG recall tool and a Memory module.
[0018] Optionally, the test case information specifically includes: a test case template library and related test case element rule specifications.
[0019] Optionally, the step S5: parsing the business requirement document and extracting text content as the input part of the Agent test agent specifically includes:
[0020] Parse business requirement documents and extract business functions and business process rules;
[0021] The input and output text contents are used as the input part of the Agent test intelligent body.
[0022] Optionally, the step S6: the Agent test agent disassembles the test case construction rule elements to form a generation process specifically includes: the Agent test agent disassembles the test case construction rule elements to form a generation process through the prompt word prompt.
[0023] Optionally, the step S7: the Agent test agent generates various elements of the test case by calling the knowledge base of the RAG recall tool and stores them, specifically including:
[0024] The Agent test agent combines the background knowledge of the relevant elements injected into the RAG knowledge base in step S4 with the large model trained in step S2 to generate the elements of the test case in sequence, and stores them through the Memory module in the middle.
[0025] The present invention provides a method for generating test cases for a banking system, the method comprising: step S1: constructing a test case training data set; step S2: training a large language model according to the training data set; step S3: constructing an Agent test agent based on the large language model; step S4: injecting test case information into the knowledge base of the RAG recall tool of the Agent test agent; step S5: parsing the business requirement document and extracting text content as the input part of the Agent test agent; step S6: the Agent test agent disassembles the test case construction rule elements to form a generation process; step S7: the Agent test agent generates each element of the test case by calling the knowledge base of the RAG recall tool and stores it; step S8: combining the elements generated by the Agent test agent according to the process to obtain the final test case. The method can generate test cases with high professionalism and accuracy, and improve the effectiveness and comprehensiveness of the test.
[0026] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0028] Figure 1 A flowchart of a method for generating test cases for a banking system provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of information interaction of a method for generating test cases for a banking system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0031] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0032] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0033] like Figure 1 and Figure 2 As shown, a method for generating test cases for a banking system based on a large model and Agent technology includes:
[0034] Step S1: Collect test domain knowledge and existing test cases in the database to build a test case training dataset.
[0035] Step S2: Train a large language model based on the test case training dataset constructed in step S1.
[0036] Step S3: Based on the large language model trained in step S2, use the RAG recall tool and the Memory module to build an Agent test agent.
[0037] Step S4: inject the test case template library and the relevant test case element rule specifications into the knowledge base of the RAG recall tool for the Agent test agent constructed in step S3.
[0038] Step S5: Parse the business requirement document, extract business functions, business process rules, input and output text content as the input part of the Agent test intelligent body in step S3.
[0039] Step S6: The Agent test intelligent body disassembles the test case construction rule elements into a generation process through prompts for step-by-step generation.
[0040] Step S7: The Agent test agent combines the background knowledge of the relevant elements injected into the RAG knowledge base in step S4 with the large model trained in step S2 to generate the elements of the test case in sequence, and stores them through the Memory module in the middle.
[0041] Step S8: Combine the elements generated by the Agent test agent according to the process to obtain the final test case.
[0042] A method for generating test cases for a banking system based on a large model and Agent technology, comprising:
[0043] In step S1, test domain knowledge and existing test cases in the database are collected to construct a test case training data set; training set data sample:
[0044] {Instruction: This is a functional test case generation task. Please generate professional test cases based on the given information and requirements;
[0045] Input: Business function description
[0046] 1. Added the "Number of Sub-Requirement Items" list item on the requirement list page, supports drop-down search, and supports export.
[0047] 2. Parent Demand Details - When selecting content in the application finalization pop-up window, the "Number of selected demand items / Total number of demand items" is displayed.
[0048] 3. The parent requirement details / child requirement details page displays the "number of finalized requirement items / total number of requirement items".
[0049] Business Rules
[0050] 1. The number displayed in the "Number of Sub-Requirement Items" on the requirement list page is the number of filtered data results that meet the search criteria. If there is no item, "--" is displayed.
[0051] 2. On the requirement list page, the drop-down items for the search condition "Number of sub-requirement items" are: "Yes" and "No"
[0052] 3. The "Number of sub-requirement items" field supports users to set display / hide.
[0053] 4. When exporting requirements in batches, the "number of sub-requirement items" is added to the export document template.
[0054] 5. Parent Demand Details - When selecting content in the application finalization pop-up window, the "Selected / Total" on the right is changed to display "Number of selected demand items / Total number of demand items".
[0055] 6. On the parent requirement details / child requirement details page, the top "Finalized / Total" is changed to display "Number of finalized requirement items / Total number of requirement items".
[0056] Output: Nature of case: positive example.
[0057] Test purpose: Verify that when there is no entry, the "Number of sub-requirement items" on the requirement list page displays "--".
[0058] Test method: Boundary value analysis
[0059] Prerequisite: The user has logged in to the system and entered the Requirements-Requirement Management page, ready to view or retrieve the requirement list.
[0060] Steps:
[0061] 1. Log in to the system and enter the Demand-Demand Management page.
[0062] 2. On the requirement list page, use the search function to filter out those without sub-requirement entries.
[0063] 3. Check the 'Number of Sub-Requirement Items' column to confirm the displayed content.
[0064] Expected results: 1. The page is loaded successfully, user authentication is passed, and the requirement list interface is displayed.
[0065] 2. The page data shows that there are no sub-requirement items that meet the search criteria.
[0066] 3. The 'Number of Subrequirement Items' column displays '--'.}
[0067] 3. A method for generating test cases for a banking system based on a big model and Agent technology, characterized in that in step S2, the big model learns the test case-related domain knowledge by training on the test case training data set to obtain a professional domain big model:
[0068] 4. A method for generating test cases for a banking system based on a large model and Agent technology, characterized in that, in step S3, the trained large language model is taken as the core, and the RAG recall tool and the Memory module are used to build an Agent test agent to generate test cases with high professionalism and accuracy.
[0069] 5. A method for generating test cases for a banking system based on a large model and Agent technology, characterized in that, in step S4, a test case template library and a related test case element rule specification are injected into the RAG recall tool knowledge base constructed in step S3 for the Agent test agent;
[0070] {Knowledge Base: 1. Elements of test purpose definition: Determine the core goal of the test, define the main focus of the test and the quality characteristics to be verified, such as functional correctness, security, ease of use of the user interface, etc.
[0071] 2. Elements defining the nature of a case: positive example or negative example.
[0072] 3. Definition of preconditions: Conditions that must be met before a specific test can be executed. This may include environment setup, configuration, data preparation, previously executed steps, or any other necessary state.
[0073] 4. Define the elements of the test steps: a specific sequence of operations used to reproduce and verify specific functions or problems during the test. These steps should be clear and accurate so that other testers can reproduce the test.
[0074] 5. Elements of expected results: The expected results after executing the test steps. This includes the behavior, output or state of the software to verify whether the actual results meet the expectations.}
[0075] 6. A method for generating test cases for a banking system based on a large model and Agent technology, characterized in that, in step S5, by parsing the business requirement document, business functions, business process rules, input and output and other text contents are extracted as the input part of the Agent test intelligent body constructed in step S3.
[0076] 7. A method for generating test cases for a banking system based on a large model and Agent technology, characterized in that in step S6, the Agent test agent decomposes the test case construction rule elements into a generation process through prompts for step-by-step generation. Prompts such as:
[0077] {Generate a test case to verify [test purpose]. Please use [test method] and make sure to include the following information:
[0078] 1. Nature of the case: [positive example or negative example].
[0079] 2. Test Purpose: Describe the goal of the test in detail, for example [Verification: When there is no entry, the "Number of sub-requirement items" on the requirement list page displays "--"].
[0080] 3. Preconditions: Describe all the conditions that need to be met before executing the test, such as [the user has logged into the system and entered the Requirements-Requirements Management page, ready to view or retrieve the requirements list].
[0081] 4. Operation steps: Provide detailed steps to perform the test, such as:
[0082] -Log in to the system and enter the Requirements-Requirement Management page.
[0083] -On the requirement list page, use the search function to filter out items without sub-requirements.
[0084] - Check the 'Number of Sub-Requirement Items' column to confirm what is displayed.
[0085] 5. Expected results: List the expected test results, for example:
[0086] -The page is loaded successfully, user authentication is passed, and the requirement list interface is displayed.
[0087] -The page data shows that there are no sub-requirement items that meet the search criteria.
[0088] - The 'Number of Subreq Items' column displays '--'.
[0089] Please generate a complete test case according to the above requirements.}
[0090] A method for generating test cases for a banking system based on a big model and Agent technology, characterized in that in step S7, the Agent test agent combines the background knowledge of the relevant elements injected into the RAG knowledge base in step S4 with the big model trained in step S2 to sequentially generate the elements of the test case: case nature, test purpose, test method, prerequisite, operation steps, expected results, and store them in the middle through a Memory module.
[0091] A method for generating test cases for a banking system based on a large model and Agent technology, characterized in that in step S8, the elements generated by the Agent test agent according to the process are combined to obtain the final test case.
[0092] {Nature of case: positive example.
[0093] Test purpose: Verification: Check that the drop-down options of "Number of sub-requirement items" on the requirement list page include "Yes" and "No"
[0094] Testing method: scenario testing method
[0095] Prerequisites: The user has logged into the system and entered the Demand-Demand Management page, data preparation has been completed, including the existence of at least one parent demand and child demand, and filtering or retrieval operations have been performed to generate displayable item number data.
[0096] Steps:
[0097] 1. Log in to the system and enter the Demand-Demand Management page.
[0098] 2. On the requirement list page, find and expand the 'Number of sub-requirement items' drop-down option.
[0099] Expected results:
[0100] 1. The page is loaded successfully and the requirements list is displayed.
[0101] 2. The drop-down option expands to show two options: 'With entry' and 'Without entry'.}
[0102] Beneficial effects:
[0103] 1. Reduce labor costs and improve efficiency: The existing test case generation method mainly relies on manual writing, which is time-consuming, labor-intensive and inefficient. The present invention introduces Agent technology based on large models. The powerful text generation technology of large language models can automatically generate test cases that conform to the business logic of banks, significantly reducing manual intervention, thereby reducing labor costs and improving testing efficiency.
[0104] 2. Improve test coverage and accuracy: The existing manual test case writing method is prone to errors and omissions, and the general closed-source big model lacks test domain knowledge and is prone to hallucinations, making it difficult to guarantee test coverage and accuracy. The present invention improves the accuracy of test case generation by strengthening the test domain knowledge of the big model through the big model customized training of test domain knowledge and existing test cases in the test database; then the trained big model is used as the core brain to build an Agent test agent. The Agent test agent consists of a big model, a RAG recall tool, and a Memory module. By combining the professional knowledge of the banking system and the business logic of the business requirements document, it generates test cases with high professionalism and accuracy.
[0105] 3. Realize test automation and intelligence: Although the existing auxiliary test case generation method utilizes the capabilities of AI, it still requires a lot of human participation and cannot be fully automated. Based on large models and Agent technology, the present invention can automatically analyze banking business needs and system changes, dynamically generate and optimize test cases, and realize efficient and intelligent test automation.
[0106] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating test cases for a banking system, characterized in that: The generation method comprises: Step S1: construct a test case training data set; Step S2: training a large language model according to the training data set; Step S3: constructing an Agent test agent based on the large language model; Step S4: injecting the test case information into the knowledge base of the RAG recall tool of the Agent test agent; Step S5: parsing the business requirement document and extracting text content as the input part of the Agent test intelligent body; Step S6: The Agent test agent disassembles the test case construction rule elements to form a generation process; Step S7: the Agent test agent generates various elements of the test case by calling the knowledge base of the RAG recall tool and stores them; Step S8: Combine the elements generated by the Agent test agent according to the process to obtain the final test case.
2. A banking system test case generation method according to claim 1, characterized in that: The step S1: constructing a test case training data set specifically includes: collecting test domain knowledge and existing test cases in the database, and constructing a test case training data set.
3. A banking system test case generation method according to claim 1, characterized in that: The step S2: training a large language model according to the training data set specifically includes: training a large language model based on a constructed test case training data set.
4. A banking system test case generation method according to claim 1, characterized in that: The step S3: constructing an Agent test agent based on the large language model specifically includes: Based on the large language model, the RAG recall tool and the Memory module are used to build an Agent test agent.
5. A banking system test case generation method according to claim 1, characterized in that: The test case information specifically includes: a test case template library and related test case element rule specifications.
6. A method for generating test cases for a banking system according to claim 1, characterized in that: The step S5: parsing the business requirement document and extracting text content as the input part of the Agent test intelligent body specifically includes: Parse business requirement documents and extract business functions and business process rules; The input and output text contents are used as the input part of the Agent test intelligent body.
7. A method for generating test cases for a banking system according to claim 1, characterized in that: The step S6: the Agent test agent disassembles the test case construction rule elements to form a generation process specifically includes: the Agent test agent disassembles the test case construction rule elements to form a generation process through the prompt word prompt.
8. A method for generating test cases for a banking system according to claim 1, characterized in that: The step S7: the Agent test agent generates various elements of the test case by calling the knowledge base of the RAG recall tool and stores them, which specifically includes: The Agent test agent combines the background knowledge of the relevant elements injected into the RAG knowledge base in step S4 with the large model trained in step S2 to generate the elements of the test case in sequence, and stores them through the Memory module in the middle.
Citation Information
Cited By
Intelligent financial engineering quantitative research and reproduction method and related assembly
CN120258995A
An intelligent financial engineering quantitative research and reproduction method and related components
CN120258995B