CN112131105B - Method and device for constructing test data - Google Patents
Method and device for constructing test data Download PDFInfo
- Publication number
- CN112131105B CN112131105B CN202010971836.1A CN202010971836A CN112131105B CN 112131105 B CN112131105 B CN 112131105B CN 202010971836 A CN202010971836 A CN 202010971836A CN 112131105 B CN112131105 B CN 112131105B
- Authority
- CN
- China
- Prior art keywords
- data
- sample
- sample data
- data type
- type
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method and a device for constructing test data, wherein the method comprises the following steps: receiving input structured sample test data; acquiring at least one sample data type of sample test data and corresponding sample data characteristics thereof; acquiring sample data distribution characteristics corresponding to each sample data type according to at least one sample data type contained in each sample data type and the data amount corresponding to each sample data type; and constructing data according to each sample data type, the corresponding sample data characteristics and sample data distribution characteristics, and generating target test data with preset construction quantity. The method is suitable for generating a large amount of data in software testing, meets the requirement of quickly acquiring structured data in the large data testing, reduces the burden of data preparation of testers, ensures the massive, integral and diverse performance of the test data, and effectively improves the test efficiency and test sufficiency.
Description
Technical Field
The invention relates to the technical field of computer testing, in particular to a method and a device for constructing test data.
Background
The advent and rapid growth of the internet, especially the large-scale use of mobile internet, internet of things devices, has the origin of data not limited to human-machine sessions, but rather a large number of automatically generated by devices, servers, APP applications, etc., machine-generated data is growing in geometric orders of magnitude. For software testing, data quality is an important dimension of computer software system testing, and it is a great challenge to efficiently and correctly verify at least terabytes of data processed by a computer software system.
In the software testing process, the more the test data input into the system is matched with the data characteristics in the real scene, the more accurate the obtained test result is. However, a large amount of real data is not easily obtained due to privacy protection, etc., so a method for constructing test data capable of maintaining real characteristics of data is required to generate a large amount of test data conforming to real scene characteristics.
It is noted that this section is intended to provide a background or context for the embodiments of the disclosure set forth in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Disclosure of Invention
The embodiment of the invention provides a method and a device for constructing test data, which are used for solving the problem that massive real test data cannot be acquired due to privacy protection and the like in the prior art.
In a first aspect, an embodiment of the present invention provides a method for constructing test data, including:
receiving input structured sample test data;
acquiring at least one sample data type of the sample test data and corresponding sample data characteristics thereof;
acquiring sample data distribution characteristics corresponding to each sample data type according to at least one sample data type contained in each sample data type and the data amount corresponding to each sample data type;
performing data construction according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics thereof to generate target test data with preset construction quantity; the target data type, the corresponding target data characteristics and the corresponding target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics.
As a preferred mode of the first aspect of the present invention, the obtaining, according to at least one sample data type included in each sample data type and a data amount corresponding to each sample data type, a sample data distribution characteristic corresponding to each sample data type includes:
acquiring at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type;
calculating the quantity ratio of each sample data type according to the data quantity corresponding to each sample data type;
and obtaining the sample data distribution characteristics corresponding to the sample data types by counting the number proportion of the sample data types.
As a preferred mode of the first aspect of the present invention, before the data construction is performed according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics, generating a preset construction number of target test data, the method further includes:
and respectively calculating the preset data quantity corresponding to each target data type contained in each target data type in the target test data according to the preset construction quantity of the target test data and the quantity proportion of each sample data type contained in each sample data type.
As a preferred mode of the first aspect of the present invention, the constructing data according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics, generating target test data with a preset construction number includes:
inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in the target test data to generate target test data with preset construction quantity.
As a preferred mode of the first aspect of the present invention, after the receiving the input structured sample test data, the method further comprises:
and performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolation operation.
In a second aspect, an embodiment of the present invention provides an apparatus for constructing test data, including:
the data receiving unit is used for receiving input structured sample test data;
the first acquisition unit is used for acquiring at least one sample data type and corresponding sample data characteristics of the sample test data;
a second obtaining unit, configured to obtain, according to at least one sample data type included in each sample data type and a data amount corresponding to each sample data type, a sample data distribution characteristic corresponding to each sample data type;
the data construction unit is used for carrying out data construction according to each sample data type, the corresponding sample data characteristics and sample data distribution characteristics and generating target test data with preset construction quantity; the target data type, the corresponding target data characteristics and the corresponding target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics.
As a preferred mode of the second aspect of the present invention, the second obtaining unit is specifically configured to:
acquiring at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type;
calculating the quantity ratio of each sample data type according to the data quantity corresponding to each sample data type;
and obtaining the sample data distribution characteristics corresponding to the sample data types by counting the number proportion of the sample data types.
As a preferred mode of the second aspect of the present invention, the data construction unit is specifically configured to:
and respectively calculating the preset data quantity corresponding to each target data type contained in each target data type in the target test data according to the preset construction quantity of the target test data and the quantity proportion of each sample data type contained in each sample data type.
As a preferred mode of the second aspect of the present invention, the data construction unit is further specifically configured to:
inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in the target test data to generate target test data with preset construction quantity.
As a preferred mode of the second aspect of the present invention, the data receiving unit is further configured to:
and performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolation operation.
In a third aspect, an embodiment of the present invention provides a computing device, including a processor and a memory, where the memory stores execution instructions, and the processor reads the execution instructions in the memory to perform the steps described in the method for constructing test data.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium containing computer-executable instructions for performing the steps described in the method of constructing test data as described above.
According to the method and the device for constructing the test data, provided by the embodiment of the invention, a small amount of sample test data in the target system is analyzed, the data types, the corresponding sample data characteristics, the sample data distribution characteristics and the like are obtained, then the types covered by the sample test data and the proportions of the characteristics of different data types are integrated according to the sample information, and a large amount of new target test data is constructed according to the types. The method is suitable for generating a large amount of data in software test, and can be used for rapidly acquiring structured data in the large data test, so that the burden of data preparation of testers is reduced, the large amount, the integrity and the diversity of the test data are ensured, and the test efficiency and the test sufficiency are effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for constructing test data according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a device for constructing test data according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Referring to fig. 1, an embodiment of the invention discloses a method for constructing test data, which mainly comprises the following steps:
101. receiving input structured sample test data;
102. acquiring at least one sample data type of sample test data and corresponding sample data characteristics thereof;
103. acquiring sample data distribution characteristics corresponding to each sample data type according to at least one sample data type contained in each sample data type and the data amount corresponding to each sample data type;
104. performing data construction according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics thereof to generate target test data with preset construction quantity; the target data type, the corresponding target data characteristics and the corresponding target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics.
In the software testing process, the more the test data input into the system is matched with the data characteristics in the real scene, the more accurate the obtained test result is. However, a large amount of real data is not easily obtained due to privacy protection, etc., so a method for constructing test data capable of maintaining real characteristics of data is required to generate a large amount of test data conforming to real scene characteristics.
Aiming at the problem that massive real test data cannot be obtained due to privacy protection and the like, massive test data sets meeting the requirements of the characteristics of the system data are constructed to meet the requirements of the system test, and the preparation of the test data is quick and accurate, so that the burden of data preparation of testers can be reduced, and the test efficiency is effectively improved.
In step 101, a small amount of real data is received as sample test data for simulation before the mass test data is constructed. The sample test data is structured data, and the data is characterized in that one row is one data, each data has the same column, and the data type of each column is the same.
For example, when the obtained sample test data is test data of instant messaging of the mobile terminal in a certain period, the test data is structured data, and is usually stored in a table form. Wherein each row in the table represents a piece of data, and each piece of data has the same column, including a mobile phone number, an account number, time, a position, a protocol and the like.
In this embodiment, the process of obtaining and receiving the structured sample test data is not limited, and those skilled in the art may obtain and receive the structured sample test data according to practical situations.
Preferably, after step 101, i.e. after receiving the input structured sample test data, the following steps are further included:
101-1, performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolating operation.
In this step, since there is missing value, inconsistent or abnormal data in the received sample test data, data cleansing is required. In general, the cleaning operation is performed using a deletion operation, a replacement operation, an interpolation operation, or the like.
For example, for the sample test data, in a certain row of data, for example, the mobile phone number may be null or the preamble +86, the group short number, etc., and for another example, the account number may be null or the mailbox or the mobile phone number, etc., the time may be null or various formats made by 12 or 24 hours, the location information may be GPS longitude and latitude information or information of the base station LAC, CI, etc., the protocol information may be POP3, SMTP, HTTP, QQ, weChat, SSL, etc., various network protocols such as POP3, SMTP, HTTP, QQ, weChat, SSL, etc., the deletion operation, the replacement operation and the interpolation operation need to be used for unified processing, the deletion of the null data, and the processing of the non-unified data into the standard format, etc., to remove the data with missing values, inconsistencies or anomalies.
In step 102, the small amount of structured sample test data received in step 101 is analyzed to obtain at least one sample data type and its corresponding sample data characteristics in the sample test data.
When the data type of the sample test data is obtained, the number of columns of data can be judged by obtaining the separator used by the text format data, and then the type of each column of data is obtained by a script program to obtain various sample data types in the sample test data.
After specific multiple data types are obtained, the data types of each column are the same, so that the data of the same column are analyzed, and the data characteristics of each column of data are obtained, namely, the sample data characteristics corresponding to the sample data types are obtained. The characteristics of the sample data mainly comprise a value range, a data length, a maximum value, a minimum value, an average value, a distance, a variance, a null value or 0, the proportion of different values and the like of the data.
When analyzing the data type of the sample test data and the corresponding characteristics of the sample data, various analysis methods or analysis tools can be adopted for carrying out, and the common analysis methods are as follows: fuzzy data mining, genetic algorithms, etc.
For example, when a genetic algorithm is adopted to analyze a certain sample data type and corresponding sample data characteristics, different classification logics are obtained according to different input training data. First, a data recognition model device for recognition and combination is trained, and then the data recognition model device is used for extracting and recognizing the characteristics of the content of each column to obtain a sample data type.
Of course, classification algorithms in artificial intelligence may also be used to identify the data of each column as a data type according to common data types, such as: cell phone number, account number, time, place, protocol, etc. to better assist in analyzing the data characteristics of each column.
In step 103, according to the sample data types obtained in step 102, the sample data distribution characteristics corresponding to the sample data types are obtained according to at least one sample data type included in the sample data types and the data amount corresponding to the sample data types.
Typically, a plurality of different sample data types are included under the same sample data type. For example, when the sample data type is an account number, the sample data type may include a mobile phone number, a mailbox, a custom user name, or other various data types.
Specifically, a plurality of sample data types contained in an actual sample data type are acquired, then the data quantity occupied by each sample data type in the whole sample test data is calculated respectively, and finally the data distribution characteristics of the sample data type are analyzed.
Preferably, in one possible implementation, step 103 may be implemented as follows:
1031. at least one sample data type included in each sample data type and a data amount corresponding to each sample data type are acquired.
In this step, a plurality of sample data types included in the actual sample data type are acquired, and are respectively defined as X 1 、X 2 、X 3 ……X i Then, the data amount occupied by each sample data type in the whole sample test data is calculated, namely the number is counted respectively and correspondingly defined as T 1 、T 2 、T 3 ……T i 。
1032. And calculating the number ratio of each sample data type according to the data quantity corresponding to each sample data type.
In this step, according to the obtained sample data types and the corresponding data amounts, the percentage of each sample data type in the whole sample test data, that is, the number ratio, is calculated.
Illustratively, the total number of columns in a given sample test data is T, which is a sample data type in which i sample data types, respectively type X, are included 1 Category X 2 Category X 3 … … class X i . Wherein, category X 1 The data amount of (2) is T 1 Class X 2 The data amount of (2) is T 2 Class X 3 The data amount of (2) is T 3 And so on. Further, category X 1 The number ratio of (2) is calculated by: (T) 1 ÷T)×100%=X 1 The other types are sequentially calculated according to the method, and finally the number proportion of each type is sequentially X 2 %、X 3 %、X 4 %……X i In which X is 1 %+X 2 %+X 3 %+……X i %=100%。
1033. And obtaining the sample data distribution characteristics corresponding to each sample data type by counting the number proportion of each sample data type.
In this step, the data distribution characteristics are obtained by statistics and analysis based on the number ratio of the acquired sample data types.
Typically, the data distribution characteristics obtained by analysis include: average distribution, random distribution, normal distribution, etc.
In step 104, data construction is performed according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics obtained in the above step, so as to generate target test data which is in a preset construction quantity and accords with the sample structured data characteristics.
The target data type, the corresponding target data characteristics and the target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics.
Preferably, before step 104, that is, before generating the target test data of the preset configuration number, the method further includes the following steps:
104-1, respectively calculating preset data amounts corresponding to each target data type contained in each target data type in the target test data according to the preset construction number of the target test data and the number proportion of each sample data type contained in each sample data type.
In this step, after the preset number of structures of the target test data to be structured is given, since each target data type and the number ratio thereof included in each target data type in the target test data are corresponding to each sample data type and the number ratio thereof included in each sample data type in the sample test data, the preset data amount corresponding to each target data type included in each target data type in the target test data to be structured can be calculated according to the number ratio of each sample data type included in each sample data type.
For example, assuming that the preset number of structures of the target test data to be structured is W, the data amount of each column of data is W, that is, the data amount of the target data type, the calculation manner of W is as follows:
wherein S is i For the ith target data class Y i Data volume of (2), i.e. S i =W×Y i %,Y i % is the target data category Y i N represents the number of target data categories contained in the target data type.
The data amount of each target data type in each target data type can be obtained by the above formula, so as to obtain the target data type Y contained in each target data type in the preset construction number W of the target test data to be constructed 1 、Y 2 、Y 3 ……Y i Of the target data category Y 1 Data amount S of (2) 1 =W×Y 1 Percent and so on, T 2 =W×Y 2 %,......,S i =W×Y i %。
Preferably, in one possible implementation, step 104 may be implemented as follows:
1041. inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in target test data to generate target test data with preset construction quantity.
In the step, each sample data type obtained in the step, the corresponding sample data characteristics and sample data distribution characteristics are input into a data construction device, and data construction is carried out by combining the preset data quantity corresponding to each target data type contained in each target data type in the calculated target test data, so as to generate target test data with preset construction quantity.
In the constructed target test data, the target data type, the corresponding target data characteristics and the target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the sample data distribution characteristics in the sample test data, and are consistent with the sample structured data characteristics.
In particular, when the data volume of the required configuration is large in scale, the generation of data can be accelerated in a parallelization method in a plurality of nodes based on the parallelization characteristics of the clusters.
Illustratively, table 1 below shows a received instant messaging test data set of the mobile terminal for a certain period of time when the method described in the present embodiment is used for constructing the target test data:
TABLE 1
Mobile phone number | Account number | Time | Position of | Protocol(s) |
13525256548 | 13525256548 | 2018/7/1 18:00:00 | (21749,22876) | |
13654564568 | Ligang22 | 2018/7/3 19:04:50 | (108.963133,34.254686) | |
13854564564 | laowang@163.com | 2018/7/8 20:09:00 | (21739,22676) | POP3 |
13954564563 | 13954564563 | 2018/7/13 21:08:00 | (108.938413,34.28632) | |
13554564562 | Kansuici4562 | 2018/7/15 18:30:20 | (22749,22576) | |
13654564561 | ianxah12@139.com | 2018/7/16 19:20:00 | (108.928457,34.269866) | POP3 |
13854564567 | 13854564567 | 2018/7/19 21:40:00 | (22749,22376) | |
13954564566 | Hangfx3034 | 2018/7/21 22:10:03 | (108.956609,34.252558) | |
13554564565 | GongDong3@126.com | 2018/7/23 23:08:00 | (23749,22536) | POP3 |
13655564568 | 13655564568 | 2018/7/24 19:50:00 | (108.967939,34.273555) | |
13856564568 | dongfe4568 | 2018/7/25 19:50:00 | (21749,22976) | |
13956764568 | Qiedong4568@126.net | 2018/7/27 18:00:00 | (108.969929,34.275555) | POP3 |
13556745682 | 13556745682 | 2018/7/29 18:30:00 | (21749,22978) | |
13659564568 | 136DongDong | 2018/7/31 21:00:00 | (108.969921,34.275545) | |
13858564568 | 138Xinxin@56.com | 2018/8/1 22:40:00 | (21749,22998) | POP3 |
In the structured sample test data, the data amount is 15. Specifically, the sample data type of column 1 is a mobile phone number, wherein only one sample data type is contained, namely a mobile phone number, and the corresponding data amount is 15; the sample data type of the 2 nd column is an account number, and the types of the sample data contained in the account number are three, namely a mobile phone number, a mailbox and a user name, and the corresponding data quantity is 5, 5 and 5 respectively; the sample data type of column 3 is time, wherein only one sample data type is contained, namely 24 hours time, and the corresponding data amount is 15; the type of the sample data in the 4 th column is a position, wherein two types of the sample data are contained, namely base station LAC information and CI or GPS information, and the corresponding data quantity is 8 and 7 respectively; the sample data type of column 5 is protocol, and the sample data types included in the protocol are three types, namely QQ, weChat and POP3, and the corresponding data amounts are 5, 5 and 5 respectively. In the structured sample test data, the data distribution characteristics corresponding to the sample data types are all distributed evenly.
According to the construction method described in the above embodiment, a predetermined number of target test data according with the characteristics of the sample structured data can be constructed, and detailed procedures thereof are not repeated here.
In summary, according to the method for constructing test data provided by the embodiment of the present invention, a small amount of sample test data in a target system is analyzed, a data type, a corresponding sample data characteristic, a sample data distribution characteristic and the like are obtained therefrom, and then according to these sample information, the type of coverage of the sample test data and the proportion of characteristics of different data types are integrated, and a large amount of new target test data is constructed accordingly. The method is suitable for generating a large amount of data in software test, and can be used for rapidly acquiring structured data in the large data test, so that the burden of data preparation of testers is reduced, the large amount, the integrity and the diversity of the test data are ensured, and the test efficiency and the test sufficiency are effectively improved.
It should be noted that, for simplicity of description, the above-described embodiments of the method are all described as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required for the present invention.
Referring to fig. 2, based on the same inventive concept, an embodiment of the present invention provides a test data constructing apparatus, which mainly includes:
a data receiving unit 21 for receiving input structured sample test data;
a first obtaining unit 22, configured to obtain at least one sample data type of the sample test data and a corresponding sample data characteristic thereof;
a second obtaining unit 23, configured to obtain a sample data distribution characteristic corresponding to each sample data type according to at least one sample data type included in each sample data type and a data amount corresponding to each sample data type;
the data construction unit 24 is configured to perform data construction according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics, and generate target test data with a preset construction number; the target data type, the corresponding target data characteristics and the target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics.
Preferably, the second obtaining unit 23 is specifically configured to:
acquiring at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type;
calculating the number ratio of each sample data type according to the data amount corresponding to each sample data type;
and obtaining the sample data distribution characteristics corresponding to each sample data type by counting the number proportion of each sample data type.
Preferably, the data construction unit 24 is specifically configured to:
and respectively calculating the preset data quantity corresponding to each target data type contained in each target data type in the target test data according to the preset construction quantity of the target test data and the quantity proportion of each sample data type contained in each sample data type.
Preferably, the data construction unit 24 is further specifically configured to:
inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in target test data to generate target test data with preset construction quantity.
Preferably, the data receiving unit 21 is further configured to:
and performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolation operation.
In summary, the device for constructing test data according to the embodiment of the present invention analyzes a small amount of sample test data in a target system, obtains a data type, a corresponding sample data characteristic, a sample data distribution characteristic, and the like from the sample test data, integrates the type covered by the sample test data and the proportion of different data type characteristics according to the sample information, and constructs a large amount of new target test data accordingly. The method is suitable for generating a large amount of data in software test, and can be used for rapidly acquiring structured data in the large data test, so that the burden of data preparation of testers is reduced, the large amount, the integrity and the diversity of the test data are ensured, and the test efficiency and the test sufficiency are effectively improved.
It should be understood that the above coverage evaluation device based on test data includes units that are only logically divided according to functions implemented by the device, and in practical applications, the above units may be overlapped or split. The functions implemented by the device for constructing test data provided in this embodiment are in one-to-one correspondence with the method for constructing test data provided in the foregoing embodiment, and the more detailed process flow implemented by the device is described in detail in the foregoing method embodiment, which is not described in detail herein.
Referring to fig. 3, the computing device mainly includes a processor 31 and a memory 32, wherein the memory 32 stores execution instructions, based on the same inventive concept. The processor 31 reads the execution instructions in the memory 32 for performing the steps described in the above embodiment of the construction method of the test data. Alternatively, the processor 31 reads the execution instructions in the memory 32 for realizing the functions of the units in the embodiment of the construction apparatus for test data described above.
FIG. 3 is a schematic diagram of a computing device according to an embodiment of the present invention, and as shown in FIG. 3, the computing device includes a processor 31, a memory 32, and a transceiver 33; wherein the processor 31, the memory 32 and the transceiver 33 are interconnected by a bus 34.
The memory 32 is for storing a program; in particular, the program may include program code including computer-operating instructions. The memory 32 may include volatile memory (RAM), such as random-access memory (RAM); the memory 32 may also include a nonvolatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a Solid State Drive (SSD); the memory 32 may also include a combination of the above types of memory.
The memory 32 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
operation instructions: including various operational instructions for carrying out various operations.
Operating system: including various system programs for implementing various basic services and handling hardware-based tasks.
Bus 34 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or one type of bus.
The processor 31 may be a central processing unit (central processing unit, CPU for short), a network processor (network processor, NP for short) or a combination of CPU and NP. But also a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD for short), a field programmable gate array (fieldprogrammable gate array, FPGA for short), a generic array logic (generic array logic, GAL for short), or any combination thereof.
The embodiment of the invention also provides a computer readable storage medium containing computer execution instructions for executing the steps described in the method embodiment for constructing test data. Alternatively, the computer-executable instructions are used to perform the functions of the units in the above-described embodiments of the test data construction apparatus.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.
Claims (8)
1. A method of constructing test data, the method comprising:
receiving input structured sample test data; the structured sample test data is stored in a table form, wherein each row of the table is one test data, and each column is one sample data type;
acquiring at least one sample data type of the sample test data and corresponding sample data characteristics thereof; the sample data characteristics comprise a data value range, a data length, a maximum value, a minimum value, an average value, a distance, a variance, a null value or 0 and the proportion of different values;
acquiring sample data distribution characteristics corresponding to each sample data type according to at least one sample data type contained in each sample data type and the data amount corresponding to each sample data type;
performing data construction according to each sample data type and the corresponding sample data characteristics and sample data distribution characteristics thereof to generate target test data with preset construction quantity; the target data type, the corresponding target data characteristics and the corresponding target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics;
the obtaining a sample data distribution characteristic corresponding to each sample data type according to at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type specifically includes:
acquiring at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type;
calculating the quantity ratio of each sample data type according to the data quantity corresponding to each sample data type;
obtaining sample data distribution characteristics corresponding to each sample data type by counting the number proportion of each sample data type; the sample data distribution characteristics include: average distribution, random distribution, and normal distribution.
2. The method of claim 1, further comprising, prior to said constructing data based on each of said sample data types and their corresponding sample data characteristics and sample data distribution characteristics, generating a predetermined number of target test data of said constructed number:
and respectively calculating the preset data quantity corresponding to each target data type contained in each target data type in the target test data according to the preset construction quantity of the target test data and the quantity proportion of each sample data type contained in each sample data type.
3. The method of claim 2, wherein the constructing data according to each of the sample data types and the corresponding sample data characteristics and sample data distribution characteristics, and generating a predetermined number of target test data comprises:
inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in the target test data to generate target test data with preset construction quantity.
4. A method according to any one of claims 1 to 3, further comprising, after said receiving input structured sample test data:
and performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolation operation.
5. A device for constructing test data, the device comprising:
the data receiving unit is used for receiving input structured sample test data; the structured sample test data is stored in a table form, wherein each row of the table is one test data, and each column is one sample data type;
the first acquisition unit is used for acquiring at least one sample data type and corresponding sample data characteristics of the sample test data; the sample data characteristics comprise a data value range, a data length, a maximum value, a minimum value, an average value, a distance, a variance, a null value or 0 and the proportion of different values;
a second obtaining unit, configured to obtain, according to at least one sample data type included in each sample data type and a data amount corresponding to each sample data type, a sample data distribution characteristic corresponding to each sample data type;
the data construction unit is used for carrying out data construction according to each sample data type, the corresponding sample data characteristics and sample data distribution characteristics and generating target test data with preset construction quantity; the target data type, the corresponding target data characteristics and the corresponding target data distribution characteristics are respectively corresponding to the sample data type, the corresponding sample data characteristics and the corresponding sample data distribution characteristics;
the second obtaining unit is specifically configured to:
acquiring at least one sample data type contained in each sample data type and a data amount corresponding to each sample data type;
calculating the quantity ratio of each sample data type according to the data quantity corresponding to each sample data type;
obtaining sample data distribution characteristics corresponding to each sample data type by counting the number proportion of each sample data type; the sample data distribution characteristics include: average distribution, random distribution, and normal distribution.
6. The apparatus according to claim 5, wherein the data construction unit is specifically configured to:
and respectively calculating the preset data quantity corresponding to each target data type contained in each target data type in the target test data according to the preset construction quantity of the target test data and the quantity proportion of each sample data type contained in each sample data type.
7. The apparatus according to claim 6, wherein the data construction unit is further specifically configured to:
inputting each sample data type, the corresponding sample data characteristics and sample data distribution characteristics into a data construction device, and constructing data according to preset data quantity corresponding to each target data type contained in each target data type in the target test data to generate target test data with preset construction quantity.
8. The apparatus according to any one of claims 5 to 7, wherein the data receiving unit is further configured to:
and performing a cleaning operation on the sample test data, wherein the cleaning operation at least comprises a deleting operation, a replacing operation and an interpolation operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010971836.1A CN112131105B (en) | 2020-09-16 | 2020-09-16 | Method and device for constructing test data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010971836.1A CN112131105B (en) | 2020-09-16 | 2020-09-16 | Method and device for constructing test data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112131105A CN112131105A (en) | 2020-12-25 |
CN112131105B true CN112131105B (en) | 2023-05-30 |
Family
ID=73846525
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010971836.1A Active CN112131105B (en) | 2020-09-16 | 2020-09-16 | Method and device for constructing test data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112131105B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112685326A (en) * | 2021-01-26 | 2021-04-20 | 政采云有限公司 | Software testing method, system, equipment and readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108255712A (en) * | 2017-12-29 | 2018-07-06 | 曙光信息产业(北京)有限公司 | The test system and test method of data system |
CN110851357A (en) * | 2019-11-04 | 2020-02-28 | 紫光云技术有限公司 | Test data automatic construction method based on multiple database types |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9921930B2 (en) * | 2015-03-04 | 2018-03-20 | International Business Machines Corporation | Using values of multiple metadata parameters for a target data record set population to generate a corresponding test data record set population |
US20180137218A1 (en) * | 2016-11-11 | 2018-05-17 | General Electric Company | Systems and methods for similarity-based information augmentation |
CN107677290B (en) * | 2017-08-21 | 2020-02-07 | 北京航空航天大学 | Testing method and device for precision evaluation of inertial navigation system |
US11238955B2 (en) * | 2018-02-20 | 2022-02-01 | International Business Machines Corporation | Single sample genetic classification via tensor motifs |
CN111581092B (en) * | 2020-05-07 | 2023-05-30 | 安徽星环人工智能科技有限公司 | Simulation test data generation method, computer equipment and storage medium |
-
2020
- 2020-09-16 CN CN202010971836.1A patent/CN112131105B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108255712A (en) * | 2017-12-29 | 2018-07-06 | 曙光信息产业(北京)有限公司 | The test system and test method of data system |
CN110851357A (en) * | 2019-11-04 | 2020-02-28 | 紫光云技术有限公司 | Test data automatic construction method based on multiple database types |
Non-Patent Citations (1)
Title |
---|
湖南省干热岩资源类型研究;刘梅;叶见玲;刘素平;;国土资源情报(08);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112131105A (en) | 2020-12-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105427129B (en) | Information delivery method and system | |
CN107886414B (en) | Order combination method and equipment and computer storage medium | |
CN113379071B (en) | Noise label correction method based on federal learning | |
Nazarenko et al. | Features of application of machine learning methods for classification of network traffic (features, advantages, disadvantages) | |
CN110347888B (en) | Order data processing method and device and storage medium | |
CN110647995A (en) | Rule training method, device, equipment and storage medium | |
CN112131105B (en) | Method and device for constructing test data | |
CN109698798B (en) | Application identification method and device, server and storage medium | |
CN113505936A (en) | Project approval result prediction method, device, equipment and storage medium | |
CN110895506A (en) | Construction method and construction system of test data | |
CN107463391B (en) | Task processing method, device and equipment | |
CN109597702B (en) | Root cause analysis method, device, equipment and storage medium for message bus abnormity | |
CN112580780A (en) | Model training processing method, device, equipment and storage medium | |
CN106304085B (en) | Information processing method and device | |
CN113094899B (en) | Random power flow calculation method and device, electronic equipment and storage medium | |
CN106304084B (en) | Information processing method and device | |
Arslan et al. | Automatic performance analysis of cloud based load testing of web-application & its comparison with traditional load testing | |
CN107957944B (en) | User data coverage rate oriented test case automatic generation method | |
CN111415200A (en) | Data processing method and device | |
CN115759251A (en) | Decision tree training method and device, computer equipment and storage medium | |
CN110262950A (en) | Abnormal movement detection method and device based on many index | |
CN115329144A (en) | Root cause determination method and device for product defects | |
CN114358121A (en) | Monitoring method and device based on substation equipment and terminal equipment | |
CN111260085B (en) | Device replacement man-hour assessment method, device, equipment and medium | |
CN103778329A (en) | Method for constructing data complement value |
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 |