CN109558525B - Test data set generation method, device, equipment and storage medium - Google Patents

Test data set generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN109558525B
CN109558525B CN201811517643.8A CN201811517643A CN109558525B CN 109558525 B CN109558525 B CN 109558525B CN 201811517643 A CN201811517643 A CN 201811517643A CN 109558525 B CN109558525 B CN 109558525B
Authority
CN
China
Prior art keywords
data
target
test
file
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811517643.8A
Other languages
Chinese (zh)
Other versions
CN109558525A (en
Inventor
万月亮
火一莽
刘华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN201811517643.8A priority Critical patent/CN109558525B/en
Publication of CN109558525A publication Critical patent/CN109558525A/en
Application granted granted Critical
Publication of CN109558525B publication Critical patent/CN109558525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method, a device, equipment and a storage medium for generating a test data set, wherein the method comprises the following steps: acquiring a configuration file set matched with a test data set to be generated, and reading each configuration file included in the configuration file set; filling the read data identification in the corresponding data position in the target data table; running a data generating function to generate test data and filling the test data in a target data column corresponding to the data identifier in the target data table; and generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file. According to the technical scheme of the embodiment of the invention, the data test set is generated together according to the data identification in the configuration file set and the test data generated by the corresponding data generation function. The method solves the complicated process of manually compiling the test data, realizes the automatic generation of the test data set, saves a large amount of manpower, and improves the test efficiency.

Description

Test data set generation method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of data communication, in particular to a method, a device, equipment and a storage medium for generating a test data set.
Background
With the rapid development of science and technology, the popularization of the internet technology provides more application scenes for big data products, and the generation of test data is the key for determining the performance of the big data products.
The big data has a plurality of types of test data protocols due to the characteristics of large information amount and diversification, and each type of protocol field is different as far as possible, so that a large amount of data input of different types is constructed when the test data is generated, the test purpose is achieved, a certain verification rule is met, the accuracy of the generated data is verified, and the requirements of wider and more accurate functional requirement coverage of products are met.
In the process of implementing the invention, the inventor finds that the prior art has the following defects: in the prior art, each test needs to be manually written, the test data protocols are various, different fields in each protocol need to be ensured, a certain check rule is met, and manpower is consumed for constructing data.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for generating a test data set, so as to realize automatic generation of the test data set and meet the requirement of testing a big data product.
In a first aspect, an embodiment of the present invention provides a method for generating a test data set, including:
acquiring a configuration file set matched with a test data set to be generated, and reading each configuration file included in the configuration file set;
when the data identification included in the configuration file is read, filling the data identification in a corresponding data position in a target data table;
searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table;
and generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
In a second aspect, an embodiment of the present invention further provides an apparatus for generating a test data set, where the apparatus includes:
the device comprises a configuration file reading module, a test data set generation module and a test data processing module, wherein the configuration file reading module is used for acquiring a configuration file set matched with the test data set to be generated and reading each configuration file in the configuration file set;
the data identifier filling module is used for filling the data identifier in a corresponding data position in a target data table when the data identifier included in the configuration file is read;
the test data generation module is used for searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data and filling the test data in a target data column corresponding to the data identifier in the target data table;
and the test data set generating module is used for generating a BCP file according to the data in the target data column of the target data table and generating the test data set according to the BCP file.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for generating a test data set according to any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention provide a storage medium containing computer-executable instructions for performing a method of generating a test data set according to any of the embodiments of the present invention when executed by a computer processor.
According to the method, the configuration file set is read, the target data table is filled according to the data identification and the data generation function, the BCP file is generated according to the data in the target data table, and finally the data test set is generated. The method solves the complicated process of manually compiling the test data, realizes the automatic generation of the test data set, improves the test efficiency and saves a large amount of manpower.
Drawings
FIG. 1 is a flowchart of a method for generating a test data set according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating a test data set according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a method for generating a test data set according to a second embodiment of the present invention;
fig. 4 is a block diagram of a test data set generation apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of a test data set generation apparatus according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for generating a test data set according to an embodiment of the present invention, where this embodiment is applicable to a case of automatically generating a test data set, and the method may be executed by a device for generating a test data set, where the device may be implemented by software and/or hardware, and may be generally integrated in a device for generating a test data set in one or more devices, and the method specifically includes the following steps:
s110, obtaining a configuration file set matched with the test data set to be generated, and reading each configuration file included in the configuration file set.
The configuration file is information which needs to configure the program when the software is started or operated, different operation parameters need to be set for different software, especially for large data products, different operation environments and different test requirements, and the operation parameters are written into the storage device in the form of the configuration file. There are various formats for the configuration file, for example: binary files, text files, databases, and the like. In the embodiment of the present invention, the format of the configuration file is not particularly limited.
For test data of software, especially test data sets of large data products, there are often one or more configuration files because they contain a large amount of different kinds of input information, and the one or more configuration files are introduced into one file for configuration file integration, i.e. a configuration file set is formed.
In this embodiment of the present invention, optionally, at least one configuration file selected by a user from all configuration files for a test data set to be generated is obtained as the configuration file set, for example: the software includes a total of 10 configuration files, 3 of which are selected as configuration file set 1, and the other 7 are selected as configuration file set 2. The method comprises the steps that a configuration file set 1 is matched with a test data set to be generated, and after the configuration file set 1 is obtained, each configuration file in the configuration file set 1 is read.
And S120, when the data identifier included in the configuration file is read, filling the data identifier in a corresponding data position in a target data table.
Alternatively, the data identifier may be a character string composed of at least two of letters, numbers and symbols, or may be in other forms of representation, for example: an operational formula; in the embodiment of the present invention, the format of the data identifier is not particularly limited.
Optionally, the target data table may be generated after reading a configuration file in the configuration file set by a script file written in Python language, and particularly, the target data table may be an excel table.
S130, searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table.
And according to the data identification, running a data generation function matched with the data identification to generate test data, and then filling the test data in a target data column corresponding to the data identification in the target data table. The data identifier and the data generating function matched with the data identifier may be located in the same configuration file of the same configuration file set, or may be located in different configuration files of the same configuration file set.
In this embodiment of the present invention, optionally, the data generating function may include: a random data generating function; the random data generating function is a function that generates random numbers or random letters, for example: INT (RAND ()% 10) indicates that an integer of 0 to 9 is randomly generated, CHAR (INT (RAND () + 26) +65) indicates that capital letters are randomly generated, and CHAR (INT (RAND () + 26) +97) indicates that lowercase letters are randomly generated.
S140, generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
The BCP is a command line tool for efficiently importing or exporting large-batch data in a parallel mode, a data table or a view can be directly exported, the data table or the view can be exported after being filtered through an instruction statement, and when the data is exported, the data in a file can be exported into the file by using a default value or a specific format file.
In the embodiment of the present invention, optionally, a standard BCP file is created, and data in the target data column is written into the standard BCP file, so as to generate a test BCP file, where the test BCP file includes required test data; generating an index file corresponding to the configuration file set as the specific format file, exporting data in the target data table to a standard BCP file to generate a test BCP file, and particularly, when the target data table is an excel table, generating a file in an index. And storing the test BCP file and the test index file in a target folder, and packaging the target folder to generate the test data set.
The method comprises the steps of reading a configuration file set, obtaining data identifications contained in all configuration files and test data generated through corresponding data generation functions, filling the data identifications and the test data in corresponding positions of a target data table, generating a BCP file according to data in the target data table, and finally generating a data test set. The method solves the complicated process of manually compiling the test data, realizes automatic construction of the test data, automatically generates the test data set, saves a large amount of manpower, and improves the test efficiency.
Example two
Fig. 2 is a flowchart of a method for generating a test data set according to a second embodiment of the present invention, which is embodied on the basis of the above embodiments, and in this embodiment, an operation of filling a data identifier in a corresponding data position in a target data table when the data identifier included in the configuration file is read is further detailed. Correspondingly, the method of the embodiment specifically includes the following operations:
s210, obtaining a configuration file set matched with the test data set to be generated, and reading each configuration file included in the configuration file set.
S220, reading a piece of configuration information in the configuration file as current operation information according to the start-stop identifier of the configuration information, wherein the configuration information comprises at least two key value pairs.
The configuration information in the configuration file may have various start-stop identifiers, such as: taking "<" as the start identifier of the configuration information and "/>" as the stop identifier of the configuration information, the content between the start identifier and the stop identifier is taken as the current operation information. A key-value pair store is a data storage schema that includes a key name, which corresponds to the number of the stored value, and a key value, which is the data stored and is linked by equal numbers, such as: two key value pairs exist in the start-stop identifier, wherein < CHName is the first acquisition time, and 'SeqNumber is 1'/>, wherein both the CHName and the SeqNumber are key names, and both the first acquisition time and 1 are key values. In this embodiment, the configuration information includes at least two key-value pairs.
And S230, acquiring each key value pair included in the current operation information.
A piece of configuration information defined by the configuration information start-stop identifier is acquired as current operation information, and all key-value pairs included in the configuration information are read.
S240, judging whether the current operation information comprises a target key value pair with a key name matched with preset identification data identification information; if yes, returning to execute S250; if not, the process returns to the step S220.
Typically, the key name in each obtained key value pair may be respectively matched with a preset identification data identification information set, and it is determined whether there is a key name that hits a key value pair of one identification data identification information in the identification data identification information set, and if there is a key name that hits the key value pair, the hit key value pair is used as a target key value pair.
Optionally, a corresponding relationship between at least one identification data identification information and a corresponding data column is established in the target data table in advance, for example, a CHName is established in the target data table to correspond to a fifth column in the target data table.
And S250, distributing a new data row for the current operation data in the target data table.
And if the key names in the acquired key value pairs are successfully matched with the preset identification data identification information, distributing a new data row for the current operation data in the target data table.
And S260, filling all target key values in all target key value pairs matched with the current operation information in the new data row.
Specifically, if a corresponding relationship between at least one identification data identification information and a corresponding data column is established in the target data table in advance, each target key value is filled in the data column corresponding to the identification data identification information in the new data row according to the identification data identification information matched with the key name corresponding to each target key value. For example, if the "CHName" previously established corresponds to the fifth column in the target data table, and if the key value pair CHName is acquired as the "first acquisition time", the key value name "first acquisition time" is filled in the fifth column of the new data row.
S270, judging whether the processing of all the configuration information in the configuration file is finished or not; if so, executing S280, otherwise, returning to executing S220, namely returning to execute the operation of acquiring a piece of configuration information in the configuration file as the current operation information according to the configuration information start-stop identifier until the processing of all the configuration information in the configuration file is completed.
In this embodiment, it is necessary to read the contents of all the configuration information start-stop identifiers in the configuration file.
S280, searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table.
S290, generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
According to the technical scheme of the embodiment of the invention, each key value pair in the configuration file set is read, the key name of each key value pair is matched with the preset identification data identification information, the corresponding key value is filled in the target data table, and finally the data test set is generated. The data is stored by adopting a key value pair mode, the searching efficiency is high, meanwhile, the key value can be of any type, multi-layer nesting can be allowed, and the storage capacity of the data is increased.
EXAMPLE III
Fig. 3 is a flowchart of a test data set generating method according to a second embodiment of the present invention, which is embodied on the basis of the above embodiments, in which before generating a BCP file according to data in a target data column in a target data table, the target data table is provided to a test data adjustment platform, and the target data column of the target data table is adjusted according to a result fed back by the test data adjustment platform. Correspondingly, the method of the embodiment specifically includes the following operations:
s310, obtaining a configuration file set matched with the test data set to be generated, and reading each configuration file included in the configuration file set.
S320, when the data identification included in the configuration file is read, filling the data identification in the corresponding data position in the target data table.
S330, searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table.
S340, providing the target data table to a test data adjusting platform, and adjusting the target data column of the target data table according to a result fed back by the test data adjusting platform.
In this embodiment, the filled target data table may be provided to the test data adjustment platform. The test data adjustment platform may be located in the test data generation device, or may be located in a separate test data adjustment device, and a plurality of test data generation devices may share one test data adjustment device. The test data adjustment platform is used for performing operations such as adding, modifying, deleting and verifying on a target data table, for example: merging other data tables into the target data table, and increasing the data volume in the target data table; and verifying each content in the target data table according to a preset rule of the test data adjusting platform, and modifying error data or deleting useless data according to a verification result.
And after receiving a result fed back by the test data adjusting platform, adjusting a corresponding target data column in the target data table to obtain a required target data table.
S350, generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
According to the technical scheme of the embodiment of the invention, the target data table is filled according to the data identification and the test data acquired by the configuration file set, and various data operations are carried out on the target data table by using the test data adjusting platform, so that the required target data table is constructed, the automatic adjustment of the target data table is realized, and the accuracy of data test is improved.
Example four
Fig. 4 is a schematic structural diagram of a test data set generating apparatus according to a fourth embodiment of the present invention. The embodiment may be applicable to automatically generating a test data set, the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in any device that provides a function of generating a test data set, as shown in fig. 4, the apparatus for generating a test data set specifically includes: a configuration file reading module 410, a data identification filling module 420, a test data generating module 430 and a test data set generating module 440.
A configuration file reading module 410, configured to obtain a configuration file set matching with a test data set to be generated, and read each configuration file included in the configuration file set;
a data identifier filling module 420, configured to fill the data identifier in a corresponding data position in a target data table when the data identifier included in the configuration file is read;
a test data generating module 430, configured to search, in the configuration file set, a data generating function that matches each data identifier included in a target data table, and run the data generating function to generate test data, and fill the test data in a target data column corresponding to the data identifier in the target data table;
a test data set generating module 440, configured to generate a BCP file according to the data in the target data column of the target data table, and generate the test data set according to the BCP file.
According to the technical scheme of the embodiment of the invention, the configuration file set is read to obtain the data identifications contained in all the configuration files and the test data generated through the corresponding data generation function, the corresponding positions of the target data table are filled, the BCP file is generated according to the data in the target data table, and the data test set is finally generated. The method solves the complicated process of manually compiling the test data, realizes automatic construction of the test data, automatically generates the test data set, saves a large amount of manpower, and improves the test efficiency.
On the basis of the foregoing embodiments, the data identifier filling module 420 specifically includes:
a current operation information reading unit, configured to read a piece of configuration information as current operation information in the configuration file according to a configuration information start-stop identifier, where the configuration information includes at least two key value pairs;
a key-value pair obtaining unit, configured to obtain each key-value pair included in the current operation information;
a data row allocation unit, configured to allocate a new data row to the current operation data in the target data table if the current operation information includes a target key value pair whose key name matches preset identification data identification information;
a key value filling unit, configured to fill, in the new data line, target key values in all target key value pairs that are matched with the current operation information;
and the returning unit is used for returning and executing the operation of acquiring a piece of configuration information in the configuration file as the current operation information according to the start-stop identifier of the configuration information until the processing of all the configuration information in the configuration file is completed.
On the basis of the foregoing embodiments, the test data set generation apparatus further includes:
and the data column adjusting module is used for providing the target data table to a test data adjusting platform and adjusting the target data column of the target data table according to a result fed back by the test data adjusting platform.
On the basis of the foregoing embodiments, the test data set generating module 440 specifically includes:
the BCP file generating unit is used for creating a standard BCP file, writing the data in the target data column into the standard BCP file and generating a test BCP file;
an Index file generating unit, configured to generate a test Index file corresponding to the configuration file set;
and the test data set generating unit is used for storing the test BCP file and the test index file in a target folder, and packaging the target folder to generate the test data set.
On the basis of the foregoing embodiments, the configuration file reading module 410 is specifically configured to:
and acquiring at least one configuration file selected by a user in all configuration files according to the test data set to be generated as the configuration file set.
On the basis of the foregoing embodiments, the test data generating module 430 is specifically configured to:
the test data generating module 430 is configured to search, in the configuration file set, a random data generating function that matches each data identifier included in a target data table, and run the random data generating function to generate test data, which is filled in a target data column corresponding to the data identifier in the target data table.
On the basis of the foregoing embodiments, the test data set generation apparatus further includes:
and the corresponding relation establishing module is used for establishing a corresponding relation between at least one identification data identification information and a corresponding data column in the target data table in advance.
On the basis of the foregoing embodiments, the key value filling unit is specifically configured to:
and filling each target key value in a data column corresponding to the identification data identification information in the new data row according to the identification data identification information matched with the key name corresponding to each target key value.
The device can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, reference may be made to the method provided in any embodiment of the present invention.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an apparatus according to a fifth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 5, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement the test data set generation method provided by the embodiment of the present invention: acquiring a configuration file set matched with a test data set to be generated, and reading each configuration file included in the configuration file set; when the data identification included in the configuration file is read, filling the data identification in the corresponding data position in a target data table; searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table; and generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
EXAMPLE six
The sixth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for generating a test data set according to the embodiments of the present invention includes:
acquiring a configuration file set matched with a test data set to be generated, and reading each configuration file included in the configuration file set;
when the data identification included in the configuration file is read, filling the data identification in a corresponding data position in a target data table;
searching a data generation function matched with each data identifier in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the data identifier in the target data table;
and generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may 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 may 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 case of a remote computer, the remote computer may 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 may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method of generating a test data set, comprising:
acquiring a configuration file set matched with a test data set to be generated, and reading each configuration file included in the configuration file set;
reading a piece of configuration information in the configuration file as current operation information according to a start-stop identifier of the configuration information, wherein the configuration information comprises at least two key value pairs;
acquiring each key value pair included in the current operation information;
if the current operation information comprises a target key value pair with a key name matched with preset identification data identification information, distributing a new data row for the current operation data in a target data table;
filling all target key values in all target key value pairs matched with the current operation information in the new data row;
returning to execute the operation of acquiring a piece of configuration information in the configuration file as the current operation information according to the start-stop identifier of the configuration information until the processing of all the configuration information in the configuration file is completed;
searching a data generation function matched with each target key value in a target data table in the configuration file set, operating the data generation function to generate test data, and filling the test data in a target data column corresponding to the target key value in the target data table;
and generating a BCP file according to the data in the target data column of the target data table, and generating the test data set according to the BCP file.
2. The method of claim 1, further comprising, prior to generating a BCP file from data in the target data column in the target data table:
and providing the target data table to a test data adjusting platform, and adjusting the target data column of the target data table according to a result fed back by the test data adjusting platform.
3. The method according to claim 1 or 2, wherein generating a BCP file from the data in the target data column in the target data table and generating the test data set from the BCP file comprises:
creating a standard BCP file, writing the data in the target data column into the standard BCP file, and generating a test BCP file;
generating a test index file corresponding to the configuration file set;
and storing the test BCP file and the test index file in a target folder, and packaging the target folder to generate the test data set.
4. The method of claim 1, wherein obtaining a set of configuration files that match a set of test data to be generated comprises:
and acquiring at least one configuration file selected by a user in all configuration files according to the test data set to be generated as the configuration file set.
5. The method of claim 1, wherein the data generation function comprises: a random data generating function.
6. The method of claim 1, further comprising, before reading a piece of configuration information as current operation information in the configuration file according to a configuration information start-stop identifier, the following:
establishing a corresponding relation between at least one identification data identification information and a corresponding data column in the target data table in advance;
filling all target key values in all target key value pairs matched with the current operation information in the new data row, wherein the steps of:
and filling each target key value in a data column corresponding to the identification data identification information in the new data row according to the identification data identification information matched with the key name corresponding to each target key value.
7. An apparatus for generating a test data set, comprising:
the device comprises a configuration file reading module, a test data set generation module and a test data processing module, wherein the configuration file reading module is used for acquiring a configuration file set matched with the test data set to be generated and reading each configuration file in the configuration file set;
the data identifier filling module is used for filling the data identifier in a corresponding data position in a target data table when the data identifier included in the configuration file is read;
the data identifier filling module specifically comprises:
a current operation information reading unit, configured to read a piece of configuration information as current operation information in the configuration file according to a configuration information start-stop identifier, where the configuration information includes at least two key value pairs;
a key-value pair obtaining unit, configured to obtain each key-value pair included in the current operation information;
the data line distribution unit is used for distributing a new data line for the current operation data in a target data table if the current operation information comprises a target key value pair with a key name matched with preset identification data identification information;
a key value filling unit, configured to fill, in the new data line, target key values in all target key value pairs that are matched with the current operation information;
a returning unit, configured to return to execute an operation of acquiring a piece of configuration information as current operation information in the configuration file according to the configuration information start-stop identifier until processing of all configuration information in the configuration file is completed;
the test data generation module is used for searching a data generation function matched with each target key value in a target data table in the configuration file set, operating the data generation function to generate test data and filling the test data in a target data column corresponding to the target key value in the target data table;
and the test data set generating module is used for generating a BCP file according to the data in the target data column of the target data table and generating the test data set according to the BCP file.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of generating a test data set according to any one of claims 1-6 when executing the program.
9. A storage medium containing computer executable instructions for performing the method of generating a test data set according to any one of claims 1-6 when executed by a computer processor.
CN201811517643.8A 2018-12-12 2018-12-12 Test data set generation method, device, equipment and storage medium Active CN109558525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811517643.8A CN109558525B (en) 2018-12-12 2018-12-12 Test data set generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811517643.8A CN109558525B (en) 2018-12-12 2018-12-12 Test data set generation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109558525A CN109558525A (en) 2019-04-02
CN109558525B true CN109558525B (en) 2020-11-06

Family

ID=65869574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811517643.8A Active CN109558525B (en) 2018-12-12 2018-12-12 Test data set generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109558525B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287148B (en) * 2019-07-01 2021-10-29 中原银行股份有限公司 Data interaction method and device
CN110688530B (en) * 2019-08-19 2022-04-26 天津开心生活科技有限公司 Json data processing method and device
CN110597728A (en) * 2019-09-20 2019-12-20 中国银行股份有限公司 Method, device and system for constructing test data
CN111190802B (en) * 2019-12-22 2022-09-30 卡斯柯信号有限公司 Method for automatically generating performance test configuration
CN111625455A (en) * 2020-05-26 2020-09-04 中国建设银行股份有限公司 Program testing method, device, equipment and medium
CN113282499B (en) * 2021-05-31 2024-02-09 长沙市到家悠享家政服务有限公司 Method, system, equipment and medium for creating test data
CN113641585B (en) * 2021-08-20 2023-04-07 成方金融科技有限公司 Test data generation method, device, equipment and storage medium
CN113821451B (en) * 2021-11-24 2022-03-22 北京交研智慧科技有限公司 Test method, test device, electronic equipment and readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103793318B (en) * 2012-10-29 2018-06-12 百度在线网络技术(北京)有限公司 The distributed test method and device of a kind of module stability
CN104133772B (en) * 2014-08-13 2017-04-12 广东电网公司信息中心 Automatic test data generation method
WO2017084895A1 (en) * 2015-11-20 2017-05-26 Intrinsic Id B.V. Puf identifier assignment and testing method and device
CN107665171B (en) * 2017-10-11 2020-08-04 中国民生银行股份有限公司 Automatic regression testing method and device

Also Published As

Publication number Publication date
CN109558525A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN108519967B (en) Chart visualization method and device, terminal and storage medium
CN111813804B (en) Data query method and device, electronic equipment and storage medium
CN113467868B (en) Method and device for creating equipment resources
CN110673839B (en) Distributed tool configuration construction generation method and system
CN109447820B (en) Data processing method, device, computer equipment and storage medium
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN110019444B (en) Operation request processing method, device, equipment and system
CN115599386A (en) Code generation method, device, equipment and storage medium
CN110569218B (en) Offline modification method and device for EXT file system and storage medium
CN115237805A (en) Test case data preparation method and device
CN109033456B (en) Condition query method and device, electronic equipment and storage medium
CN111124541B (en) Configuration file generation method, device, equipment and medium
CN113760894A (en) Data calling method and device, electronic equipment and storage medium
CN111290961A (en) Interface test management method and device and terminal equipment
CN111694992A (en) Data processing method and device
CN111736848B (en) Packet conflict positioning method, device, electronic equipment and readable storage medium
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN110716946B (en) Method and device for updating feature rule matching library, storage medium and electronic equipment
CN111488286B (en) Method and device for independently developing Android modules
CN113704120A (en) Data transmission method, device, equipment and storage medium
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment
CN113419959A (en) Method and equipment for generating coverage rate verification report
CN111400623A (en) Method and apparatus for searching information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant