Automatic generation method and device of test case and computer equipment

By generating the test model corresponding to the test outline and identifying the test elements and conditions, test cases are automatically generated, which solves the problems of low efficiency and difficult quality of test case generation in the existing technology, and achieves efficient and accurate test case generation and demand change response.

CN119718928APending Publication Date: 2025-03-28BEIJING PACTERA JINXIN TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411804673.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the generation efficiency of test cases is low, manual writing requires a lot of labor costs, and the quality is difficult to guarantee. Especially when demand changes, it is necessary to manually identify the scope of impact and modify the test cases.

Method used

By obtaining the business requirements information, business information, business scenario information and modeling requirements information of banking business, generate the test model corresponding to the test outline, identify the test elements and test conditions, generate test strategies and automatically generate test cases.

Benefits of technology

It improves the generation accuracy and coverage of test cases, reduces the cost and efficiency of manual writing and modification, and can quickly identify the impact range of demand changes and conduct regression testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718928A_ABST
    Figure CN119718928A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic generation method and device of a test case and computer equipment. The method comprises the steps of obtaining business demand information of a bank business, business information of the bank business, business scene information of the bank business and modeling demand information, and generating a test model corresponding to a test outline of the bank business based on the business demand information and the modeling demand information; on the basis of the business information of the banking business, identifying each test element of the banking business, and on the basis of each test element and the business scene information, identifying each test condition corresponding to each test element through the test model; and generating the silver based on the test elements and the test conditions corresponding to the test elements. By adopting the method, the generation efficiency of the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of automatic generation of test cases, and in particular to a method, apparatus and computer equipment for automatically generating test cases. Background Art

[0002] With the rapid development of banking informatization, intelligent banking business is constantly developing. In the process of development, in order to efficiently guide R&D and testing work, a large number of test cases are often generated to structure the R&D and testing work, replacing the traditional software requirements specifications to improve the guidance effect of R&D and testing work. Therefore, how to improve the accuracy and coverage of test case generation is the focus of current testing model research.

[0003] The traditional test case generation method is to manually write test cases without using test models. However, manual writing requires a lot of manpower costs for case writing projects with tens of thousands of cases, which makes the writing efficiency low. In addition, due to the differences in testing experience and business understanding of the people who write the cases, the quality of the test cases cannot be guaranteed. Finally, if there is a change in requirements, it is necessary to manually identify the scope of impact and manually modify the test cases, which leads to low test case generation efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for automatically generating test cases in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for automatically generating a test case, comprising:

[0006] Acquire business requirement information of a banking business, business information of the banking business, business scenario information of the banking business, and modeling requirement information, and generate a test model corresponding to a test outline of the banking business based on the business requirement information and the modeling requirement information;

[0007] Based on the business information of the banking business, identifying each test element of the banking business, and based on each test element and the business scenario information, identifying each test condition corresponding to each test element through the test model;

[0008] Based on each of the test elements and the test conditions corresponding to each of the test elements, each test strategy of the banking business is generated, and based on each of the test strategies, a test case of the banking business is generated.

[0009] Optionally, the generating a test model corresponding to the test outline of the banking business based on the business requirement information and the modeling requirement information includes:

[0010] Based on the business requirement information, identifying the business requirement content of each business requirement type of the banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type;

[0011] Based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identifying the association information between each business requirement type and each model type, and based on the association information, identifying each business requirement type corresponding to each model type;

[0012] Based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, a sub-test model corresponding to each model type is constructed, and the sub-test models corresponding to all model types are used as the test model for the banking business.

[0013] Optionally, the identifying each test element of the banking service based on the business information of the banking service includes:

[0014] Splitting the banking business information into business data of each business type, and querying each element point data in each business type and the element type to which each element point data belongs through an element point query strategy;

[0015] Based on the element point data corresponding to each element type, the model type corresponding to each element type is queried in the model database, and the element point data of the element point type corresponding to each model type are used as the test elements of the banking business.

[0016] Optionally, the identifying, based on the test elements and the business scenario information, the test conditions corresponding to each test element through the test model includes:

[0017] For each test element, based on each element point data of the element point type corresponding to the test element and the business scenario information, query each attribute information corresponding to the test element in the model type corresponding to the test element through the test analysis strategy;

[0018] Based on each of the attribute information, each of the attribute information is converted into each test condition through a condition conversion strategy, and each of the test conditions is used as each test condition corresponding to the test element.

[0019] Optionally, generating each test strategy of the banking service based on each test element and the test condition corresponding to each test element includes:

[0020] Each of the test elements is classified by a rule classification strategy to generate a test element group of each rule category;

[0021] Based on the test element groups of each rule category, a test condition combination strategy is generated, and through the test condition combination strategy, each test condition in the test element groups of each rule category is arranged and combined to obtain each test strategy.

[0022] Optionally, generating a test case for the banking service based on each of the test strategies includes:

[0023] For each test strategy, based on each test condition included in the test strategy, collect the case composition logic of the test case;

[0024] Based on the case composition logic, identify the condition combination strategy of each of the test conditions, and based on the condition combination strategy of each of the test conditions and each of the test conditions, generate a test natural language corresponding to the test strategy through a large language model;

[0025] The test natural language is used as a test case for the banking business.

[0026] In a second aspect, the present application also provides a device for automatically generating test cases, including:

[0027] An acquisition module, used to acquire business requirement information of a banking business, business information of the banking business, business scenario information of the banking business, and modeling requirement information, and generate a test model corresponding to a test outline of the banking business based on the business requirement information and the modeling requirement information;

[0028] an identification module, configured to identify each test element of the banking business based on the business information of the banking business, and identify each test condition corresponding to each test element through the test model based on each test element and the business scenario information;

[0029] A generating module is used to generate each test strategy of the banking business based on each test element and the test conditions corresponding to each test element, and to generate a test case of the banking business based on each test strategy.

[0030] Optionally, the acquisition module is specifically used to:

[0031] Based on the business requirement information, identifying the business requirement content of each business requirement type of the banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type;

[0032] Based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identifying the association information between each business requirement type and each model type, and based on the association information, identifying each business requirement type corresponding to each model type;

[0033] Based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, a sub-test model corresponding to each model type is constructed, and the sub-test models corresponding to all model types are used as the test model for the banking business.

[0034] Optionally, the identification module is specifically used to:

[0035] Splitting the banking business information into business data of each business type, and querying each element point data in each business type and the element type to which each element point data belongs through an element point query strategy;

[0036] Based on the element point data corresponding to each element type, the model type corresponding to each element type is queried in the model database, and the element point data of the element point type corresponding to each model type are used as the test elements of the banking business.

[0037] Optionally, the identification module is specifically used to:

[0038] For each test element, based on each element point data of the element point type corresponding to the test element and the business scenario information, query each attribute information corresponding to the test element in the model type corresponding to the test element through the test analysis strategy;

[0039] Based on each of the attribute information, each of the attribute information is converted into each test condition through a condition conversion strategy, and each of the test conditions is used as each test condition corresponding to the test element.

[0040] Optionally, the generating module is specifically used for:

[0041] Each of the test elements is classified by a rule classification strategy to generate a test element group of each rule category;

[0042] Based on the test element groups of each rule category, a test condition combination strategy is generated, and through the test condition combination strategy, each test condition in the test element groups of each rule category is arranged and combined to obtain each test strategy.

[0043] Optionally, the generating module is specifically used for:

[0044] For each test strategy, based on each test condition included in the test strategy, collect the case composition logic of the test case;

[0045] Based on the case composition logic, identify the condition combination strategy of each of the test conditions, and based on the condition combination strategy of each of the test conditions and each of the test conditions, generate a test natural language corresponding to the test strategy through a large language model;

[0046] The test natural language is used as a test case for the banking business.

[0047] In a third aspect, the present application provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.

[0048] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0049] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0050] The above-mentioned automatic generation method, device and computer equipment of test cases obtain the business demand information of banking business, the business information of the banking business, the business scenario information of the banking business, and the modeling demand information, and generate the test model corresponding to the test outline of the banking business based on the business demand information and the modeling demand information; identify the test elements of the banking business based on the business information of the banking business, and identify the test conditions corresponding to each test element through the test model based on each test element and the business scenario information; generate the test strategies of the banking business based on each test element and the test conditions corresponding to each test element, and generate the test case of the banking business based on each test strategy. This solution comprehensively analyzes the business scenario from the business information, business scenario information and business demand information of the banking business, and then constructs the test model corresponding to the test outline based on the banking business in combination with the modeling demand information, thereby improving the integration degree of the constructed test model with the banking business. Then, this solution identifies the test elements of the banking business and the test conditions in the test elements based on the constructed test model. The recognition accuracy and comprehensiveness of the test requirements of the banking business are improved. Finally, based on the above information, this solution constructs different testing strategies, conducts a comprehensive analysis of the various business situations of the banking business, and improves the comprehensiveness of the test analysis of the various test situations of the banking business. The test cases generated based on this can not only generate the test cases required by the banking business in an all-round and multi-angle manner, but also improve the test effect of the test cases. Finally, when the requirements change, that is, the test elements and test conditions in the model change, according to the path of generating cases, the test cases involved in the changes can be easily identified, and the scope of cases that require regression testing can be locked. The inefficiency of manual modification of test cases when requirements change is avoided, thereby comprehensively improving the efficiency of test case generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A schematic diagram of a flow chart of a method for automatically generating test cases in an embodiment;

[0053] Figure 2 A schematic diagram of the structure of a test model in an embodiment;

[0054] Figure 3A schematic diagram of the corresponding relationship between a test outline and a test model in an embodiment;

[0055] Figure 4 A schematic diagram of an automatic generation method of test cases in an embodiment;

[0056] Figure 5 A schematic diagram of a process of automatically generating a test case in an embodiment;

[0057] Figure 6 is a structural block diagram of an automatic generation device for test cases in an embodiment;

[0058] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] The automatic generation method of test cases provided in the embodiment of the present application can be applied to the application environment of automatic generation of test cases. Among them, the method can be applied to a terminal, can also be applied to a server, can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, mid-size computers, etc. Among them, the terminal conducts a comprehensive analysis of the business scenario from the business information, business scenario information, and business demand information of the banking business, and then combines the modeling demand information to construct a test model corresponding to the test outline based on the banking business, thereby improving the degree of integration between the constructed test model and the banking business. Then, this solution identifies the test elements of the banking business and the test conditions in the test elements based on the constructed test model. The recognition accuracy and comprehensiveness of the test requirements for the banking business are improved. Finally, based on the above information, this solution constructs different testing strategies, conducts a comprehensive analysis of the various business situations of the banking business, and improves the comprehensiveness of the test analysis of the various test situations of the banking business. The test cases generated based on this can not only generate the test cases required by the banking business in an all-round and multi-angle manner, but also improve the test effect of the test cases. Finally, when the requirements change, that is, the test elements and test conditions in the model change, according to the path of generating cases, the test cases involved in the changes can be easily identified, and the scope of cases that require regression testing can be locked. The inefficiency of manual modification of test cases when requirements change is avoided, thereby comprehensively improving the efficiency of test case generation.

[0061] In an exemplary embodiment, Figure 1 As shown, a method for automatically generating a test case is provided, and the method is applied to a terminal as an example for explanation, including the following steps S101 to S103. Among them:

[0062] Step S101, obtaining business requirement information of banking business, business information of banking business, business scenario information of banking business, and modeling requirement information, and generating a test model corresponding to the test outline of banking business based on the business requirement information and modeling requirement information.

[0063] In this embodiment, the terminal obtains the business demand information, business information, and business scenario information of the banking business from the business database of the banking business. Among them, the business demand information is the test demand information corresponding to different business departments of the business scenario. The business information is the product business information of the banking business, and other business information. The business scenario information is the current business scenario conditions. The business scenario is used to analyze the test conditions corresponding to each test element in the test model. Combining the analysis with the business scenario can improve the accuracy of the analysis. Then, the terminal generates a test model corresponding to the test outline of the banking business based on the business demand information and the modeling demand information. Among them, such as Figure 2 As mentioned above, the test model consists of three parts: product model, process model and data model, each of which is gradually broken down into five levels from top to bottom. The specific generation process will be described in detail later, and the test outline includes the following: Figure 3 The root directory (requirements), first-level directory (transactions), and second-level directory (function points) are shown.

[0064] Step S102, based on the business information of the banking business, identifying various test elements of the banking business, and based on the various test elements and the business scenario information, identifying various test conditions corresponding to each test element through the test model.

[0065] In this embodiment, the terminal identifies each test element of the banking business based on the business information of the banking business, and identifies each test condition corresponding to each test element through the test model based on each test element and the business scenario information. Among them, each test element is a test point that needs to be verified in the test case, which is divided into two parts in the test model: product elements and other elements. Among them, product elements are test verification points related to product attributes, such as the minimum deposit amount, certificate type, deposit period, etc. of personal time deposit products, corresponding to the product model in the test model; other elements are test verification points other than product attributes, such as whether the agent opens an account, whether it is a blacklist customer, etc., corresponding to the data model in the test model. The test conditions can be transformed through rules based on the entity attributes, attribute domains, and attribute domain instances in the data model associated with product elements and other elements. The specific identification process will be described in detail later.

[0066] Step S103, generating various test strategies for banking services based on various test elements and test conditions corresponding to various test elements, and generating test cases for banking services based on various test strategies.

[0067] In this embodiment, the terminal generates various test strategies for banking services based on various test elements and test conditions corresponding to various test elements, and generates test cases for banking services based on various test strategies. The test strategy is a combination of test case generation conditions obtained by combining various test conditions. The specific generation process will be described in detail later.

[0068] Based on the above scheme, by comprehensively analyzing the business scenarios from the business information, business scenario information, and business demand information of the banking business, and then combining the modeling demand information, a test model corresponding to the test outline based on the banking business is constructed, which improves the integration degree of the constructed test model with the banking business. Then, based on the constructed test model, this scheme identifies the test elements of the banking business and the test conditions in the test elements. The accuracy and comprehensiveness of the identification of the test requirements of the banking business are improved. Finally, based on the above information, this scheme constructs different test strategies, conducts a comprehensive analysis of the various business situations of the banking business, and improves the comprehensiveness of the test analysis of the various test situations of the banking business. The test cases generated based on this can not only generate the test cases required by the banking business in an all-round and multi-angle manner, but also improve the test effect of the test cases. Finally, when the requirements change, that is, the test elements and test conditions in the model change, according to the path of generating the case, the test cases involved in the change can be easily identified, and the case scope that needs regression testing can be locked. The inefficiency of manual modification of test cases when the requirements change is avoided, thereby comprehensively improving the efficiency of test case generation.

[0069] Optionally, a test outline for banking business is generated based on the business requirement information and the modeling requirement information, including: based on the business requirement information, identifying the business requirement content of each business requirement type of banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type; based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identifying the association information between each business requirement type and each model type, and based on the association information, identifying each business requirement type corresponding to each model type; based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, constructing a sub-test model corresponding to each model type, and using the sub-test models corresponding to all model types as the test models for banking business.

[0070] In this embodiment, the terminal identifies the business requirement content of each business requirement type of the banking business based on the business requirement information, and splits the modeling requirement information of the test model into sub-model requirement information of each model type. The model type includes but is not limited to a product model type, a process model type, and a data model type. Each business requirement type represents the requirement type of different business departments of the banking business, the requirement type of different business fields, etc.

[0071] Then, the terminal identifies each business requirement type and the association information between each model type based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, and identifies each business requirement type corresponding to each model type based on the association information.

[0072] Based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, a sub-test model corresponding to each model type is constructed, and the sub-test models corresponding to all model types are used as the test model for banking business. Figure 3 As shown in the figure, modeling requirements correspond to the root directory of the test outline, task groups correspond to the first-level directory of the test outline, which is the transaction level of the business system, and tasks correspond to the second-level directory of the test outline, which is the function point level. By splitting the business requirement type into various model types, we can use business requirements as the entry point and perform integration testing based on different transactions divided by the system, thereby improving test efficiency and the amount of test cases generated.

[0073] Based on the above solution, by splitting the business requirement types into various model types, we use business requirements as the entry point and perform integration testing according to different transactions divided by the system, thereby improving testing efficiency and the amount of test cases generated.

[0074] Optionally, based on the business information of the banking business, identify the test elements of the banking business, including: splitting the banking business information into business data of each business type, and querying the element point data in each business type and the element type to which each element point data belongs through the element point query strategy; based on the element point data corresponding to each element type, query the model type corresponding to each element type in the model database, and use the element point data of the element point type corresponding to each model type as the test elements of the banking business.

[0075] In this embodiment, the terminal splits the banking business information into business data of each business type, and queries the data of each element point in each business type and the element type to which each element point data belongs through the element point query strategy. Among them, the element type includes product element type and other element types, and the product element is a test verification point related to the product attribute, such as the minimum deposit amount, certificate type, deposit period, etc. of the personal time deposit product, corresponding to the product model in the test model; other elements are test verification points other than product attributes, such as whether the account is opened by an agent, whether it is a blacklist customer, etc., corresponding to the data model in the test model.

[0076] Then, the terminal queries the model type corresponding to each element type in the model database based on the element point data corresponding to each element type, and uses the element point data of the element point type corresponding to each model type as the test elements of the banking business.

[0077] Based on the above solution, by splitting the banking business information into elements, the test points that need to be verified in the test case are identified, thereby improving the accuracy and comprehensiveness of the identification of the test points.

[0078] Optionally, based on each test element and business scenario information, the test conditions corresponding to each test element are identified through the test model, including: for each test element, based on the element point data of the element point type corresponding to the test element, and the business scenario information, through the test analysis strategy, querying each attribute information corresponding to the test element in the model type corresponding to the test element; based on each attribute information, through the condition conversion strategy, converting each attribute information into each test condition, and using each test condition as each test condition corresponding to the test element.

[0079] In this embodiment, the terminal queries the attribute information corresponding to each test element in the model type corresponding to the test element based on the data of each element point of the element point type corresponding to the test element and the business scenario information through the test analysis strategy. Specifically, the attribute information includes entity attributes, attribute domains, and attribute domain instances in the data model associated with the product element or other elements. Among them, the test analysis strategy includes equivalence class division strategy, boundary value and other test analysis methods.

[0080] Then, based on each attribute information, the terminal converts each attribute information into each test condition through the condition conversion strategy, and uses each test condition as each test condition corresponding to the test element. For example, the "voucher type" in the test condition has the associated attribute domain instances of "card" and "regular passbook". According to the equivalence class division principle, the test conditions of the test element "voucher type" are "card" and "regular passbook", which are both positive test conditions; for another example, the "starting deposit amount" in the test condition, according to the product conditions, the starting deposit amount of the regular deposit is 50 yuan. According to the boundary value division principle, the test condition of the test element "starting deposit amount" is "less than 50 yuan" as a negative test condition, and "equal to 50 yuan" and "greater than 50 yuan" as a positive test condition.

[0081] Based on the above solution, by splitting the test elements into different test conditions, the comprehensiveness and accuracy of the identification of the test elements are improved.

[0082] Optionally, based on each test element and the test conditions corresponding to each test element, various test strategies for banking services are generated, including: generating test element groups of each rule category through a rule classification strategy for each test element; generating a test condition combination strategy based on the test element groups of each rule category, and through the test condition combination strategy, permuting and combining each test condition in the test element groups of each rule category to obtain various test strategies.

[0083] In this embodiment, the terminal generates test element groups of each rule category for each test element through a rule classification strategy. Among them, the rule splitting strategy is to split the test elements into element categories preset by the staff. For example, the test elements are divided into three categories. In principle, they are classified according to the following rules, and the element classification can also be adjusted manually: the basic product type is a type of test element, and the algorithm for generating test case condition combinations needs to fully cover the type of test elements; the product element is a type of test element, and the test case condition combination is generated according to the PairWise algorithm to cover the test conditions in pairs; other elements are type three test elements, and the test case condition combination is generated to cover the test conditions according to a single condition.

[0084] Then, the terminal generates a test condition combination strategy based on the test element groups of each rule category. For example, one type of element:

[0085] Product name (fixed deposit with lump sum deposit and withdrawal, fixed deposit with lump sum deposit and withdrawal, fixed deposit with both fixed deposit and flexible deposit).

[0086] Second category elements:

[0087] Account type (Type I, Type II, Type III).

[0088] Type of voucher (card, deposit certificate, time deposit passbook).

[0089] Deposit period (three months, one year, three years).

[0090] Three types of elements:

[0091] Minimum deposit amount (less than 50, equal to 50, greater than 50).

[0092] Withdrawal method (with ID, with password, with password and ID).

[0093] Age of the account holder (less than 16, equal to 16, greater than 16).

[0094] Whether to list users (white list, black list, ordinary users).

[0095] Universal exchange (not universal exchange, branch exchange, head office exchange).

[0096] Deposit transfer upon maturity (principal transfer, principal and interest transfer, partial principal transfer).

[0097] There are 12 combinations of the two types of elements when they are paired up using the PairWise algorithm.

[0098] There are 18 combinations of single conditions of the three types of elements.

[0099] Finally, the terminal uses the test condition combination strategy to permutate and combine the test conditions in the test element group of each rule category to obtain each test strategy. Specifically, the number of combinations fully covered by one type of element is 3*(18+12), a total of 90 combinations. Compared with the 59049 combinations of the traditional Cartesian product algorithm, after being streamlined according to the business characteristics of the bank, the number of test cases can be significantly reduced while maintaining a high test coverage rate.

[0100] Based on the above scheme, by classifying and simplifying the test elements and test conditions, and then combining and splitting them to obtain various test strategies, the number of test cases can be significantly reduced while maintaining a high test coverage.

[0101] Optionally, based on each test strategy, test cases for banking services are generated, including: for each test strategy, based on each test condition included in the test strategy, and collecting the case composition logic of the test case; based on the case composition logic, identifying the condition combination strategy of each test condition, and based on the condition combination strategy of each test condition and each test condition, generating a test natural language corresponding to the test strategy through a large language model; using the test natural language as a test case for banking services.

[0102] In this embodiment, for each test strategy, the terminal collects the case composition logic of the test case based on the test conditions contained in the test strategy. Then, based on the case composition logic, the terminal identifies the condition combination strategy of each test condition, and based on the condition combination strategy of each test condition and each test condition, generates the test natural language corresponding to the test strategy through the large language model. Finally, the terminal uses the test natural language as a test case for banking services. For example, Figure 4 As shown, the case composition logic is case name, precondition, case nature, step description, and expected result, and each condition combination strategy is: the case name corresponds to the product condition strategy verified in this case, the precondition is the default generation strategy, the case nature is the rule, the reverse verification is the counter-case strategy, and the step description is 1. Default generation, 2. Test condition combination, 3. Default generation, and the expected result is 1. Default generation, 2. Default generation, 3. The positive case shows the post-transaction processing of successful transactions in the transaction information + the post-transaction processing of test conditions; the counter-case shows the post-transaction processing of failed transactions + test conditions.

[0103] Based on the above scheme, this scheme, based on the above information, constructs different testing strategies, conducts a comprehensive analysis of the various business situations of the banking business, and improves the comprehensiveness of the test analysis of various test situations of the banking business. The test cases generated based on this can not only generate test cases required by the banking business in an all-round and multi-angle manner, but also improve the test effect of the test cases.

[0104] This application also provides an example of automatic generation of test cases, such as Figure 5 As shown, the specific processing process includes the following steps:

[0105] Step S501, obtaining business demand information of banking business, business information of banking business, business scenario information of banking business, and modeling demand information.

[0106] Step S502, based on the business requirement information, identifying the business requirement content of each business requirement type of the banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type.

[0107] Step S503, based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identify the association information between each business requirement type and each model type, and based on the association information, identify each business requirement type corresponding to each model type.

[0108] Step S504, based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, construct a sub-test model corresponding to each model type, and use the sub-test models corresponding to all model types as the test model for banking business.

[0109] Step S505 , splitting the banking business information into business data of each business type, and querying each element point data in each business type and the element type to which each element point data belongs through an element point query strategy.

[0110] Step S506, based on the element point data corresponding to each element type, query the model type corresponding to each element type in the model database, and use the element point data of the element point type corresponding to each model type as the test elements of the banking business.

[0111] Step S507, for each test element, based on the element point data of the element point type corresponding to the test element and the business scenario information, through the test analysis strategy, query the attribute information corresponding to the test element in the model type corresponding to the test element.

[0112] Step S508, based on each attribute information, each attribute information is converted into each test condition through a condition conversion strategy, and each test condition is used as each test condition corresponding to the test element.

[0113] Step S509: Classify each test element according to the rule classification strategy to generate a test element group of each rule category.

[0114] Step S510, based on the test element groups of each rule category, a test condition combination strategy is generated, and through the test condition combination strategy, each test condition in the test element groups of each rule category is permuted and combined to obtain each test strategy.

[0115] Step S511 , for each test strategy, based on each test condition included in the test strategy, the case composition logic of the test case is collected.

[0116] Step S512, based on the case composition logic, identify the condition combination strategy of each test condition, and based on the condition combination strategy of each test condition and each test condition, generate a test natural language corresponding to the test strategy through a large language model.

[0117] Step S513, testing the natural language as a test case for banking services.

[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0119] Based on the same inventive concept, the embodiment of the present application also provides a device for automatically generating test cases for implementing the method for automatically generating test cases involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the device for automatically generating one or more test cases provided below can refer to the limitations of the method for automatically generating test cases above, and will not be repeated here.

[0120] In an exemplary embodiment, Figure 6 As shown, a device for automatically generating a test case is provided, comprising: an acquisition module 610, an identification module 620 and a generation module 630, wherein:

[0121] An acquisition module 610 is used to acquire business requirement information of a banking business, business information of the banking business, business scenario information of the banking business, and modeling requirement information, and generate a test model corresponding to a test outline of the banking business based on the business requirement information and the modeling requirement information;

[0122] An identification module 620, configured to identify each test element of the banking business based on the business information of the banking business, and identify each test condition corresponding to each test element through the test model based on each test element and the business scenario information;

[0123] The generation module 630 is used to generate each test strategy of the banking business based on each of the test elements and the test conditions corresponding to each of the test elements, and to generate a test case of the banking business based on each of the test strategies.

[0124] Optionally, the acquisition module 610 is specifically configured to:

[0125] Based on the business requirement information, identifying the business requirement content of each business requirement type of the banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type;

[0126] Based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identifying the association information between each business requirement type and each model type, and based on the association information, identifying each business requirement type corresponding to each model type;

[0127] Based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, a sub-test model corresponding to each model type is constructed, and the sub-test models corresponding to all model types are used as the test model for the banking business.

[0128] Optionally, the identification module 620 is specifically configured to:

[0129] Splitting the banking business information into business data of each business type, and querying each element point data in each business type and the element type to which each element point data belongs through an element point query strategy;

[0130] Based on the element point data corresponding to each element type, the model type corresponding to each element type is queried in the model database, and the element point data of the element point type corresponding to each model type are used as the test elements of the banking business.

[0131] Optionally, the identification module 620 is specifically configured to:

[0132] For each test element, based on each element point data of the element point type corresponding to the test element and the business scenario information, query each attribute information corresponding to the test element in the model type corresponding to the test element through the test analysis strategy;

[0133] Based on each of the attribute information, each of the attribute information is converted into each test condition through a condition conversion strategy, and each of the test conditions is used as each test condition corresponding to the test element.

[0134] Optionally, the generating module 630 is specifically configured to:

[0135] Each of the test elements is classified by a rule classification strategy to generate a test element group of each rule category;

[0136] Based on the test element groups of each rule category, a test condition combination strategy is generated, and through the test condition combination strategy, each test condition in the test element groups of each rule category is arranged and combined to obtain each test strategy.

[0137] Optionally, the generating module 630 is specifically configured to:

[0138] For each test strategy, based on each test condition included in the test strategy, collect the case composition logic of the test case;

[0139] Based on the case composition logic, identify the condition combination strategy of each of the test conditions, and based on the condition combination strategy of each of the test conditions and each of the test conditions, generate a test natural language corresponding to the test strategy through a large language model;

[0140] The test natural language is used as a test case for the banking business.

[0141] Each module in the automatic generation device of the above test cases can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0142] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for automatically generating a test case is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0143] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0144] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the method for automatically generating a test case when executing the computer program.

[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for automatically generating a test case are implemented.

[0146] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the method for automatically generating test cases when executed by a processor.

[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for automatically generating test cases, characterized in that: The method comprises: Acquire business requirement information of a banking business, business information of the banking business, business scenario information of the banking business, and modeling requirement information, and generate a test model corresponding to a test outline of the banking business based on the business requirement information and the modeling requirement information; Based on the business information of the banking business, identifying each test element of the banking business, and based on each test element and the business scenario information, identifying each test condition corresponding to each test element through the test model; Based on each of the test elements and the test conditions corresponding to each of the test elements, each test strategy of the banking business is generated, and based on each of the test strategies, a test case of the banking business is generated.

2. The method according to claim 1, characterized in that The generating a test model corresponding to the test outline of the banking business based on the business requirement information and the modeling requirement information includes: Based on the business requirement information, identifying the business requirement content of each business requirement type of the banking business, and splitting the modeling requirement information of the test model into sub-model requirement information of each model type; Based on the business requirement content of each business requirement type and the sub-model requirement information of each model type, identifying the association information between each business requirement type and each model type, and based on the association information, identifying each business requirement type corresponding to each model type; Based on the business requirement content of each business requirement type corresponding to each model type and the sub-model requirement information corresponding to each model type, a sub-test model corresponding to each model type is constructed, and the sub-test models corresponding to all model types are used as the test model for the banking business.

3. The method according to claim 1, characterized in that The identifying each test element of the banking service based on the business information of the banking service includes: Splitting the banking business information into business data of each business type, and querying each element point data in each business type and the element type to which each element point data belongs through an element point query strategy; Based on the element point data corresponding to each element type, the model type corresponding to each element type is queried in the model database, and the element point data of the element point type corresponding to each model type are used as the test elements of the banking business.

4. The method according to claim 3, characterized in that The step of identifying the test conditions corresponding to each test element through the test model based on the test elements and the business scenario information includes: For each test element, based on each element point data of the element point type corresponding to the test element and the business scenario information, query each attribute information corresponding to the test element in the model type corresponding to the test element through the test analysis strategy; Based on each of the attribute information, each of the attribute information is converted into each test condition through a condition conversion strategy, and each of the test conditions is used as each test condition corresponding to the test element.

5. The method according to claim 1, characterized in that The generating of each test strategy of the banking service based on each test element and the test condition corresponding to each test element includes: Each of the test elements is classified by a rule classification strategy to generate a test element group of each rule category; Based on the test element groups of each rule category, a test condition combination strategy is generated, and through the test condition combination strategy, each test condition in the test element groups of each rule category is arranged and combined to obtain each test strategy.

6. The method according to claim 1, characterized in that Generating the test cases of the banking business based on each of the test strategies includes: For each test strategy, based on each test condition included in the test strategy, collect the case composition logic of the test case; Based on the case composition logic, identify the condition combination strategy of each of the test conditions, and based on the condition combination strategy of each of the test conditions and each of the test conditions, generate a test natural language corresponding to the test strategy through a large language model; The test natural language is used as a test case for the banking business.

7. A device for automatically generating test cases, characterized in that: The device comprises: An acquisition module, used to acquire business requirement information of a banking business, business information of the banking business, business scenario information of the banking business, and modeling requirement information, and generate a test model corresponding to a test outline of the banking business based on the business requirement information and the modeling requirement information; an identification module, configured to identify each test element of the banking business based on the business information of the banking business, and identify each test condition corresponding to each test element through the test model based on each test element and the business scenario information; A generating module is used to generate each test strategy of the banking business based on each test element and the test conditions corresponding to each test element, and to generate a test case of the banking business based on each test strategy.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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