Test data construction method, device, equipment and storage medium
By generating the scene node tree and executing the insert script to construct the test data, the problem of time consumption and incomplete coverage of data import and export in the prior art is solved, the comprehensiveness and accuracy of the test data are improved, and the testing efficiency and product quality are improved.
Patent Information
- Application Number
- CN202411223407.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Existing test data construction methods require the regular export and import of large amounts of data from the production environment, resulting in excessive time resource consumption and may not be able to cover all test cases, especially in new or special scenarios, affecting the accuracy of test results. and reliability.
By obtaining the database and data tables associated with the current business scenario, generating a scene node tree, configuring the field rules of the node, generating insert scripts, and executing scripts to construct test data, ensuring that the data covers all kinds of test scenarios.
It has achieved rapid construction of comprehensive test data, improved testing efficiency and product quality, and reduced missed testing problems caused by incomplete test data.
Smart Images

Figure CN118747158B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer testing technology, and in particular to a test data construction method, device, equipment and storage medium. Background Art
[0002] During the development and launch of software products, it is usually necessary to use test data to test the product to ensure that there will be no quality problems after the product is launched. During the testing process, the test is usually divided according to the business module. Specifically, for each business module, the tester manually constructs the test data required by the current business module based on the field for testing.
[0003] The current test data construction method mainly extracts data from the production environment, then desensitizes the data, and then imports the desensitized data into the test environment for developing and testing software applications. However, although using the live network data in the production environment for testing can ensure that the test environment is as close to the user's actual usage scenario as possible, it is necessary to regularly export data from the production environment and import it into the test environment, and the import and export process of a large amount of data will consume a lot of time resources. In addition, the live network data in the production environment may not completely cover all test cases, especially new test cases or test cases in special scenarios, resulting in the constructed test data may not be comprehensive enough to meet the test requirements of the test scenario, affecting the accuracy and reliability of the test results. Summary of the invention
[0004] The present invention provides a test data construction method, device, equipment and storage medium, aiming to solve at least one of the above technical problems.
[0005] The present invention provides a test data construction method, comprising:
[0006] Get the database and data table associated with the current business scenario;
[0007] Based on each of the data tables, a scene node tree of the current business scenario is generated, wherein each node in the scene node tree except the root node is configured with an associated data table and a customized field rule for each field in the data table;
[0008] Based on the field rules of each node in the scene node tree, generating an insertion script for each node;
[0009] Execute the insertion script of each node to obtain the test data of the current business scenario.
[0010] Optionally, according to a test data construction method provided by the present invention, the configuration of the field rule includes one or more of a joint primary key, a field with the same source as the parent, an inter-field data rule, a data range, and a data type:
[0011] The joint primary key refers to combining multiple fields in a data table as a unique identifier for the data;
[0012] The parent homology field refers to a field selected during the node configuration process with the same value as the current node and its parent node, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node.
[0013] Optionally, according to a test data construction method provided by the present invention, generating an insertion script for each node based on a field rule of each node in the scene node tree includes:
[0014] Generate SQL insert statements according to the field rules corresponding to each field in any node and the preset data volume;
[0015] The SQL insert statement of each of the nodes is stored in the insert script.
[0016] Optionally, according to a test data construction method provided by the present invention, executing the insertion script of each node to obtain the test data of the current business scenario includes:
[0017] The insertion script corresponding to each node in the scene node tree is executed in the order of node hierarchy from top to bottom and from left to right to obtain the test data of the current business scenario, and the test data is inserted into the corresponding database.
[0018] Optionally, according to a test data construction method provided by the present invention, generating a scenario node tree of the current business scenario based on each of the data tables includes:
[0019] Creating a scene node tree for the current business scene based on the dependency relationship between the data tables;
[0020] Among them, the data tables without dependencies in the scene node tree are displayed in the upper nodes, and the data tables with dependencies are displayed in the lower nodes.
[0021] Optionally, according to a test data construction method provided by the present invention, after obtaining the database and the data table in the database associated with the current business scenario, the method further includes:
[0022] According to the preset data table configuration information, determine whether the current user has the database operation authority;
[0023] If there is no operation permission, it will prompt that the current user does not have the operation permission;
[0024] If there is operation permission, the step of generating a scene node tree of the current business scene based on each of the data tables is performed.
[0025] The present invention also provides a test data construction device, comprising:
[0026] The acquisition module is used to obtain the database and data tables in the database associated with the current business scenario;
[0027] A first generating module is used to generate a scene node tree of the current business scene based on each of the data tables, wherein each node in the scene node tree except the root node is configured with an associated data table and a customized field rule for each field in the data table;
[0028] A second generating module, used for generating an insertion script for each node in the scene node tree based on the field rule of each node;
[0029] The execution module is used to execute the insertion script of each node to obtain the test data of the current business scenario.
[0030] Optionally, according to a test data construction device provided by the present invention, the configuration of the field rule includes one or more of a joint primary key, a field with the same source as a parent, an inter-field data rule, a data range, and a data type:
[0031] The joint primary key refers to combining multiple fields in a data table as a unique identifier for the data;
[0032] The parent homology field refers to a field selected during the node configuration process with the same value as the current node and its parent node, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node.
[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the test data construction methods described above is implemented.
[0034] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the test data construction method described in any one of the above is implemented.
[0035] The test data construction method, device, equipment and storage medium provided by the present invention include: obtaining a database and a data table in the database associated with the current business scenario; generating a scene node tree of the current business scenario based on each of the data tables, wherein each node in the scene node tree except the root node is configured with an associated data table and a field rule customized for each field in the data table; generating an insertion script for each of the nodes based on the field rule of each node in the scene node tree; executing the insertion script of each of the nodes to obtain the test data of the current business scenario. For any business scenario, the present invention combs and configures the tables involved in the business scenario, constructs a scene node tree of the current business scenario, and each node of the scene node tree is configured with an associated data table and a field rule customized for each field in the data table. In combination with the customized field rules, testers or developers can quickly construct test data, improve the efficiency of test execution or development self-testing by testers, reduce missed tests caused by incomplete test data, and improve product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a flowchart of the test data construction method provided by the present invention;
[0038] Figure 2 is a structural diagram of a scene node tree provided by an embodiment of the present invention;
[0039] Figure 3 It is a structural schematic diagram of the test data construction device provided by the present invention;
[0040] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0043] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when...".
[0044] Figure 1 FIG. 1 is a flow chart of the test data construction method provided by the present invention. Figure 1 As shown, the test data construction method includes:
[0045] Step S11, obtaining a database and a data table in the database associated with the current business scenario;
[0046] It should be noted that you need to configure the data source first. The data source configuration information includes the custom data source name, configuration address, host, login user name, login password, configuration port, database name, etc. And make sure you have the operation permission for the configured data source. The data source type can be a relational database, such as the connection information of Mysql, SQL Server, Oracle, etc.
[0047] It should be noted that the selection of data sources, testers or developers rely on their clear understanding of business logic-related data, and the databases and tables in the databases related to the current business scenario. In addition, in order to improve data security, sensitive information such as database usernames and passwords in the configuration must be encrypted for transmission.
[0048] Step S12, generating a scene node tree of the current business scene based on each of the data tables;
[0049] It should be noted that, except for the root node, each node in the scene node tree is configured with an associated data table and customized field rules for each field in the data table, that is, except for the top-level root node, which is not configured with a data table, other nodes can be configured with 1, 2, or more than 2 data tables, and the tree can have multiple levels. Regarding the tree level, except for the vertex, the data tables without dependencies are displayed in the upper nodes, and the dependent data tables are displayed in the lower nodes, which helps to maintain data consistency and reference integrity, and also makes the database structure clearer.
[0050] It should be noted that the configuration of field rules includes information configuration such as joint primary key, parent homology field, data rules between fields, data range and data type: Among them, the joint primary key refers to combining multiple fields in the data table as a unique identifier of the data. For example, there is a data table that stores phone recharge orders. This table may contain the following fields: ID (order ID), UserID (user ID), Time (recharge time), Echarge amount (recharge amount). Although the ID can be used as the primary key to ensure the uniqueness of each recharge order, if the ID is deleted or updated, then the specific recharge order cannot be accurately identified. In order to avoid this problem, a combination of fields such as UserID (user ID), Time (recharge time), and Echarge amount (recharge amount) can be used as a joint primary key to identify the recharge order.
[0051] In addition, the field with the same origin as the parent refers to selecting the field with the same value as the current node and its parent node during the node configuration process, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node. It can be understood that the parent node and its child node in the scene have the same data values in some fields. Therefore, it is necessary to select the field with the same value as the current node and its parent node in the node configuration. When the child node generates test data, if there is a field with the same origin as the parent, directly copy the value of the corresponding field of the parent node without regenerating data.
[0052] In addition, for data range and data type: you can customize fixed value, fixed single-choice value, time type, UUID type, digital type, etc. The time type formats include "yyyy-mm-dd HH:mm:ss", "yyyy-mm-dd", "yyyy-mm", "15-digit timestamp", etc. These basic data have corresponding implementations in programming languages such as Python. Among them, UUID (Universally Unique Identifier) is a standardized unique identifier in industry cognition. Among them, the timestamp in the time type is also a way to construct unique data. The timestamp usually refers to the number of seconds since January 1, 1970 (UTC time). For digital type, set the digital range and step size by default 1.
[0053] For inter-field data rules: For example, the value of the field name of the current node can be a combination of the fields firstname and lastname of its parent node; it can be a partial interception of the parent node field, such as the field ID can be the first 6 digits of the parent node field ID (such as the Chinese Resident Identity Card). Specific rules are set according to actual conditions.
[0054] Specifically, according to the dependency relationship between the data tables, a scene node tree of the current business scenario is created, which can be referred to as Figure 2 , Figure 2 This is a structural diagram of a scene node tree provided by an embodiment of the present invention. Thus, test data can be constructed according to customized rules to construct more comprehensive test data to cover more test cases. In addition, each node in the scene node tree can be customized to delete or add child nodes.
[0055] In addition, in one embodiment of the present invention, before the user operates the data, it is determined whether the current user has the operation permission of the database according to the preset data table configuration information; if there is no operation permission, it is prompted that the current user does not have the operation permission; if there is operation permission, the step of generating the scene node tree of the current business scenario based on each of the data tables is executed.
[0056] Step S13, generating an insertion script for each node in the scene node tree based on the field rules of each node;
[0057] Specifically, according to the field rules corresponding to each field in any node and the preset data volume, an insert statement is generated, wherein the insert statement refers to an SQL statement for inserting data into the database; and then the SQL insert statement of each node is stored in the insert script.
[0058] Step S14, executing the insertion script of each node to obtain the test data of the current business scenario.
[0059] Specifically, the insertion script corresponding to each node in the scene node tree is executed in a top-down and left-to-right order according to the node hierarchy, the test data of the current business scenario is obtained, and the test data is inserted into the corresponding database. In other embodiments, the number of test data expected to be constructed can be set to generate test data that meets the number.
[0060] The embodiment of the present invention, through the above scheme, includes: obtaining the database and the data table in the database associated with the current business scenario; generating a scene node tree of the current business scenario based on each of the data tables, wherein each node in the scene node tree except the root node is configured with an associated data table and a field rule customized for each field in the data table; generating an insertion script for each of the nodes based on the field rule of each node in the scene node tree; executing the insertion script of each of the nodes to obtain the test data of the current business scenario. The embodiment of the present invention constructs a scene node tree of the current business scenario by combing and configuring the tables involved in the business scenario for a business scenario, and each node of the scene node tree is configured with an associated data table and a field rule customized for each field in the data table. In combination with the customized field rules, testers or developers can quickly build test data, improve the efficiency of test execution or development self-testing by testers, reduce missed tests caused by incomplete test data, and improve product quality.
[0061] In one embodiment of the present invention, based on the field rules of each node in the scene node tree, generating an insertion script for each node includes:
[0062] Generate SQL insert statements according to the field rules corresponding to each field in any node and the preset data volume; store the SQL insert statements of each node in the insert script.
[0063] Specifically, it is necessary to understand in detail the field rules defined for each node, including the data type of the field, whether null values are allowed, default values, dependencies between fields, etc., and analyze the relationship between nodes in the node tree. Based on the above information, write an INSERT statement for each node (that is, the SQL insert statement in this embodiment). For each field, it is necessary to provide a corresponding value according to the field rule. Optionally, if the field is calculated or has a default value, it can also be reflected in the statement. In addition, if there is a recursive relationship in the node tree, such as a node can have multiple parent nodes, then this relationship needs to be specially handled to ensure that no circular dependency is caused when inserting data. Thereby, an SQL insert statement for each of the nodes is generated. Then the SQL insert statement for each of the nodes is stored in the insert script.
[0064] In one embodiment of the present invention, executing the insertion script of each node to obtain the test data of the current business scenario includes:
[0065] The insertion script corresponding to each node in the scene node tree is executed in the order of node hierarchy from top to bottom and from left to right to obtain the test data of the current business scenario, and the test data is inserted into the corresponding database.
[0066] It should be noted that in most business scenarios, the relationship between data is organized according to a certain hierarchical structure. The top-down execution order reflects this hierarchical structure, ensuring that the generation and insertion of data are carried out in accordance with business rules and processes. In complex business scenarios, the generation of certain data may depend on previously generated data. The top-down, left-to-right execution order helps to ensure that all dependent data has been correctly generated before being inserted into the database. Therefore, in this embodiment, the insertion script corresponding to each node in the scene node tree is executed in a top-down, left-to-right order of the node hierarchy to obtain the test data of the current business scenario, and the test data is inserted into the corresponding database.
[0067] The test data construction device provided by the present invention is described below. The test data construction device described below and the test data construction method described above can be referenced to each other.
[0068] Figure 3 is a schematic diagram of the structure of the test data construction device provided by the present invention, such as Figure 3 As shown, a test data construction device according to an embodiment of the present invention includes:
[0069] An acquisition module 21 is used to acquire a database and a data table in the database associated with the current business scenario;
[0070] A first generating module 22 is used to generate a scene node tree of the current business scene based on each of the data tables, wherein each node in the scene node tree except the root node is configured with an associated data table and a customized field rule for each field in the data table;
[0071] A second generating module 23, for generating an insertion script for each node in the scene node tree based on the field rule of each node;
[0072] The execution module 24 is used to execute the insertion script of each node to obtain the test data of the current business scenario.
[0073] The test data construction device also includes:
[0074] The configuration of the field rule includes one or more of a joint primary key, a field with the same source as the parent, a data rule between fields, a data range, and a data type:
[0075] The joint primary key refers to combining multiple fields in a data table as a unique identifier for the data;
[0076] The parent homology field refers to a field selected during the node configuration process with the same value as the current node and its parent node, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node.
[0077] The second generating module 23 is also used for:
[0078] Generate SQL insert statements according to the field rules corresponding to each field in any node and the preset data volume;
[0079] The SQL insert statement of each of the nodes is stored in the insert script.
[0080] The execution module 24 is also used for:
[0081] The insertion script corresponding to each node in the scene node tree is executed in the order of node hierarchy from top to bottom and from left to right to obtain the test data of the current business scenario, and the test data is inserted into the corresponding database.
[0082] The first generating module 22 is also used for:
[0083] Creating a scene node tree for the current business scene based on the dependency relationship between the data tables;
[0084] Among them, the data tables without dependencies in the scene node tree are displayed in the upper nodes, and the data tables with dependencies are displayed in the lower nodes.
[0085] The test data construction device also includes:
[0086] According to the preset data table configuration information, determine whether the current user has the database operation authority;
[0087] If there is no operation permission, it will prompt that the current user does not have the operation permission;
[0088] If there is operation permission, the step of generating a scene node tree of the current business scene based on each of the data tables is performed.
[0089] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0090] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 310, a memory 320, a communications interface 330 and a communications bus 340, wherein the processor 310, the memory 320 and the communications interface 330 communicate with each other through the communications bus 340. The processor 310 may call the logic instructions in the memory 320 to execute the test data construction method, which includes: obtaining a database and a data table in the database associated with the current business scenario; based on each of the data tables, generating a scene node tree of the current business scenario, wherein each node in the scene node tree except the root node is configured with an associated data table and a field rule customized for each field in the data table; based on the field rules of each node in the scene node tree, generating an insertion script for each of the nodes; executing the insertion script for each of the nodes to obtain the test data of the current business scenario.
[0091] In addition, the logic instructions in the above-mentioned memory 320 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0092] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the test data construction method provided by the above methods.
[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A test data construction method, characterized in that: include: Get the database and data table associated with the current business scenario; Based on each of the data tables, a scene node tree of the current business scenario is generated, wherein each node in the scene node tree except the root node is configured with an associated data table and a customized field rule for each field in the data table; each node in the scene node tree is customized to delete or add child nodes; Based on the field rules of each node in the scene node tree, generating an insertion script for each node; Execute the insertion script of each node to obtain test data of the current business scenario; The configuration of the field rule includes one or more of a joint primary key, a field with the same source as the parent, a data rule between fields, a data range, and a data type: The joint primary key refers to combining multiple fields in a data table as a unique identifier for the data; The field with the same origin as the parent refers to selecting a field with the same value as the current node and its parent node during the node configuration process, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node; when the current node generates test data, if there is a field with the same origin as the parent, the value of the corresponding field of the parent node is directly copied without regenerating data; The step of generating an insertion script for each node based on the field rule of each node in the scene node tree comprises: Generate SQL insert statements according to the field rules corresponding to each field in any node and the preset data volume, where the field rules include the data type of the field, whether null values are allowed, default values, and dependencies between fields; Storing the SQL insert statement of each node in the insert script; The executing the insertion script of each node to obtain the test data of the current business scenario includes: Execute the insertion script corresponding to each node in the scene node tree in the order of node hierarchy from top to bottom and from left to right, obtain the test data of the current business scenario, and insert the test data into the corresponding database; The step of generating a scene node tree of the current business scene based on each of the data tables includes: Creating a scene node tree for the current business scene based on the dependency relationship between the data tables; Wherein, the data table without dependency in the scene node tree is displayed in the upper node, and the data table with dependency is displayed in the lower node; After obtaining the database and the data table in the database associated with the current business scenario, the method further includes: According to the preset data table configuration information, determine whether the current user has the database operation authority; If there is no operation permission, it will prompt that the current user does not have the operation permission; If there is operation permission, the step of generating a scene node tree of the current business scene based on each of the data tables is performed.
2. A test data construction device, characterized in that: include: The acquisition module is used to obtain the database and data tables in the database associated with the current business scenario; A first generating module is used to generate a scene node tree of the current business scenario based on each of the data tables, wherein each node in the scene node tree except the root node is configured with an associated data table and a field rule customized for each field in the data table; each node in the scene node tree is customized to delete or add child nodes; A second generating module, used for generating an insertion script for each node in the scene node tree based on the field rule of each node; An execution module, used to execute the insertion script of each node to obtain the test data of the current business scenario; The configuration of the field rule includes one or more of a joint primary key, a field with the same source as the parent, a data rule between fields, a data range, and a data type: The joint primary key refers to combining multiple fields in a data table as a unique identifier for the data; The field with the same origin as the parent refers to selecting a field with the same value as the current node and its parent node during the node configuration process, wherein the value of the corresponding field in the current node is the same as the value of the corresponding field in its parent node; when the current node generates test data, if there is a field with the same origin as the parent, the value of the corresponding field of the parent node is directly copied without regenerating data; The step of generating an insertion script for each node based on the field rule of each node in the scene node tree comprises: Generate SQL insert statements according to the field rules corresponding to each field in any node and the preset data volume, where the field rules include the data type of the field, whether null values are allowed, default values, and dependencies between fields; Storing the SQL insert statement of each node in the insert script; The executing the insertion script of each node to obtain the test data of the current business scenario includes: Execute the insertion script corresponding to each node in the scene node tree in the order of node hierarchy from top to bottom and from left to right, obtain the test data of the current business scenario, and insert the test data into the corresponding database; The step of generating a scene node tree of the current business scene based on each of the data tables includes: Creating a scene node tree for the current business scene based on the dependency relationship between the data tables; Wherein, the data table without dependency in the scene node tree is displayed in the upper node, and the data table with dependency is displayed in the lower node; After obtaining the database and the data table in the database associated with the current business scenario, the method further includes: According to the preset data table configuration information, determine whether the current user has the database operation authority; If there is no operation permission, it will prompt that the current user does not have the operation permission; If there is operation permission, the step of generating a scene node tree of the current business scene based on each of the data tables is performed.
3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the test data construction method as claimed in claim 1 is implemented.
4. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the test data construction method as claimed in claim 1 is implemented.
Citation Information
Patent Citations
Test data generation method and device, computer equipment and readable storage medium
CN109815252A
Test data generation method and device
CN111382083A
Association table test data generation method and device, equipment and medium
CN112685288A
Test data construction method and device, equipment and medium
CN113051178A
Method and device for acquiring test data, equipment and medium
CN115048285A