Test case generation method and device, medium and product

By parsing the schema file of financial industry standards, obtaining target field information, comparing differences, and generating test cases, the problem of low efficiency in manually generating test cases is solved, achieving efficient and accurate test case generation.

CN120803930APending Publication Date: 2025-10-17CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510904226.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In existing technologies, when financial institutions change their standards, manually generating test cases is inefficient and cannot quickly and accurately generate test cases that cover various test scenarios.

Method used

By obtaining the schema file of the financial industry's standard specifications, parsing the initial version of the schema file to obtain the target field information, and comparing the differences between the old and new versions of the schema file, test cases are generated.

Benefits of technology

It enables the rapid and accurate generation of test cases, reduces the workload of manual parsing and comparison, improves the efficiency and quality of test case generation, and can cover more test scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803930A_ABST
    Figure CN120803930A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, a medium and a product, and relates to the technical field of automatic testing, and the test case generation method comprises the steps: obtaining a Schema file of a financial industry specification standard for generating a test case; under the condition that the Schema file is a first version Schema file, analyzing the first version Schema file to obtain first target field information; under the condition that the Schema file is a second version Schema file, comparing an old version Schema file with the second version Schema file, determining difference contents, and analyzing the difference contents to obtain first target field information; and generating a test case according to the first target field information. According to the invention, automatic generation of the corresponding test case after the financial industry specification standard is changed is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of automation testing, in particular to a test case generation method, device, medium and product. BACKGROUND

[0002] The financial industry is affected by various factors such as macroeconomic environment, regulatory policy adjustment, market innovation, etc., and the standard needs to be updated continuously to adapt to the new situation. When the standard changes, the financial institution must ensure that its business system can meet the new compliance requirements in a timely manner, and needs to verify the compliance of the system through comprehensive test cases.

[0003] The conventional test case generation is mainly to manually read the standard, write test cases related to the scene according to the definition in the standard and the understanding of the business, and manually construct transaction data to simulate actual transactions according to the content of the test cases. And when the standard changes, the differences between the new and old standards need to be compared field by field manually and the test cases are manually written, which is low in efficiency. SUMMARY

[0004] The main purpose of the present application is to provide a test case generation method, device, medium and product, which aims to solve the technical problem of low efficiency of conventional manual test case generation.

[0005] To achieve the above purpose, the present application provides a test case generation method, which comprises:

[0006] Obtaining a Schema file of a financial industry standard for generating a test case;

[0007] In the case where the Schema file is a first version Schema file, obtaining first target field information by parsing the first version Schema file, wherein the first version Schema file is an initial version Schema file;

[0008] In the case where the Schema file is a second version Schema file, comparing an old version Schema file and the second version Schema file to determine the difference content, and obtaining the first target field information by parsing the difference content, wherein the second version Schema file is a non-initial version Schema file, and the old version Schema file is a previous version Schema file of the second version Schema file;

[0009] Generating a test case according to the first target field information.

[0010] In an embodiment, after the step of obtaining the Schema file of the specification standard for generating the test case, the method further comprises:

[0011] According to the preset verification rule, determining the legality of the first version Schema file or the legality of the second version Schema file;

[0012] In the case where the first version Schema file is legal, performing the step of parsing the first version Schema file to obtain the first target field information;

[0013] In the case where the second version Schema file is legal, performing the step of comparing the old version Schema file and the second version Schema file.

[0014] In an embodiment, the step of comparing the old version Schema file and the second version Schema file to determine the difference content comprises:

[0015] Parses the old version Schema file to obtain a first tree structure, and parses the second version Schema file to obtain a second tree structure;

[0016] Traverses the nodes of the first tree structure and the nodes of the second tree structure, and determines the difference nodes of the first tree structure and the second tree structure;

[0017] According to the difference nodes of the first tree structure and the second tree structure, the difference content is determined.

[0018] In an embodiment, the step of generating the test case according to the first target field information comprises:

[0019] In the case where the type of the first target field information is a basic type, the test case is generated based on the first target field information;

[0020] In the case where the type of the first target field information is a combination type, the test case is generated based on the first target field information and the subfield information of the first target field information.

[0021] In an embodiment, the first target field information includes a boundary value, and the step of generating the test case according to the first target field information further comprises:

[0022] A boundary test case is generated according to the boundary value.

[0023] In an embodiment, the step of generating the test case according to the first target field information comprises:

[0024] obtaining historical test cases, determining second target field information in the historical test cases;

[0025] in a case that the first target field information comprises the second target field information, generating the test case according to the second target field information.

[0026] In an available embodiment, the step of determining the second target field information in the historical test cases comprises:

[0027] obtaining historical field information in the historical test cases;

[0028] determining characteristic information of the historical field information by a preset statistical method;

[0029] determining the second target field information based on the characteristic information.

[0030] In addition, to achieve the above object, the present application further provides a test case generation device, the device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the test case generation method according to any one of the above.

[0031] In addition, to achieve the above object, the present application further provides a storage medium, the storage medium being a computer readable storage medium, and the storage medium storing a computer program, the computer program being executed by a processor to implement the steps of the test case generation method as described above.

[0032] In addition, to achieve the above object, the present application further provides a computer program product, the computer program product comprising a computer program, the computer program being executed by a processor to implement the steps of the test case generation method as described above.

[0033] The one or more technical solutions provided in the application have at least the following technical effects: by acquiring the Schema file of the financial industry standard for generating test cases, in the case that the Schema file is a first version Schema file, the Schema file is an initial version Schema file, the first target field information is obtained by parsing the first version Schema file, the required field information can be quickly and accurately extracted, and the complexity and errors of manual parsing are avoided; in the case that the Schema file is a second version Schema file, the difference content is determined by comparing the old version Schema file and the second version Schema file, and the first target field information is obtained by parsing the difference content, when the Schema file is changed, the difference content of the old version Schema file and the second version Schema file can be determined by comparison, the first target field information is obtained by directly parsing the difference content, the workload of conventional manual comparison is reduced, and the efficiency of finding the difference content is improved, further, the test case is generated according to the first target field information. Various types of test cases are quickly generated to cover various possible test scenarios. Therefore, the application solves the technical problem of low efficiency of conventional manual test case writing by performing difference analysis and parsing on the Schema file of the financial industry standard and generating test cases, and realizes efficient generation of test cases. BRIEF DESCRIPTION OF DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application together with the specification.

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.

[0036] Figure 1 The flowchart provided for the test case generation method embodiment one of the application;

[0037] Figure 2 The flowchart provided for an embodiment of the application;

[0038] Figure 3 The logic diagram for generating test cases provided for an embodiment of the application;

[0039] Figure 4 The module structure diagram of the test case generation device of the embodiment of the application;

[0040] Figure 5Schematic diagram of the device structure of the hardware operating environment involved in the test case generation method in the embodiment of the present application.

[0041] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0042] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0043] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0044] The main solution of the embodiment of the present application is: obtaining a standard Schema file for generating test cases; when the Schema file is a first version Schema file, parsing the first version Schema file to obtain first target field information, wherein the first version Schema file is an initial version of the Schema file; when the Schema file is a second version Schema file, comparing the old version Schema file and the second version Schema file, determining the difference content, parsing the difference content to obtain the first target field information, wherein the second version Schema file is a non-initial version of the Schema file, and the old version Schema file is a previous Schema file version of the second version Schema file; generating a test case based on the first target field information.

[0045] Conventional test cases are inefficient because they are written manually after manually reading the specification standards, analyzing the differences between the new and old version files, and then manually writing test cases based on the definitions in the specification standards and personal understanding of the business.

[0046] The application provides a solution. By obtaining a Schema file of a financial industry standard for generating a test case, in the case that the Schema file is a first version Schema file, the Schema file is an initial version Schema file, and first target field information is obtained by parsing the first version Schema file, the required field information can be quickly and accurately extracted, and the complexity and errors of manual parsing are avoided. In the case that the Schema file is a second version Schema file, the difference content is determined by comparing an old version Schema file and the second version Schema file, and the first target field information is obtained by parsing the difference content. When the Schema file is changed, the difference content of the old version Schema file and the second version Schema file can be determined by comparison, the first target field information is obtained by directly parsing the difference content, the workload of conventional manual comparison is reduced, and the efficiency of finding the difference content is improved. Further, the test case is generated according to the first target field information. Various types of test cases are quickly generated to cover various possible test scenarios. Therefore, by performing difference analysis and parsing on the Schema file of the financial industry standard and generating a test case, the application solves the technical problem of low efficiency of conventional manual test case writing, and realizes efficient generation of test cases.

[0047] It should be noted that the execution subject of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a test case generation device, etc. capable of realizing the above functions. The embodiment and the following embodiments are described below by taking the test case generation device as an example.

[0048] Based on this, the application embodiment provides a test case generation method, which is described below with reference to Figure 1 , Figure 1 The flowchart of the first embodiment of the test case generation method of the application is shown in FIG. 1.

[0049] In the embodiment, the test case generation method includes steps S10-S40:

[0050] In step S10, a Schema file of a financial industry standard for generating a test case is obtained.

[0051] Optionally, the Schema file refers to a specification file defining the structure of a document and data constraints. In this embodiment, it refers to the Schema file corresponding to the specification standard of the financial industry, which is usually formulated by international / national standardization organizations, industry associations or regulatory authorities, and is used to unify data formats, interface specifications and business processes. For example, the Schema file corresponding to ISO 20022 "Financial Services - Universal Financial Industry Message Scheme" is XSD (XML Schema Definition).

[0052] Optionally, the XSD file includes elements and attributes, data types, business rules and group header structures. For example, an element is the most basic component in an XSD file, representing a data item in a document. Taking a cross-border remittance business as an example, <crossborderremittance>is a root element, containing <remitter>(sender), <beneficiary>(Recipient) and <amount> <remitter>comprising <name>and <accountnumber>; attributes are used to provide additional information for elements, which can be <amount>Elemental addition of currency attributes <currency>, to specify the currency type of the remittance amount; XSD data types include simple data types and complex data types, simple data types are used to define basic data values, such as strings, numbers, dates, etc., for example <transactiondate>Use <xs:date>The data type represents the transaction date; the complex data type is used to define a data structure containing multiple elements or attributes, for example, to define a complex data type containing information of the remitter and the payee <remittancedetails>, comprising <remitter> 、 <beneficiary>and <amount>Three elements; business rules in XSD are usually ensured by constraints to guarantee the validity and compliance of data, for example, stipulating that the remittance amount is greater than zero can be done by <xs:restriction>To <xs:decimal>Constraints are placed on the data types, using <xs:mininclusive>Provision <transactionamount>greater than or equal to 0.01, so as to realize the service rule that the remittance amount is greater than zero; the group header structure defines the metadata (such as the sender, the timestamp) of the message or the standard.

[0053] Optionally, the test case includes a title, a precondition, a test step and an expected result. The title mainly describes testing a function; the precondition refers to a condition that needs to be met by the title; the test step mainly describes the operation steps of the case; and the expected result refers to a requirement that meets the expectation (development specification, requirement document, user requirement, etc.).

[0054] In step S20, when the Schema file is a first version Schema file, the first version Schema file is parsed to obtain first target field information, wherein the first version Schema file is an initial version Schema file.

[0055] In an available embodiment, when the obtained Schema file is a first version Schema file, i.e., an initial version file, the file has not been parsed, and there is no repeated parsing process. Therefore, the first version Schema file is directly parsed to obtain first target field information, which is used in the subsequent test case generation process.

[0056] Optionally, parsing refers to converting information in the Schema file into data information that can be used to generate a test case. The parsing process is to extract elements and attributes, data types, business rules and other information in the Schema file, generate a mapping table, associate the mapping table with an internal database table of a financial industry business system, and convert the mapping table into a JSON (JavaScript Object Notation) test data file. The JSON file contains specific information of elements, attributes, data types and business rules parsed from the XSD file, and associated information with the internal database table, and can be used to generate a test case related to financial transactions.

[0057] Optionally, the first target field information refers to specific information of elements, attributes, data types and business rules, and constraint conditions obtained by parsing the first version Schema file, and associated information with the internal database table. For example, the first version Schema file includes a <xs:decimal>Mapped to the first target field information <number>Type, keeping two decimal places.

[0058] In step S30, when the Schema file is a second version Schema file, the old version Schema file and the second version Schema file are compared to determine the difference content, and the first target field information is obtained by parsing the difference content. The second version Schema file is a non-initial version Schema file, and the old version Schema file is a previous version Schema file of the second version Schema file.

[0059] In an available embodiment, when the obtained Schema file is a second version Schema file, the old version Schema file and the second version Schema file are compared to read the version information in the header structure of the two version Schema files to determine whether the version is updated, and the difference is preliminarily determined. Further, the structure and field information of the two version Schema files are compared in detail to determine the difference content, and then the first target field information is obtained by parsing the difference content.

[0060] Optionally, the second version Schema file refers to an upgraded, changed or updated Schema file, which is usually a new version or a revised version published by a standardization organization, and the second version Schema file is a non-initial version Schema file.

[0061] Optionally, the old version Schema file refers to a previous version of the second version Schema file, for example, if the second version is v3.0, the old version may be v2.1.

[0062] In step S40, the test case is generated according to the first target field information.

[0063] In an available embodiment, the parsed JSON file is input into a program, the input and expected output of the test case are determined according to the elements, attributes, business rules and database table association information in the file, the required test data is generated according to the data type and business rules, and the test data and expected results are combined into a test case.

[0064] The embodiment of the application obtains a Schema file of a financial industry standard for generating a test case. When the obtained Schema file is a first version, the Schema file is directly parsed to obtain first target field information. In this way, the required field information can be quickly and accurately extracted. In a traditional manual parsing process, since the Schema file can contain a large amount of complex data types, business rules and element attributes and the like, a parsing personnel needs to spend a lot of time to understand and analyze the file content, and parsing errors are prone to occur. The parsing process of the application is based on a test case generation device, and can quickly parse the file. When the Schema file is a second version Schema file, the application compares the old version Schema file and the second version Schema file to determine the difference content, and parses the difference content to obtain the first target field information. In the actual business development process, the Schema file will be continuously upgraded and updated with the change of business requirements. The traditional manual comparison method needs to manually check the file content of the two versions line by line, which is not only a huge workload, but also easy to miss some subtle differences. The comparison process of the application can quickly and accurately find the difference content between the two versions. Further, the application can generate a corresponding test case for the first version Schema file according to the first field information, or generate a test case for the difference content in the case that the second version Schema file and the old version Schema file have difference content. Compared with the conventional manual test case writing method, the embodiment of the application improves the generation efficiency and quality of the test case, and can more comprehensively cover the functions and business requirements of the system.

[0065] Based on the first embodiment of the application, in the second embodiment of the application, the same or similar contents as the above embodiment one can refer to the above introduction, and the following will not be repeated. On this basis, after step S10, the test case generation method further includes steps S101-S103:

[0066] Step S101, determining the legality of the first version Schema file or the legality of the second version Schema file according to a preset verification rule;

[0067] In a feasible embodiment, after obtaining the first version Schema file and the second version Schema file, it is necessary to determine whether the two files are legal based on pre-set verification rules. The preset verification rules are a series of conditions used to check whether the Schema file meets specific standards and specifications. The file is legal only when it passes the inspection of the preset verification rules, and subsequent parsing or comparison operations can be performed. The preset verification rules may include requirements in terms of file format, field type, constraints, etc. For example, for a Schema file in XSD format, the preset verification rules may require that the definition of all elements follow the XML syntax specification, the attributes of each element conform to the specified data type, required fields cannot be missing, etc., or the account balance field may be a numeric type and the customer name field may be a string type. The account number field is unique, and the customer ID number field conforms to the format requirements of the ID number.

[0068] Step S102: If the first version of the Schema file is valid, the first version of the Schema file is parsed to obtain first target field information.

[0069] In a feasible embodiment, if the first version of the Schema file passes the validity check, it means that the file meets the preset standards and can be parsed.

[0070] Step S103 : When the second version Schema file is valid, a step of comparing the old version Schema file with the second version Schema file is performed.

[0071] In a feasible embodiment, when the second version of the Schema file is determined to be valid, it can be compared with the old version of the Schema file to find the differences between the two versions, providing a basis for subsequent generation of test cases for the file update.

[0072] This embodiment determines the legitimacy of the first and second version Schema files based on preset verification rules. This operation ensures that the files processed subsequently comply with specific standards and specifications. The preset verification rules cover multiple requirements such as file format, field type, and constraints, avoiding errors in subsequent test case generation due to non-standard file structure. Furthermore, the steps that need to be performed when the first version Schema file or the second version Schema file is legal are explained. The parsing and comparison operations are triggered only when the file is legal, otherwise the relevant parsing and comparison operation steps are skipped, which not only reduces the occupation of invalid computing resources, but also avoids misleading results caused by illegal files participating in version difference analysis, thereby improving the execution efficiency and accuracy of the overall test case generation process.

[0073] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as the above embodiment one can be referred to the above description, and the subsequent will not be described in detail. On this basis, see Figure 2 , step S30 compares the old version Schema file and the second version Schema file, and the step of determining the difference content includes steps S301-S303:

[0074] Step S301, the old version Schema file is parsed to obtain a first tree structure, and the second version Schema file is parsed to obtain a second tree structure;

[0075] Optionally, the tree structure is a kind of nonlinear data structure, which is composed of nodes and edges, has hierarchical relationship, has a root node, each root node can have zero or multiple child nodes. Tree structure can represent the nesting relationship of elements in Schema file, each element corresponds to a node, and the nesting relationship between elements is embodied by the relationship between nodes. For example, in the tree structure of the second version Schema file of commodity information after parsing, the root node is <product>, it has four child nodes respectively as <brand> 、 <name> 、 <description>and <stock>Each sub-node can also have corresponding sub-nodes (if any).

[0076] Optionally, the first tree structure refers to a tree structure obtained after parsing the old version Schema file, which shows structural information of the old version Schema file.

[0077] Optionally, the second tree structure refers to a tree structure obtained after parsing the second version Schema file, which shows structural information of the second version Schema file.

[0078] Optionally, the field information in the old version Schema file and the second version Schema file which does not include sub-nodes is compared to check whether there is a difference, ensuring that all information in the Schema file is compared to obtain the difference content.

[0079] Step S302, traversing the nodes of the first tree structure and the nodes of the second tree structure, determining the difference nodes of the first tree structure and the second tree structure;

[0080] In a feasible embodiment, by traversing the nodes of the first tree structure and the second tree structure, the difference nodes between the two are found. The difference nodes represent the parts of the two version Schema files that have changed in structure or content. They are used to accurately determine the difference content of the two version Schema files, and then provide the basis for generating targeted test cases.

[0081] Optionally, the difference node refers to a node with a state difference in the first tree structure and the second tree structure. These differences can be manifested as the addition, deletion of nodes or the change of node attribute values. For example, in the first tree structure of user information, the root node is <user>, two child nodes <name>and <age>; in the second tree structure, the root node is <user>There are three child nodes <name> 、 <age>and <email>. Then the second tree structure in <email>The node does not exist in the first tree structure, so <email>The node is a difference node.

[0082] In step S303, the difference content is determined according to the difference node of the first tree structure and the second tree structure.

[0083] In a possible embodiment, the difference node represents a part of the two version Schema files which has changed in structure or content, and the difference content of the two version Schema files can be described according to the difference node. For example, if there is a newly added node, the difference content can be recorded as "the second version Schema file newly adds a node of <email>"node"; if it is a node attribute modification, the difference content can be recorded as <age>The data type of the node is modified from an integer to a string.

[0084] Optionally, the difference content can be presented in the form of a text report, a table, etc., for the convenience of relevant personnel to view and understand. For example, both a text report and a table are used for presentation. The text report elaborates that the second version of the Schema file adds rules for dynamic assessment of customer risk levels to adapt to market changes, and deletes some outdated business process specifications to improve business efficiency. The table directly displays the clause numbers, clause names, and specific contents of the two versions one by one, and marks the different parts with different colors. Through the text report, personnel can deeply understand the logic behind the adjustment; with the help of the table, the difference content can be quickly located, which is convenient for subsequent work.

[0085] The embodiment clearly shows the nesting relationship of elements in the Schema file by parsing the old version and the second version of the Schema file into tree structures. The subsequent comparison and parsing operations can be based on nodes and the relationship between nodes, reducing the complexity of processing and improving the efficiency and accuracy of data processing. Further, by traversing the nodes of the first tree structure and the second tree structure, the difference nodes and the same nodes can be accurately found. The difference nodes represent the changes in structure or content of the two versions of the Schema file, such as adding, deleting nodes or changing node attribute values, which can accurately locate the difference content without searching for the difference content in a large amount of same information, saving time and effort.

[0086] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as the above-mentioned first embodiment can be referred to the above introduction, and the following will not be repeated. On this basis, the step S40 of generating a test case according to the first target field information includes steps S401-S402:

[0087] Step S401, in the case where the type of the first target field information is a basic type, generating the test case based on the first target field information;

[0088] Optionally, the basic type refers to the most basic data type, which is usually an indivisible data type. For example, <productid>The field is of integer type, and the preset constraint condition requires that the value is at least 1. When generating the test case, only the constraint condition of the field needs to be considered to generate the test case.

[0089] In step S402, in the case where the type of the first target field information is a combination type, a test case is generated based on the first target field information and the subfield information of the first target field information.

[0090] Optionally, the combination type refers to a data type composed of multiple basic types or other combination types, such as an array, a list, a dictionary, an object, and the like. The combination type can represent a more complex data structure, and when generating a test case, the internal subfield information needs to be considered. For example, <productinfo>The field is object type, contains <name>and <color>Two subfields. The constraints of the subfields are considered when generating test cases.

[0091] Optionally, the subfield information refers to information of each subfield included in the combination type, including the name, type, value, constraint condition, etc. of the subfield.

[0092] Optionally, the first target field information includes constraint conditions, and the constraint conditions include boundary values. Figure 3 , Figure 3 A logic diagram for generating test cases for the present application. After starting, the Schema file is first obtained, and then the legality of the Schema file is checked. In the case of legality, the step of associated parsing is performed, and in the case of illegality, the running is ended. Further, in the associated parsing process, it is judged whether the Schema file is repeatedly parsed. In the case of repeated parsing, the unaltered field is deleted before parsing, and in the case of non-repeated parsing, the parsing is directly performed; further, according to the parsed content, the test case is generated, the data is generated based on the test case, and the batch is automatically run, and then the running is ended.

[0093] In another possible embodiment, the first target field information includes boundary values, and according to the first target field information, the step of generating test cases is: generating boundary test cases according to the boundary values.

[0094] Optionally, the constraint conditions in the first target field information include boundary values. The boundary value refers to the boundary condition of the value that a certain field or parameter is allowed to take. It usually includes the minimum value, the maximum value and the value near the boundary. The boundary value is a very important part of the test, because different situations may occur at the boundary than in normal situations. By testing the boundary value, potential problems can be found.

[0095] In a possible embodiment, specific test cases are designed according to the boundary values. Usually, the boundary value itself, the value near the boundary and the value beyond the boundary are considered to test the behavior under the boundary value condition comprehensively.

[0096] Optionally, the boundary test case can include the boundary value itself, the test data near the boundary value and the test data beyond the boundary value when selecting the test data. For example, the requirement of the "user password length" field in the second version of the Schema file has changed. The old version of the Schema file requires the password length to be 6 to 16 bits, and the second version of the Schema file requires it to be 8 to 20 bits. For the above-mentioned "user password length" field, according to the obtained preset boundary values 8 and 20, the boundary test cases are as follows:

[0097] 1) Input the password length of 7 bits, and expect the system to prompt that the password length is too short;

[0098] 2) Input the password length of 8 bits, and expect the system to process normally;

[0099] 3) input password length is 17, expected system to handle normally;

[0100] 4) input password length is 18, expected system to handle normally;

[0101] 5) input password length is 19, expected system to handle normally.

[0102] 6) input password length is 20, expected system to handle normally;

[0103] 7) input password length is 21, expected system to prompt password length too long.

[0104] Optionally, the boundary test case can include test data exceeding the preset boundary value of the old version Schema file but not exceeding the preset boundary value of the second version Schema file when selecting test data. By testing data exceeding the lower limit and upper limit of the old version but within the range of the second version, the adaptation of the system to the new rules during version upgrade can be found. The supplement of boundary values and the test of adjacent boundary values can ensure the stability and accuracy of the system under boundary conditions. The vulnerabilities or abnormalities that may occur when the system processes new rules can be found in time, ensuring the correct execution of the password length rule by the system after version update, and improving the security and reliability of the system.

[0105] The embodiment can comprehensively test the behavior under boundary value conditions by obtaining the boundary values of the difference field information and generating boundary test cases accordingly. Considering the test data of the boundary value itself, adjacent boundary value and exceeding boundary value, potential problems that the system behaves differently at the boundary from normal conditions can be found. For version upgrade, testing data exceeding the preset boundary value of the old version but not exceeding the preset boundary value of the second version can verify the adaptability of the system to the new version specification standard, find vulnerabilities or abnormalities in processing updated data in time, ensure the correct execution of the password length rule by the system after version update, and improve the stability, accuracy, security and reliability of the system.

[0106] The embodiment can precisely adapt to the characteristics of different types of fields by generating test cases in different ways according to whether the field information type is a basic type or a combined type, making the test more targeted. For basic type fields, generating test cases based on the first target field information can ensure the verification of basic rules; for combined type fields, generating test cases in combination with the subfield information of the first target field information can test complex data structures and business rules in depth.

[0107] Based on the first embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as the above embodiment one can refer to the above introduction, and will not be repeated hereinafter. On this basis, the step S40 of generating test cases according to the first target field information includes steps B10-B20:

[0108] Step B10, obtaining historical test cases, determining second target field information in the historical test cases;

[0109] Optionally, the historical test cases refer to a set of test cases used in the past test, recording various data information in the previous test process.

[0110] Optionally, the second target field information refers to the field information selected from the historical test cases, which is important to the current test or actual application scenario and often abnormal in the historical test process.

[0111] Step B20, in the case that the first target field information includes the second target field information, generating test cases according to the second target field information.

[0112] Optionally, when the first field information or the difference field information contains the second target field information, the test cases are generated according to the second target field information first, so that the test cases are more targeted, and the test efficiency and effect are improved.

[0113] Optionally, priority refers to generating test cases according to the second target field information first, and then generating test cases according to other field information. Further, the generated test cases cover various situations of the second target field information.

[0114] In another possible embodiment, the step B10 of obtaining historical test cases and determining second target field information in the historical test cases includes steps C10-C30:

[0115] Step C10, obtaining historical field information in the historical test cases;

[0116] Optionally, the historical field information refers to the specific information of each field contained in the historical test cases, and each field represents a specific attribute of the test data.

[0117] Step C20, determining characteristic information of the historical field information by a preset statistical method;

[0118] Optionally, the preset statistical method is a method for statistical analysis of data, which is set in advance. Common methods include calculating mean, median, standard deviation, frequency, etc. The characteristic information of the historical field information is described from different aspects.

[0119] Optionally, the characteristic information refers to the information reflecting the characteristics of the data obtained by analyzing the historical field information by the preset statistical method, such as the value range, distribution, and central tendency of a certain field.

[0120] Step C30, determining the second target field information based on the feature information.

[0121] In a feasible embodiment, the second target field information is filtered from the historical field information according to the current test requirements and the characteristics of the actual application scenarios based on the feature information.

[0122] Optionally, the following feature information corresponding fields are of great significance to the current test in the test focus of the credit card approval system and the actual application scenarios: the feature information of the credit_score field shows that the value range and distribution have a strong correlation with the approval result. The probability of approval increases significantly for applicants with a higher credit score. Therefore, the credit_score is determined as the target field information. The mean and distribution of the income field also have an important influence on the approval decision. Higher income usually means that the applicant has stronger repayment ability, thereby increasing the possibility of approval. Therefore, the income is also determined as the second target field information.

[0123] The embodiment determines the target field information by presetting a statistical method for the historical field information in the historical test cases, screening in combination with the current test requirements and the actual scenarios, and generates test cases based on the target field information, so that the test focuses on key factors, improves the test efficiency, accurately discovers system problems, and ensures that the system accurately and reliably processes key business logic in actual application.

[0124] The embodiment generates test cases, preferentially generates test cases, or increases the number of corresponding test cases by obtaining historical test data, according to field information that has a higher correlation with the test scenario in the historical test cases, is often abnormal in the historical test process, or is of great significance to the current test, so that the test can more accurately cover key business scenarios, improve the test efficiency and effect, and more accurately discover possible problems in the system.

[0125] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the test case generation method of the present application. More forms of simple changes based on this technical concept are within the protection scope of the present application.

[0126] The present application also provides a test case generation device, which is described in detail in Figure 4 The test case generation device comprises:

[0127] A file acquisition module 10 is configured to acquire a Schema file of a specification standard for generating a test case.

[0128] The file parsing module 20 is configured to parse the first version Schema file to obtain the target field information, when the Schema file is a first version Schema file, wherein the first version Schema file is an initial version Schema file.

[0129] The difference analysis module 30 is configured to compare the old version Schema file and the second version Schema file to determine the difference content, and parse the difference content to obtain the target field information, when the Schema file is a second version Schema file, wherein the second version Schema file is a non-initial version Schema file, and the old version Schema file is a previous version Schema file of the second version Schema file.

[0130] The case execution module 40 is configured to generate a test case according to the target field information.

[0131] The test case generation apparatus provided by the present application adopts the test case generation method in the above embodiments, and can solve the technical problem of test case generation. Compared with the prior art, the test case generation apparatus provided by the present application has the same beneficial effects as the test case generation method provided by the above embodiments, and other technical features in the test case generation apparatus are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0132] The present application provides a test case generation device, which comprises at least one processor and a memory connected with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the test case generation method in the above embodiment one.

[0133] Reference will now be made to the following description Figure 5 , which shows a structural schematic diagram of a test case generation device suitable for implementing the embodiments of the present application. The test case generation device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 5 The test case generation device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0134] As shown in Figure 5 The test case generation device can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory 1002 or loaded from a storage device 1003 into a random access memory 1004. Various programs and data required for the operation of the test case generation device are also stored in the random access memory 1004. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. An input / output interface 1006 is also connected to the bus. Generally, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the test case generation device to communicate with other devices wirelessly or by wire to exchange data. Although the test case generation device with various systems is shown in the figure, it should be understood that all the shown systems are not required to be implemented or possessed. More or less systems can be alternatively implemented or possessed.

[0135] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by a communication device, or installed from the storage device 1003, or installed from the read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0136] The test case generation device provided by the present application adopts the test case generation method in the above-mentioned embodiments, and can solve the technical problem of test case generation. Compared with the prior art, the test case generation device provided by the present application has the same beneficial effects as the test case generation method provided by the above-mentioned embodiments, and other technical features in the test case generation device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0137] It should be understood that portions of the application disclosed can be implemented in hardware, software, firmware, or combinations thereof. In the description of the embodiments above, specific features, structures, materials or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0138] The above description is merely illustrative of the application and is not intended to limit the scope of the application. Any modifications or equivalents of the application should be construed as falling within the scope of the application. The scope of the application should be determined by the appended claims.

[0139] The application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e., a computer program) for performing the test case generation method in the above-described embodiments.

[0140] The computer readable storage medium provided by the application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection having one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optical fiber, a portable compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the embodiments, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any suitable combination thereof.

[0141] The above-described computer readable storage medium can be contained in the test case generation device; or can exist separately and not be assembled into the test case generation device.

[0142] The above-described computer readable storage medium carries one or more programs, which, when executed by the test case generation device, cause the test case generation device to: test case generation.

[0143] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0144] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may

[0145] The modules involved in the embodiments of the present application can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0146] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer program) for executing the test case generation method described above, and can solve the technical problem of test case generation. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the test case generation method provided by the above-mentioned embodiments, which will not be repeated here.

[0147] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the test case generation method as described above.

[0148] The computer program product provided by the application can solve the technical problem of test case generation. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the test case generation method provided by the above-mentioned embodiments, and are not described here.

[0149] The above only describes some embodiments of the application, and does not limit the patent scope of the application. Any equivalent structural transformation, direct / indirect application in other related technical fields, or direct / indirect application in other related technical fields based on the technical concept of the application and the content of the specification and drawings are included in the patent protection scope of the application.< / color> < / name> < / productinfo> < / productid> < / age> < / email> < / email> < / email> < / email> < / age> < / name> < / user> < / age> < / name> < / user> < / stock> < / description> < / name> < / brand> < / product> < / number> < / xs:decimal> < / transactionamount> < / xs:mininclusive> < / xs:decimal> < / xs:restriction> < / amount> < / beneficiary> < / remitter> < / remittancedetails> < / xs:date> < / transactiondate> < / currency> < / amount> < / accountnumber> < / name> < / remitter> ​< / amount> < / beneficiary> < / remitter> < / crossborderremittance>

Claims

1. A test case generation method, characterized in that: The test case generation method includes: Obtain the schema file of the financial industry standard for generating test cases; In a case where the Schema file is a first version Schema file, parsing the first version Schema file to obtain first target field information, wherein the first version Schema file is an initial version Schema file; In a case where the Schema file is a second-version Schema file, comparing the old-version Schema file and the second-version Schema file to determine differences, and parsing the differences to obtain first target field information, wherein the second-version Schema file is a non-initial version Schema file and the old-version Schema file is a previous-version Schema file of the second-version Schema file; Generate a test case based on the first target field information.

2. The test case generation method according to claim 1, wherein: After the step of obtaining a standard Schema file for generating test cases, the method further includes: Determine the validity of the first version of the Schema file or the second version of the Schema file according to a preset verification rule; If the first version Schema file is valid, performing the step of parsing the first version Schema file to obtain first target field information; If the second version of the Schema file is valid, the step of comparing the old version of the Schema file with the second version of the Schema file is performed.

3. The test case generation method according to claim 1, wherein: The step of comparing the old version Schema file and the second version Schema file to determine the differences includes: Parsing the old version Schema file to obtain a first tree structure, and parsing the second version Schema file to obtain a second tree structure; Traversing the nodes of the first tree structure and the nodes of the second tree structure to determine the difference nodes between the first tree structure and the second tree structure; The difference content is determined according to the difference nodes between the first tree structure and the second tree structure.

4. The test case generation method according to claim 1, wherein: The step of generating a test case according to the first target field information includes: In a case where the type of the first target field information is a basic type, generating the test case based on the first target field information; In a case where the type of the first target field information is a combination type, the test case is generated based on the first target field information and sub-field information of the first target field information.

5. The test case generation method according to claim 1, wherein: The first target field information includes a boundary value. The step of generating a test case according to the first target field information further includes: A boundary test case is generated according to the boundary value.

6. The test case generation method according to claim 1, wherein: The step of generating a test case according to the first target field information includes: Acquire historical test cases, and determine second target field information in the historical test cases; In a case where the first target field information includes the second target field information, the test case is preferentially generated according to the second target field information.

7. The test case generation method according to claim 6, wherein: The step of determining the second target field information in the historical test case includes: Obtaining historical field information in the historical test case; Determining characteristic information of the historical field information by a preset statistical method; The second target field information is determined based on the feature information.

8. A test case generating device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the test case generation method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the test case generation method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the test case generation method according to any one of claims 1 to 7 are implemented.