Test data set generation method and device, computer equipment and storage medium

By obtaining user needs, selecting the basis set of the target industry and using pre-stored operation statements to create test library tables, the problem of time-consuming and labor-intensive test data generation is solved, and efficient and accurate test data generation is achieved.

CN120705143APending Publication Date: 2025-09-26BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410346061.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the existing technology, the test data generation process is time-consuming and has a high threshold, requiring testers to spend a lot of time and energy to prepare test basis sets and build library tables.

Method used

By obtaining user needs, selecting the basis set of the target industry, obtaining the attribute information of the library table from the pre-built industry test basis set, using pre-stored operation statements to create the test library table, and generating a test data set based on the attribute information of the library table and writing it directly into the test library table.

Benefits of technology

It lowers the threshold for test data generation, improves generation efficiency and accuracy, and saves time and human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705143A_ABST
    Figure CN120705143A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of testing, in particular to a test data set generation method and device, computer equipment and a storage medium. According to the method, after a user demand is obtained, a basis set corresponding to a target industry provided by the user demand is selected from an industry test basis set, and attribute information of a library table is obtained from the basis set; the process avoids the process that testers consume a large amount of time and energy to collect the test basis, and time is saved; after the corresponding basis set is selected, the test threshold is reduced by obtaining the library table creation statements from the pre-stored operation statement set; creating a test library table according to the attribute information of the library table and the library table creation statement, and automatically generating a test data set according to the attribute information of the library table; and finally, writing the test data set into the test library table. According to the embodiment, generation of the test data is completed in the mode, the test threshold is lowered, and the efficiency and accuracy of test data generation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and in particular to a method, apparatus, computer equipment, and storage medium for generating a test data set. Background Art

[0002] In the field of project development, testing is a very important link. It can help project engineers find defects in the project to ensure that the project can be delivered with high quality.

[0003] The test data required for current project testing is automatically generated by the database. Before generating test data, testers must not only prepare a test basis set in advance but also build a database table to store the test data. Because preparing the test basis set is time-consuming and building the database table requires testers to have advanced scripting skills, generating test data is time-consuming and has a high barrier to entry. Summary of the Invention

[0004] In order to solve the above technical problems, the present disclosure provides a method, apparatus, computer device and storage medium for generating a test data set.

[0005] In a first aspect, the present invention provides a method for generating a test data set, the method comprising:

[0006] Obtain user requirements, which include the target industry to which the project to be tested belongs; based on the target industry, select a basis set for the target industry from a pre-built industry test basis set, where the basis set includes attribute information of the library table; obtain a library table creation statement set from a pre-stored operation statement set; create a test library table based on the attribute information of the library table and the library table creation statement, and generate a test data set based on the attribute information of the library table; and write the test data set into the test library table.

[0007] The method for generating a test data set provided in this embodiment, after obtaining user needs, selects a basis set corresponding to the target industry provided by the user needs from the industry test basis set, and obtains the attribute information of the library table from the basis set. This process avoids the tester from spending a lot of time and energy on collecting test basis, saving time; after selecting the corresponding basis set, the test threshold is lowered by obtaining the library table creation statement from the pre-stored operation statement set; then, a test library table is created according to the attribute information of the library table and the library table creation statement, and a test data set is automatically generated according to the attribute information of the library table; finally, the test data set is written into the test library table; this embodiment completes the generation of test data in the above manner, lowers the test threshold, and improves the efficiency and accuracy of test data generation.

[0008] In an optional implementation, the process of constructing the industry test basis set includes:

[0009] Obtain the corresponding standards and specifications for each industry; extract the test basis corresponding to each industry from the standards and specifications; and form an industry test basis set based on the test basis corresponding to each industry.

[0010] In an optional implementation, creating a test library table based on the attribute information of the library table and the library table creation statement includes:

[0011] Write the attribute information of the library table into the library table creation statement; run the library table creation statement after writing the attribute information of the library table to complete the creation of the test library table.

[0012] In an optional implementation, the attribute information of the library table includes the name of the test library table, the attribute fields included in the test library table, the data type corresponding to each attribute field, the constraint condition corresponding to each attribute field, and the random factor.

[0013] In an optional embodiment, generating a test data set based on the attribute information of the library table includes:

[0014] According to the data type, constraints and random factors, test data corresponding to each attribute field are automatically generated; the test data set is formed by the test data corresponding to each attribute field.

[0015] In an optional embodiment, after writing the test data set into the test library table, the method further includes:

[0016] Obtain management requirements; based on the management requirements, generate target operation statements corresponding to the management requirements; and manage test data in the test library table based on the target operation statements.

[0017] In an optional implementation, the management requirement includes a management operation and an operation object. Based on the management requirement, generating a target operation statement corresponding to the management requirement includes:

[0018] An operation statement corresponding to the management operation is obtained from the operation statement set; an operation object is written into the operation statement to generate a target operation statement.

[0019] In a second aspect, the present invention provides a device for generating a test data set, the device comprising:

[0020] The first acquisition module is used to obtain user requirements, which include the target industry to which the project to be tested belongs; the selection module is used to select the basis set of the target industry from the pre-built industry test basis set based on the target industry, and the basis set includes the attribute information of the library table; the second acquisition module is used to obtain the library table creation statement set from the pre-stored operation statement set; the creation module is used to create a test library table based on the attribute information of the library table and the library table creation statement, and generate a test data set based on the attribute information of the library table; the input module is used to write the test data set into the test library table.

[0021] In a third aspect, the present invention provides a computer device, comprising:

[0022] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for generating a test data set of any embodiment of the first aspect by executing the computer instructions.

[0023] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for generating a test data set according to any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 A schematic diagram of a flow chart of a method for generating a test data set provided in one embodiment of the present invention;

[0027] Figure 2 A schematic diagram of a flow chart of a method for generating a test data set provided in another embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a flow chart of a method for generating a test data set according to another embodiment of the present invention;

[0029] Figure 4 A schematic diagram of the structure of a device for generating a test data set provided by an embodiment of the present invention;

[0030] Figure 5A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0032] The following description sets forth many specific details to facilitate a full understanding of the present disclosure. However, the present disclosure may also be implemented in other ways than those described herein. It is apparent that the embodiments described in the specification are only some of the embodiments of the present disclosure, not all of them. All other embodiments derived by those skilled in the art based on the embodiments of the present disclosure without inventive effort are also within the scope of protection of the present disclosure.

[0033] According to an embodiment of the present invention, an embodiment of a method for generating a test data set is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] In this embodiment, a method for generating a test data set is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. (the execution subject is described in combination with actual conditions). Figure 1 is a flow chart of a method for generating a test data set according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:

[0035] Step S101: obtaining user requirements, which include the target industry to which the project to be tested belongs.

[0036] Specifically, user requirements are the requirements put forward by the tester for test data based on the project to be tested. User requirements can be content directly input by the user, or a combination of key information extracted from the user input content. User requirements include the industry to which the project to be tested belongs, and can also include the database specified by the tester based on the data characteristics of the required test data, the data volume of the required test data, the library table information specified by the tester in combination with the test purpose, the attribute fields specified in the library table information, and the random factors specified by the tester based on the common data characteristics of the target industry. This embodiment does not specifically limit the content of the requirements contained in the user requirements, and those skilled in the art can set them according to actual conditions.

[0037] For example, in an optional embodiment, after receiving user input for "Generate 1,000 pieces of medical information for gynecological patients in a MySQL database, where the ratio of adolescent women to middle-aged women is 4:6," the system identifies and extracts keywords from this text, thereby obtaining a user requirement. The user requirement includes: medical, MySQL, medical information, 1,000 pieces, and a ratio of 4:6. That is, in this embodiment, the user requirement specifies the target industry as medical, the designated database as MySQL, the designated table as the medical information table, the designated data volume as 1,000, and the random factor as the ratio of adolescent women to middle-aged women of 4:6. In this embodiment, the keyword identification method is not specifically limited, and those skilled in the art may complete the identification process using any feasible method, such as using a neural network model.

[0038] Step S102 : Based on the target industry, a basis set of the target industry is selected from the pre-built industry test basis set, where the basis set includes attribute information of the library table.

[0039] Specifically, after obtaining the target industry of the project to be tested from user requirements, a reference set corresponding to the target industry is selected from the industry test reference set, and the attribute information of the library tables that meet the user requirements is obtained from this reference set. The industry test reference set includes test reference sets corresponding to each industry, and the test reference set includes test references commonly used during the testing process of projects in that industry, such as test objectives, test methods, and attribute information of the library tables required for testing.

[0040] For example, the attribute information of a library table includes the name of the test library table, the attribute fields contained in the test library table, the data type corresponding to each attribute field, the constraints corresponding to each attribute field, and the random factor. The constraints corresponding to the attribute fields, such as the constraint for age, are between 0 and 150. The random factor corresponding to the attribute field can be the probability of the data corresponding to the attribute field being empty or the ratio of each type of data in the attribute field. The setting of the random factor corresponds to the attribute characteristics of the attribute field and is not specifically limited in this embodiment.

[0041] Exemplarily, the process of constructing an industry test basis set includes:

[0042] Obtain the corresponding standards and specifications for each industry; extract the test basis corresponding to each industry from the standards and specifications; and form an industry test basis set based on the test basis corresponding to each industry.

[0043] For example, artificial intelligence can be used to obtain the corresponding standards and specifications for each industry (i.e., industry standards and / or industry standards and / or national standards), perform keyword recognition and extraction on all standards and specifications, obtain test basis, divide the test basis according to industry category, and after the division, form an industry test basis set based on the test basis corresponding to each industry. The method of obtaining standards and specifications in this embodiment includes but is not limited to crawler technology.

[0044] Step S103: Acquire a library table creation statement set from a pre-stored operation statement set.

[0045] Specifically, the operation statement set includes operation statements corresponding to at least one database, including statements for creating database tables and updating data. When a user specifies a database, the corresponding database table creation statements are selected from the operation statement set. If no database is specified, the corresponding database table creation statements are retrieved from the system default database.

[0046] Step S104 : creating a test library table based on the attribute information of the library table and the library table creation statement, and generating a test data set based on the attribute information of the library table.

[0047] Specifically, a target creation statement is formed based on the library table's attribute information and the library table creation statement. A test library table is then created based on the target creation statement. Simultaneously, a test dataset that meets user requirements is automatically generated based on the library table's attribute information. The library table's attribute information includes the attribute information of one or more library tables, so the resulting test library table may contain one or more. If multiple test library tables are constructed, they are linked together using the same attribute fields.

[0048] Step S105: Write the test data set into the test library table.

[0049] Specifically, when the attribute information of the library table contains attribute information corresponding to multiple library tables, each group of test data in the test data set is written into the test library table to which the group of test data belongs.

[0050] The method for generating a test data set provided in this embodiment, after obtaining user needs, selects a basis set corresponding to the target industry provided by the user needs from the industry test basis set, and obtains the attribute information of the library table from the basis set. This process avoids the tester from spending a lot of time and energy on collecting test basis, saving time; after selecting the corresponding basis set, the test threshold is lowered by obtaining the library table creation statement from the pre-stored operation statement set; then, a test library table is created according to the attribute information of the library table and the library table creation statement, and a test data set is automatically generated according to the attribute information of the library table; finally, the test data set is written into the test library table; this embodiment completes the generation of test data in the above manner, lowers the test threshold, and improves the efficiency and accuracy of test data generation.

[0051] In this embodiment, a method for generating a test data set is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of a method for generating a test data set according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:

[0052] Step S201: Obtain user requirements, including the target industry to which the project to be tested belongs. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0053] Step S202: Based on the target industry, select the target industry's basis set from the pre-built industry test basis set, and the basis set includes the attribute information of the library table. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0054] Step S203: Obtain a library table creation statement set from a pre-stored operation statement set. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0055] Step S204 : creating a test library table based on the attribute information of the library table and the library table creation statement, and generating a test data set based on the attribute information of the library table.

[0056] Specifically, the above step S204 includes:

[0057] Step S2041: Write the attribute information of the library table into the library table creation statement.

[0058] Specifically, the content in the attribute information is written to the corresponding location in the library table creation statement to be edited. The library table creation statement contains content to be edited, including but not limited to the library table name to be defined, the attribute field to be inserted, the data type of the attribute field, etc. The content in the attribute information is updated to the corresponding location in the library table creation statement to be edited.

[0059] For example, in this embodiment, the attribute information of the library table includes: the name of the test library table is student, and the attribute fields id, name, and age contained in the test library table. Among them, the data type corresponding to id is INT, the data type corresponding to name is VARCHAR(50), and the data type corresponding to age is INT. The library table creation statement is as follows:

[0060] CREATE TABLE tablename {

[0061] Column name 1 Data type PRIMARY KEY,

[0062] Column name 2 data type,

[0063] Column name 3 data type,

[0064] };

[0065] After writing the attribute information of the library table into the library table creation statement, we get:

[0066] CREATE TABLE student{

[0067] id INT PRIMARY KEY,

[0068] name VARCHAR(50),

[0069] age INT,

[0070] };

[0071] Step S2042: Run the library table creation statement after writing the attribute information of the library table to complete the creation of the test library table.

[0072] Specifically, after writing the database table attribute information, the database table creation statement is executed in the database to test the creation of the database table in the database. The database here is a user-specified database or a system default database.

[0073] Step S2043: Automatically generate test data corresponding to each attribute field according to the data type, constraint conditions and random factors.

[0074] Specifically, the data type, constraints, and random factors corresponding to the attribute fields are used as constraints to automatically generate test data that meets the constraints. If the user needs to have a large amount of test data, the test data volume should also be considered as one of the constraints when generating test data.

[0075] Step S2044: forming a test data set from the test data corresponding to each attribute field.

[0076] Exemplarily, the test data set includes multiple sets of test data. Still taking step S2041 as an example, the multiple sets of test data ultimately generated may correspond to attribute fields, i.e., each attribute field corresponds to a set of test data; or, alternatively, the multiple sets of test data ultimately generated may correspond to primary key IDs, i.e., each ID corresponds to a set of test data.

[0077] Step S205: Write the test data set into the test database table. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0078] In this embodiment, a method for generating a test data set is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 3 is a flow chart of a method for generating a test data set according to an embodiment of the present invention, such as Figure 3 As shown, the process includes the following steps:

[0079] Step S301: Obtain user requirements, including the target industry to which the project to be tested belongs. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0080] Step S302: Based on the target industry, select the target industry's basis set from the pre-built industry test basis set, and the basis set includes the attribute information of the library table. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0081] Step S303: Obtain a library table creation statement set from a pre-stored operation statement set. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0082] Step S304: Create a test library table based on the library table's attribute information and the library table creation statement, and generate a test data set based on the library table's attribute information. Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.

[0083] Step S305: Write the test data set into the test database table. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0084] Step S306: Obtain management requirements.

[0085] Specifically, management requirements include management operations and operation objects, wherein management operations include but are not limited to data query operations, data modification operations, data deletion operations, and data addition operations, etc.; and operation objects are test data to be managed.

[0086] Step S307: Based on the management requirement, a target operation statement corresponding to the management requirement is generated.

[0087] Specifically, the above step S307 includes:

[0088] Step S3071: Acquire an operation statement corresponding to the management operation from the operation statement set.

[0089] For example, if the management operation is a data query operation, then it is necessary to obtain a data query statement corresponding to the data query operation from the operation statement set.

[0090] Step S3072: Write the operation object into the operation statement to generate a target operation statement.

[0091] Exemplarily, still taking the embodiment in step S3071 as an example, the operation to be performed corresponds to the test data with id 0003 in the student information table. At this time, the substitute operation object is written into the data query statement to generate a target operation statement for querying the test data with id 0003 in the student information table.

[0092] Step S308: managing the test data in the test library table based on the target operation statement.

[0093] Specifically, the target operation statement is executed in the database to manage the test data in the test library table.

[0094] This embodiment also provides a device for generating a test data set, which is used to implement the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0095] This embodiment provides a device for generating a test data set, such as Figure 4 As shown, including:

[0096] The first acquisition module 401 is used to acquire user requirements, which include the target industry to which the project to be tested belongs.

[0097] The selection module 402 is used to select a basis set of the target industry from the pre-built industry test basis set based on the target industry, where the basis set includes attribute information of the library table.

[0098] The second acquisition module 403 is configured to acquire a library table creation statement set from a pre-stored operation statement set.

[0099] The creation module 404 is used to create a test library table based on the attribute information of the library table and the library table creation statement, and to generate a test data set based on the attribute information of the library table.

[0100] The input module 405 is used to write the test data set into the test library table.

[0101] In some optional implementations, the following submodules in the selection module 402 are used to construct the industry test basis set, including:

[0102] The first acquisition submodule is used to obtain the standards and specifications corresponding to each industry; the extraction submodule is used to extract the test basis corresponding to each industry from the standards and specifications; the first formation submodule is used to form an industry test basis set from the test basis corresponding to each industry.

[0103] In some optional implementations, the creation module 404 includes:

[0104] The first writing submodule is used to write the attribute information of the library table into the library table creation statement; the running submodule is used to run the library table creation statement after the attribute information of the library table is written, and complete the creation of the test library table.

[0105] In some optional implementations, the creation module 404 further includes:

[0106] The generation submodule is used to automatically generate test data corresponding to each attribute field according to the data type, constraints and random factors; the second formation submodule is used to form a test data set from the test data corresponding to each attribute field.

[0107] In some optional embodiments, after the input module 405, the apparatus further includes:

[0108] The third acquisition module is used to acquire management requirements; the generation module is used to generate target operation statements corresponding to the management requirements based on the management requirements; and the management module is used to manage the test data in the test library table based on the target operation statements.

[0109] In some optional implementations, the generation module includes:

[0110] The second acquisition submodule is used to acquire the operation statement corresponding to the management operation from the operation statement set; the second writing submodule is used to write the operation object into the operation statement to generate a target operation statement.

[0111] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0112] The test data set generation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0113] The embodiment of the present invention also provides a computer device having the above Figure 4 The generation device of the test dataset is shown.

[0114] See also Figure 5 , Figure 5 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0115] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0116] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0117] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0118] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0119] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0120] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0121] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0122] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating a test data set, characterized in that: The method comprises: Obtaining user needs, wherein the user needs include the target industry to which the project to be tested belongs; Based on the target industry, selecting a basis set for the target industry from a pre-built industry test basis set, wherein the basis set includes attribute information of a library table; Get the library table creation statement set from the pre-stored operation statement set; Creating a test library table based on the attribute information of the library table and the library table creation statement, and generating a test data set based on the attribute information of the library table; The test data set is written into the test library table.

2. The method according to claim 1, characterized in that The process of constructing the industry test basis set includes: Obtain the corresponding standards and specifications for each industry; Extract the corresponding test basis for each industry from the said standards and specifications; The industry test basis set is formed by the test basis corresponding to each industry.

3. The method according to claim 1, characterized in that The step of creating a test library table based on the attribute information of the library table and the library table creation statement includes: Writing the attribute information of the library table into the library table creation statement; The library table creation statement after writing the attribute information of the library table is executed to complete the creation of the test library table.

4. The method according to any one of claims 1 to 3, characterized in that The attribute information of the library table includes the name of the test library table, the attribute fields contained in the test library table, the data type corresponding to each attribute field, the constraint conditions and random factors corresponding to each attribute field.

5. The method according to claim 4, characterized in that Generating a test data set based on the attribute information of the library table includes: Automatically generate test data corresponding to each of the attribute fields according to the data type, the constraint condition and the random factor; The test data set is formed by the test data corresponding to each of the attribute fields.

6. The method according to claim 1, characterized in that After writing the test data set into the test library table, the method further includes: Obtain management requirements; Based on the management requirement, generating a target operation statement corresponding to the management requirement; The test data in the test library table is managed based on the target operation statement.

7. The method according to claim 6, characterized in that The management requirement includes a management operation and an operation object. The generating of a target operation statement corresponding to the management requirement based on the management requirement includes: Acquire an operation statement corresponding to the management operation from the operation statement set; The operation object is written into the operation statement to generate the target operation statement.

8. A device for generating a test data set, characterized in that: The device comprises: A first acquisition module is used to acquire user requirements, wherein the user requirements include the target industry to which the project to be tested belongs; A selection module is used to select a basis set of the target industry from a pre-built industry test basis set based on the target industry, wherein the basis set includes attribute information of a library table; The second acquisition module is used to acquire a library table creation statement set from a pre-stored operation statement set; A creation module, configured to create a test library table based on the attribute information of the library table and the library table creation statement, and to generate a test data set based on the attribute information of the library table; An input module is used to write the test data set into the test library table.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for generating a test data set according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for generating a test data set according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Test data generation method and system

    CN114138657A

  • Test data derivation method and device, equipment and storage medium

    CN115309658A

  • Test data generation method and device suitable for batch tasks

    CN117609008A

  • Page generation method, related device, equipment and storage medium

    CN117687624A