CN109815252A - Test data generating method, device, computer equipment and readable storage medium storing program for executing - Google Patents

Test data generating method, device, computer equipment and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109815252A
CN109815252A CN201811534708.XA CN201811534708A CN109815252A CN 109815252 A CN109815252 A CN 109815252A CN 201811534708 A CN201811534708 A CN 201811534708A CN 109815252 A CN109815252 A CN 109815252A
Authority
CN
China
Prior art keywords
database
data
test data
information
storing process
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.)
Pending
Application number
CN201811534708.XA
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201811534708.XA priority Critical patent/CN109815252A/en
Publication of CN109815252A publication Critical patent/CN109815252A/en
Pending legal-status Critical Current

Links

Abstract

The present invention discloses a kind of test data generating method, it include: to show regular configuration interface, the field information that table information, each tables of data including each tables of data in database include, the first option of operation for field value create-rule to be arranged need to generate the second option of operation of data volume for being arranged;User is received in regular configuration interface to the setting of target matrix, setting, the setting by the first option of operation to the create-rule of target word segment value, the setting by the second option of operation to the data volume for needing to generate of the aiming field for being included to target matrix;Storing process script is generated according to configuration result;Storing process script is sent to database, to be executed in the database to generate test data.The present invention is equivalent to provides a Test data generation tool easy to operate indirectly, lower for setup test data efficiency in the prior art to solve the problems, such as, the formation efficiency of test data can be improved, and then improve system testing efficiency.

Description

Test data generating method, device, computer equipment and readable storage medium storing program for executing
Technical field
The present invention relates to field of computer technology, and in particular to a kind of test data generating method, device, computer equipment And readable storage medium storing program for executing.
Background technique
In existing system test process, it usually needs setup test data, such as to be inserted in test environment data base Enter the mode of data, and is tested by the realization logic between the complete paired systems of test data and system.With a work For dynamic lottery system, includes a prizes pool in the activity lottery system, 10,000,000 prizes are set in prizes pool, the first prize is 5, second prize is 8, and remaining is to participate in prize, if being tested to the prize drawing logic to the activity lottery system, Then firstly the need of in the table of the corresponding test database of prizes pool, 10,000,000 datas of insertion are as test data, then in system Various prize drawing tests are initiated in related interfaces, it is whether correct with verifying prize drawing logic.
In existing scheme, in the lesser situation of required amount of test data, the mode that insertion data can be used (for example makes With insert sentence) complete the preparation of test data, but required amount of test data is larger and data between rule not In apparent situation (such as above-mentioned the case where needing to up to ten million test datas are inserted into the corresponding test database of prizes pool Under), the insertion of one data of insert sentence, one data is relied on to complete the preparation of test data, and operating efficiency is non- It is often low or even cannot achieve, to influence the efficiency of whole system test.
The problem lower for the efficiency of setup test data in the related technology, not yet proposes effective solution side at present Case.
Summary of the invention
The purpose of the present invention is to provide a kind of test data generating method, device, computer equipment and readable storage mediums Matter, and then above-mentioned problems of the prior art are overcome to a certain extent, the formation efficiency of test data can be improved, in turn Improve the efficiency of system testing.
The present invention is to solve above-mentioned technical problem by following technical proposals:
According to an aspect of the invention, there is provided a kind of test data generating method, includes the following steps:
S01, shows regular configuration interface, includes the table for each tables of data for including in the rule configuration interface in database Information, the field information that each tables of data correspondence includes, the first option of operation of create-rule for field value to be arranged, for setting Set the second option of operation for needing the data volume generated;
S02, reception user is in the regular configuration interface according to table information to the setting of target matrix, according to field The setting for the aiming field that information is included to target matrix, by the first option of operation to the create-rule of target word segment value Setting, needs are generated by the second option of operation the setting of data volume;
S03 is advised according to the aiming field for being included to target matrix, to target matrix, to the generation of aiming field Then and to the setting result for the data volume that needs generate generate storing process script;
Storing process script is sent to database by S04, to execute the storing process script in the database with life At test data.
Further, the storing process script is executed in S04 in the database to generate test data, comprising:
After database receives the storing process script, the order for being used for perform script is called, is immediately performed described Storing process script is to generate test data, alternatively, timing executes the storing process script to generate test data.
Further, before S01 shows regular configuration interface, further includes:
Operation interface for connecting database is provided;
The instruction that user connects database is received by the operation interface;
According to the operation of the instruction execution connection database of the connection database;
The field information that table information, each tables of data correspondence of each tables of data for including in database include is obtained, in institute It states and is shown in regular configuration interface;
Wherein, the table information of each tables of data includes the table name of each tables of data, table structure, the field of each tables of data Information includes the major key of each tables of data, external key.
Further, in the operation interface include third option of operation for inputting target database relevant information;
The instruction that user connects database is received by the operation interface, comprising:
The Target database name of user's input and the service of target database are received by the third option of operation The IP address and port information of the server of device title and/or target database.
Further, according to the operation of the instruction execution connection database of the connection database, comprising:
According to the driver of the instruction load JAVA database of the connection database;
Link information is obtained, the link information includes connection protocol, connection sub-protocol, data source identification;
The request that connection is established with JAVA data is sent according to the link information;
Create the Statement object for executing SQL statement;
The SQL statement for inquiring JAVA database is executed based on Statement object;
Receive the processing result that database returns;
The connection with JAVA database is closed according to processing result.
Further, the method also includes:
After database executes the storing process script to generate test data, execution result information is recorded, it is described Execution result information includes the record number, the duration of execution, tables of data relevant to storing process script of the test data generated Information;
Based on this, the method also includes:
The request for obtaining the implementing result for the storing process script is sent to database;
Receive the execution result information that database returns and display.
Further, the method also includes:
Database execute the storing process script during, time recording implementation progress information, it is described execute into Degree information include database-name relevant to storing process script, data table name, currently generated test data record number, The corresponding percentage of current implementation progress;
Based on this, the method also includes:
The request for obtaining the implementation progress for the storing process script is sent to database;
It receives the implementation progress information that database returns and shows.
To achieve the goals above, the present invention also provides a kind of Test data generation devices, comprising:
Regular configuration interface display module includes data in the rule configuration interface for showing regular configuration interface The field information that table information, each tables of data correspondence for each tables of data for including in library include, the generation for field value to be arranged are advised The first option of operation then, the second option of operation for the data volume that needs generate to be arranged;
Rule configuration receiving module, for receive user in the regular configuration interface according to table information to target data The setting of table, the setting for the aiming field for being included to target matrix according to field information, by the first option of operation to mesh The setting of the create-rule of field value, the setting for the data volume that needs are generated by the second option of operation;
Storing process script generation module, for according to target matrix, the target word for being included to target matrix Section generates storing process script to the create-rule of aiming field and to the setting result for the data volume that needs generate;
Test data generation module is held for storing process script to be sent to database with will pass through in the database The row storing process script is to generate test data.
Further, the Test data generation module, is specifically used for:
After database receives the storing process script, the order for being used for perform script is called, is immediately performed described Storing process script is to generate test data, alternatively, timing executes the storing process script to generate test data.
Further, described device further include:
Operation interface provides module, for providing the operation interface for connecting database;
Link order receiving module, for receiving the instruction that user connects database by the operation interface;
Database connection module, for executing the operation of connection database according to described instruction;
Data obtaining module, for obtaining the table information for each tables of data for including in database, the corresponding packet of each tables of data The field information contained, to be shown in the regular configuration interface;
Wherein, the table information of each tables of data includes the table name of each tables of data, table structure, the field of each tables of data Information includes the major key of each tables of data, external key.
Further, in the operation interface include third option of operation for inputting target database relevant information;
The link order receiving module, is specifically used for:
The Target database name of user's input and the service of target database are received by the third option of operation The IP address and port information of the server of device title and/or target database.
Further, the database connection module, is specifically used for:
According to the driver of the instruction load JAVA database of the connection database;
Link information is obtained, the link information includes connection protocol, connection sub-protocol, data source identification;
The request that connection is established with JAVA data is sent according to the link information;
Create the Statement object for executing SQL statement;
The SQL statement for inquiring JAVA database is executed based on Statement object;
Receive the processing result that database returns;
The connection with JAVA database is closed according to processing result.
Further, described device further include:
Execution result information logging modle, for executing the storing process script in database with generate test data it Afterwards, record execution result information, the execution result information include generate test data record number, execution duration, with The relevant data table information of storing process script;
Based on this, described device further include:
Implementing result obtains module, obtains the implementing result for being directed to the storing process script for sending to database Request;
Information receiving module, for receiving data execution result information of library return and display.
Further, described device further include:
Implementation progress information logging modle, for during database executes the storing process script, timing to be remembered Record implementation progress information, the implementation progress information include database-name relevant to storing process script, data table name, when The preceding record number for having generated test data, the corresponding percentage of current implementation progress;
Based on this, described device further include:
Implementation progress obtains module, obtains the implementation progress for being directed to the storing process script for sending to database Request;
Information receiving module is also used to receive the implementation progress information of database return and shows.
To achieve the goals above, the present invention also provides a kind of computer equipments, including memory, processor and storage On a memory and the computer program that can run on a processor, the processor realize the above method when executing described program The step of.
To achieve the goals above, the present invention also provides a kind of computer readable storage medium, it is stored thereon with computer Program, when described program is executed by processor the step of the realization above method.
Test data generating method, device, computer equipment and readable storage medium storing program for executing provided by the invention, can show and be used for The regular configuration interface for generating storing process script, including the table information for the tables of data for including in database, field information And the option of operation for field create-rule to be arranged, generates data volume, in user according to showing in regular configuration interface Information and option of operation complete rule with postponing, and according to configuration result generation storing process script and are sent to database, so as to To generate test data after database executes the storing process script.By this programme, it is equivalent to and provides a behaviour indirectly Make simple Test data generation tool, by carrying out simple configuration operation in related interfaces, can quickly generate and meet Configuration needs and the storing process script executed into database can be transmitted, thus quickly generate in the database test data and The formation efficiency of test data can be improved with this in size without amount of test data needed for considering, and is particularly suitable for required survey The larger situation of data volume is tried, and then the efficiency of related system test can be improved.
Detailed description of the invention
Fig. 1 is a kind of optional flow diagram of test data generating method according to an embodiment of the present invention;
Fig. 2 is a kind of optional program module schematic diagram of Test data generation device according to an embodiment of the present invention;
Fig. 3 is the optional program module schematic diagram of another kind of Test data generation device according to an embodiment of the present invention;
Fig. 4 is a kind of optional hardware structure schematic diagram of computer equipment according to an embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
Embodiment one
Test data generating method provided by the invention is illustrated with reference to the accompanying drawing.
Fig. 1 is a kind of optional flow diagram of test data generating method of the present invention, as shown in Figure 1, this method can With the following steps are included:
S01 shows regular configuration interface.
In the present embodiment, regular configuration interface can be the regular configuration interface dedicated for generating storing process script, Wherein, storing process script is that can be used for execution script in the database.
In specific implementation, data table information included in the content and database shown in above-mentioned regular configuration interface Be it is relevant, therefore, before above-mentioned regular configuration interface is provided, the operation interface for connecting database can also be provided, It can first be connect with database to obtain content needed for regular configuration interface.
The instruction for the connection database that user issues can be received by the above-mentioned operation interface for being used to connect database, Under a kind of implementation, in the operation interface for connecting database, it may include for inputting target database relevant information Option of operation (to be distinguished with the subsequent option of operation mentioned, in the present embodiment, the option of operation can be described as third operation Option), which can be such as input frame etc., in addition, it may further comprise for determining the operation for issuing link order Option, such as " determining connection " button.
Based on this, user can receive the Target database name and target of user's input by the third option of operation The server of the server name and/or target database of database IP address and port information (for example, http: // 172.168.8.7:3636), then triggering " determines and connects " button, can correspond to the instruction for issuing connection database.
Then, the operation of database can be connected according to the instruction execution of above-mentioned connection database, for example JAVA number can be used The connection between database is realized according to library (JDBC, Java Data Base Connectivity) connection type.
It in specific implementation, can be first according to above-mentioned connection before linking objective database (such as certain JAVA database) The instruction of database loads the driver of JAVA database to JVM (JAVA virtual machine), for example can pass through The static method forName (String className) of java.lang.Class class is realized.
Then, link information can be obtained, wherein link information may include connection protocol (in JAVA database usually with JDBC starts), connection sub-protocol (driver or data base management system title that bridging connects), data source identification is (for marking Note can find the address and connectivity port of database source) etc..
After obtaining link information, then the request that connection is established with JAVA data can be sent according to above-mentioned link information, than Such as, request is issued to obtain Connection object to java.sql.DriverManager, which represents a database Connection.
Next, needing to create the Statement object for executing SQL statement.In actual operation, it is desirable to execute SQL statement, it is necessary to obtain java.sql.Statement example, Statement example can include: for executing static embeded SQL language Sentence Statement example, the Prepared Statement example for executing dynamic SQL statements, for executing database Callable Statement example of storing process etc..
Then, the SQL statement for inquiring JAVA database can be executed based on Statement object, and can receive data The processing result that library returns, wherein the processing result of return such as can be result set (ResultSet) object, the result Collecting in object may include meeting all rows of SQL statement conditional, and may have access to the data in these rows.
After obtaining processing result, it is considered as the completion with JAVA database attended operation, after the completion of attended operation, Then the object of all JAVA databases used can all be closed, discharge JAVA database resource, to close and JAVA data The connection in library.
After connection between completion and database, can obtain each tables of data for including in database table information (such as May include the information such as table name, the table structure of each tables of data) and each tables of data correspondence field information for including (for example may include The information such as major key, the external key of each tables of data), to be shown in regular configuration interface, check, select for user etc. with Rule relevant to storing process script is generated is completed to configure.
It can be loaded automatically in above-mentioned regular configuration interface as a result, and show above-mentioned acquisition result, that is to say, that the rule It may include table information (information such as table name, table structure), each tables of data pair of each tables of data for including in configuration interface in database The field information (information such as major key, external key) that should include, in addition, may also include in the rule configuration interface for field value to be arranged Create-rule option of operation (in the present embodiment, can be described as the first option of operation), for being arranged need the data that generate The option of operation (in the present embodiment, can be described as the second option of operation) of amount.
With this, user can be according to the content shown in above-mentioned regular configuration interface, by the set-up modes pair such as choosing, inputting The create-rule of storing process script is configured, and meets user configuration demand with automatic in the next steps and efficient generate Storing process script.
S02, reception user is in the regular configuration interface according to table information to the setting of target matrix, according to field The setting for the aiming field that information is included to target matrix, by the first option of operation to the create-rule of target word segment value Setting, needs are generated by the second option of operation the setting of data volume.
In the present embodiment, the rule configuration operation that user executes in above-mentioned regular configuration interface is received, can specifically be wrapped It includes:
Setting according to table information to target matrix, for example, the table name letter of tables of data can be shown in the form of combobox Breath is so that user checks and chooses, and user can choose the tables of data for needing to operate according to each table name in combobox, such as prizes pool table Deng;
According to the setting for the aiming field that field information is included to target matrix, for example, can be in the form of combobox So that user checks and chooses, user can choose in target matrix in combobox display field information according to each field name Required field may include prize ID, prize title, prize value in required field, such as prizes pool table;
Setting by the first option of operation to the create-rule of target word segment value, under which such as can be Draw box form show the create-rule information pre-set so that user checks and chooses, can also be input frame form for User inputs create-rule information.
In the present embodiment, create-rule such as may include random generation, natural increasing, with preset regular increase and with tool Associated ad hoc rules of body business etc., for example, the create-rule of above-mentioned prize ID may be configured as starting natural increasing with 0001 (i.e. 0001,0002......), the create-rule of prize title may be configured as with preset regular increase, such as totally 1000,1-5 item It is second prize for the first prize, 5-10 item, 11-1000 item is to participate in prize etc.;
By the setting for the data volume that the second option of operation generates needs, which selects to be the shape of input frame Formula can represent for user input data amount information, such as input 100000 and need to generate 100000 datas etc..
With this, user can be according to information, the option of operation etc. shown in above-mentioned regular configuration interface, by choosing, inputting Equal set-up modes complete rule configuration operation, and operating process is very simple, even if not being the use for being very familiar with database relevant operation Above-mentioned rule configuration operation can be also rapidly completed in family, the formation efficiency of storing process script can be improved, to improve subsequent life At the efficiency of test data.
S03 is advised according to the aiming field for being included to target matrix, to target matrix, to the generation of aiming field Then and to the setting result for the data volume that needs generate generate storing process script.
That is, can according in S02 to the setting of target matrix, the aiming field for being included to target matrix It is arranged, the setting to the setting of the create-rule of target word segment value, the data volume generated to needs, generates corresponding storing process Script, namely generate including target matrix, aiming field (being generated according to the field value create-rule of setting) and meet institute Need the storing process script of data volume.
Storing process script is sent to database by S04, executes storing process script in the database will pass through with life At test data.
About execution storing process script in the database to generate test data, it may include a variety of implementations, for example, In an implementation mode, after database receives above-mentioned storing process script, the life of perform script can be used for by calling (such as preset MySQL order etc.) is enabled, is immediately performed the storing process script to generate test data, so as to most fast speed Degree generates test data, uses for system testing, to guarantee the formation efficiency of test data;Under another implementation, when After database receives above-mentioned storing process script, the order of perform script can be used for by calling, timing to execute primary this and deposits Process scripts are stored up to generate test data, wherein can be configured according to actual needs to the time corresponding to the timing, at this In embodiment, it may be configured as every 12 hours (the storing process script of execution in i.e. every 12 hours), it, can be according to the reality of system with this The prespecified execution frequency for storing process script of border demand, more to meet actual demand, and can save system resource.
With this, can by providing above-mentioned relevant operation interface (regular configuration interface, database attended operation interface etc.), and After carrying out simple and quick configuration operation in relevant operation interface, that is, the storing process script for meeting configuration needs is produced, The storing process script is sent in database to execute and can quickly generate the test data for meeting cooperation demand, and without examining Consider amount of test data size and Test data generation especially in the biggish situation of required amount of test data, is greatly improved with this Efficiency.
In the present embodiment, during executing above-mentioned storing process script in the database, can timing (such as with preset Time interval, such as every 1 minute) record implementation progress information, wherein may include in implementation progress information and storing process script Relevant database-name (such as title of above-mentioned target database), data table name (such as the table of above-mentioned target matrix Name), currently generated the record number of test data, (for example implementation progress is percentage corresponding with current implementation progress 20%).
Based on this, in the present embodiment, it can also be sent to database and obtain the implementation progress for being directed to storing process script Request can be fed back according to the implementation progress information of its record after database receives the request, with this, then can receive To database return implementation progress information and show.
The progress situation and relevant information that storing process script can be executed convenient for user's timely learning database as a result, into And promote user experience.
In addition, after database is completed to generate test data for above-mentioned storing process script execution, it is also recordable to hold Row result information, wherein may include the record number of test data generated in the execution result information, the duration of execution (holds The total duration of row storage scenario process), data table information relevant to storing process script (such as the table of above-mentioned target matrix The information such as name, table structure).
Based on this, in the present embodiment, it can also be sent to database and obtain the implementing result for being directed to storing process script Request can be fed back according to the execution result information of its record after database receives the request, with this, then can receive The execution result information returned to database and display.
The performance and relevant information that storing process script can be executed convenient for user's timely learning database as a result, into And promote user experience.
According to each embodiment of the present embodiment, the regular configuration interface for generating storing process script can be shown, Including the table information for the tables of data for including in database, field information and for field create-rule to be arranged, generates number According to the option of operation of amount, is matched in user according to information and option of operation the completion rule shown in regular configuration interface and postponed, root Generate storing process script according to configuration result and be sent to database, so as to after database executes the storing process script with life At test data.By this programme, when in providing a Test data generation tool easy to operate indirectly, by correlation Simple configuration operation is carried out in interface, can be quickly generated and be met configuration needs and the storage executed into database can be transmitted Process scripts, to quickly generate test data in the database and without considering that the size of required amount of test data can with this The formation efficiency of test data is improved, and is particularly suitable for the larger situation of required amount of test data, and then phase relation can be improved The efficiency of unified test examination.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.
Embodiment two
It is raw to provide a kind of test data in the present embodiment for the test data generating method provided in one based on the above embodiment At device, specifically, Fig. 2 to 3 shows the optional structural block diagram of the Test data generation device, Test data generation dress It sets and is divided into one or more program modules, one or more program module is stored in storage medium, and by one Or performed by multiple processors, to complete the present invention.The so-called program module of the present invention is refer to complete specific function one Family computer program instruction section is more suitable for describing execution of the Test data generation device in storage medium than program itself Journey, the function of each program module of the present embodiment will specifically be introduced by being described below.
As shown in Fig. 2, the Test data generation device 20 can include:
Regular configuration interface display module 21 can be used for showing regular configuration interface, include in the rule configuration interface Field information that table information, each tables of data correspondence for each tables of data for including in database include, the life for field value to be arranged At the first option of operation of rule, for the second option of operation for needing the data volume generated to be arranged;
Rule configuration receiving module 22, can be used for receiving user in the regular configuration interface according to table information to target The setting of tables of data, passes through the first option of operation at the setting for the aiming field for being included to target matrix according to field information Setting to the create-rule of target word segment value, the setting by the second option of operation to the data volume for needing to generate;
Storing process script generation module 23 can be used for according to target matrix, the mesh for being included to target matrix Marking-up section generates storing process script to the create-rule of aiming field and to the setting result for the data volume that needs generate;
Test data generation module 24 can be used for storing process script being sent to database, will pass through in database Middle execution storing process script is to generate test data.
Further, Test data generation module 24 can be specifically used for:
After database receives the storing process script, the order for being used for perform script is called, is immediately performed described Storing process script is to generate test data, alternatively, timing executes the storing process script to generate test data.
Further, shown in referring to Fig. 3, which may also include that
Operation interface provides module 31, can be used for providing the operation interface for connecting database;
Link order receiving module 32 can be used for receiving the instruction that user connects database by operation interface;
Database connection module 33 can be used for executing the operation of connection database according to above-metioned instruction;
Data obtaining module 34 can be used for obtaining the table information for each tables of data for including in database, each tables of data pair The field information that should include, to be shown in regular configuration interface, wherein the table information of each tables of data includes each tables of data Table name, table structure, the field information of each tables of data includes the major key of each tables of data, external key.
Further, in operation interface include third option of operation for inputting target database relevant information.
Based on this, link order receiving module 32 can be specifically used for:
The Target database name of user's input and the server name of target database are received by third option of operation The IP address and port information of title and/or the server of target database.
Further, database connection module 33 can be specifically used for:
According to the driver of the instruction load JAVA database of connection database;
Link information is obtained, link information includes connection protocol, connection sub-protocol, data source identification;
The request that connection is established with JAVA data is sent according to the link information;
Create the Statement object for executing SQL statement;
The SQL statement for inquiring JAVA database is executed based on Statement object;
Receive the processing result that database returns;
The connection with JAVA database is closed according to processing result.
Further, which may also include that
Execution result information logging modle, can be used for database execute storing process script with generate test data it Afterwards, execution result information is recorded.
Wherein, execution result information includes the duration and storing process script of the record number of the test data generated, execution Relevant data table information.
Based on this, which may also include that
Implementing result obtains module, can be used for sending the implementing result obtained for the storing process script to database Request;
Information receiving module can be used for receiving the execution result information of database return and display.
Further, which may also include that
Implementation progress information logging modle can be used for during database executes storing process script, time recording Implementation progress information.
Wherein, implementation progress information includes database-name relevant to storing process script, data table name, has currently given birth to At the record number of test data, the corresponding percentage of current implementation progress;
Based on this, which may also include that
Implementation progress obtains module, can be used for obtaining asking for the implementation progress for being directed to storing process script to database transmission It asks;
Information receiving module, it may also be used for receive the implementation progress information that database returns and show.
About the device in above-described embodiment, wherein each unit, module execute the concrete mode of operation related It is described in detail in the embodiment of this method, no detailed explanation will be given here.
Each embodiment through this embodiment can show the regular configuration interface for generating storing process script, Including the table information for the tables of data for including in database, field information and for field create-rule to be arranged, generates number According to the option of operation of amount, is matched in user according to information and option of operation the completion rule shown in regular configuration interface and postponed, root Generate storing process script according to configuration result and be sent to database, so as to after database executes the storing process script with life At test data.By this programme, when in providing a Test data generation tool easy to operate indirectly, by correlation Simple configuration operation is carried out in interface, can be quickly generated and be met configuration needs and the storage executed into database can be transmitted Process scripts, to quickly generate test data in the database and without considering that the size of required amount of test data can with this The formation efficiency of test data is improved, and is particularly suitable for the larger situation of required amount of test data, and then phase relation can be improved The efficiency of unified test examination.
Embodiment three
The present embodiment also provides a kind of computer equipment, can such as execute the smart phone, tablet computer, notebook of program Computer, desktop computer, rack-mount server, blade server, tower server or Cabinet-type server are (including independent Server cluster composed by server or multiple servers) etc..As shown in figure 4, the computer equipment 40 of the present embodiment to It is few to include but is not limited to: memory 41, the processor 42 of connection can be in communication with each other by system bus, as shown in Figure 4.It needs to refer to Out, Fig. 4 illustrates only the computer equipment 40 with component 41-42, it should be understood that being not required for implementing all The component shown, the implementation that can be substituted is more or less component.
In the present embodiment, memory 41 (i.e. readable storage medium storing program for executing) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, magnetic Disk, CD etc..In some embodiments, memory 41 can be the internal storage unit of computer equipment 40, such as the calculating The hard disk or memory of machine equipment 40.In further embodiments, memory 41 is also possible to the external storage of computer equipment 40 The plug-in type hard disk being equipped in equipment, such as the computer equipment 40, intelligent memory card (Smart Media Card, SMC), peace Digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, memory 41 can also both include meter The internal storage unit for calculating machine equipment 40 also includes its External memory equipment.In the present embodiment, memory 41 is commonly used in storage Be installed on the operating system and types of applications software of computer equipment 40, for example, embodiment two Test data generation device journey Sequence code etc..In addition, memory 41 can be also used for temporarily storing the Various types of data that has exported or will export.
Processor 42 can be in some embodiments central processing unit (Central Processing Unit, CPU), Controller, microcontroller, microprocessor or other data processing chips.The processor 42 is commonly used in control computer equipment 40 overall operation.In the present embodiment, program code or processing data of the processor 42 for being stored in run memory 41, Such as Test data generation device etc..
Example IV
The present embodiment also provides a kind of computer readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, magnetic Disk, CD, server, App are stored thereon with computer program, phase are realized when program is executed by processor using store etc. Answer function.The computer readable storage medium of the present embodiment is used for Test data generation device, realizes when being executed by processor real Apply the test data generating method of example one.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of test data generating method, which comprises the steps of:
S01, shows regular configuration interface, includes the table letter for each tables of data for including in the rule configuration interface in database Breath, the field information that each tables of data correspondence includes, the first option of operation of create-rule for field value to be arranged, for being arranged Second option of operation of the data volume for needing to generate;
S02, reception user is in the regular configuration interface according to table information to the setting of target matrix, according to field information The setting for the aiming field for being included to target matrix, the setting to the create-rule of target word segment value by the first option of operation The setting of the data volume set, needs generated by the second option of operation;
S03, according to the aiming field for being included to target matrix, to target matrix, to the create-rule of aiming field with And storing process script is generated to the setting result for the data volume that needs generate;
Storing process script is sent to database by S04, executes the storing process script in the database will pass through with life At test data.
2. test data generating method according to claim 1, which is characterized in that by executing in the database in S04 The storing process script is to generate test data, comprising:
After database receives the storing process script, it is used for the order of perform script by calling, is immediately performed described Storing process script is to generate test data, alternatively, timing executes the storing process script to generate test data.
3. test data generating method according to claim 1, which is characterized in that S01 show regular configuration interface it Before, further includes:
Operation interface for connecting database is provided;
The instruction that user connects database is received by the operation interface;
According to the operation of the instruction execution connection database of the connection database;
The field information that table information, each tables of data correspondence of each tables of data for including in database include is obtained, in the rule Then shown in configuration interface;
Wherein, the table information of each tables of data includes the table name of each tables of data, table structure, the field information of each tables of data Major key, external key including each tables of data.
4. test data generating method according to claim 3, which is characterized in that include for defeated in the operation interface Enter the third option of operation of target database relevant information;
The instruction that user connects database is received by the operation interface, comprising:
The Target database name of user's input and the server name of target database are received by the third option of operation The IP address and port information of title and/or the server of target database.
5. test data generating method according to claim 3, which is characterized in that according to the instruction of the connection database Execute the operation of connection database, comprising:
According to the driver of the instruction load JAVA database of the connection database;
Link information is obtained, the link information includes connection protocol, connection sub-protocol, data source identification;
The request that connection is established with JAVA data is sent according to the link information;
Create the Statement object for executing SQL statement;
The SQL statement for inquiring JAVA database is executed based on Statement object;
Receive the processing result that database returns;
The connection with JAVA database is closed according to processing result.
6. test data generating method according to claim 2, which is characterized in that further include:
After database executes the storing process script to generate test data, execution result information, the execution are recorded Result information includes the record number, the duration of execution, data table information relevant to storing process script of the test data generated;
The method also includes:
The request for obtaining the implementing result for the storing process script is sent to database;
Receive the execution result information that database returns and display.
7. test data generating method according to claim 2, which is characterized in that further include:
During database executes the storing process script, time recording implementation progress information, the implementation progress letter Breath includes database-name relevant to storing process script, data table name, the record number for currently having generated test data, current The corresponding percentage of implementation progress;
The method also includes:
The request for obtaining the implementation progress for the storing process script is sent to database;
It receives the implementation progress information that database returns and shows.
8. a kind of Test data generation device characterized by comprising
Regular configuration interface display module includes in database in the rule configuration interface for showing regular configuration interface Field information, the create-rule for field value to be arranged that table information, each tables of data correspondence for each tables of data for including include First option of operation, the second option of operation for the data volume that needs generate to be arranged;
Rule configuration receiving module, for receive user in the regular configuration interface according to table information to target matrix Be arranged, the setting of the aiming field that is included to target matrix according to field information, by the first option of operation to target word The setting of the create-rule of segment value, the setting for the data volume that needs are generated by the second option of operation;
Storing process script generation module, for according to the aiming field, right for being included to target matrix, to target matrix The setting result generation storing process script of the create-rule of aiming field and the data volume that needs are generated;
Test data generation module executes institute for storing process script to be sent to database will pass through in the database Storing process script is stated to generate test data.
9. a kind of computer equipment, the computer equipment include memory, processor and storage on a memory and can be The computer program run on processor, which is characterized in that the processor realizes claim 1 to 7 when executing described program The step of any one the method.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that: described program is processed The step of any one of claim 1 to 7 the method is realized when device executes.
CN201811534708.XA 2018-12-14 2018-12-14 Test data generating method, device, computer equipment and readable storage medium storing program for executing Pending CN109815252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811534708.XA CN109815252A (en) 2018-12-14 2018-12-14 Test data generating method, device, computer equipment and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811534708.XA CN109815252A (en) 2018-12-14 2018-12-14 Test data generating method, device, computer equipment and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109815252A true CN109815252A (en) 2019-05-28

Family

ID=66602037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811534708.XA Pending CN109815252A (en) 2018-12-14 2018-12-14 Test data generating method, device, computer equipment and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN109815252A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399303A (en) * 2019-07-29 2019-11-01 中国工商银行股份有限公司 For the method for setup test data, data preparation device and electronic equipment
CN110516008A (en) * 2019-08-14 2019-11-29 北京海致星图科技有限公司 A kind of method of structural map platform test data
CN110851357A (en) * 2019-11-04 2020-02-28 紫光云技术有限公司 Test data automatic construction method based on multiple database types
CN110908891A (en) * 2019-09-18 2020-03-24 泰康保险集团股份有限公司 Test data generation method and device, electronic equipment and storage medium
CN111159040A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Test data generation method, device, equipment and storage medium
CN111176976A (en) * 2019-08-05 2020-05-19 腾讯科技(深圳)有限公司 Test data generation method and device, storage medium and electronic device
CN111290948A (en) * 2020-01-19 2020-06-16 腾讯科技(深圳)有限公司 Test data acquisition method and device, computer equipment and readable storage medium
CN111625455A (en) * 2020-05-26 2020-09-04 中国建设银行股份有限公司 Program testing method, device, equipment and medium
CN112241369A (en) * 2020-10-16 2021-01-19 四川长虹电器股份有限公司 Automatic interface testing method based on python
CN112579248A (en) * 2019-09-27 2021-03-30 北京国双科技有限公司 Data generation method and device
CN112685288A (en) * 2020-12-03 2021-04-20 福建亿能达信息技术股份有限公司 Method, device, equipment and medium for generating test data of association table
CN113138933A (en) * 2021-05-13 2021-07-20 网易(杭州)网络有限公司 Data table testing method, electronic device and storage medium
CN113569547A (en) * 2020-04-28 2021-10-29 北京国双科技有限公司 Police service system test method and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030154197A1 (en) * 2002-02-13 2003-08-14 Permutta Technologies Flexible relational data storage method and apparatus
US20150310075A1 (en) * 2014-04-23 2015-10-29 Gerald Mescal Database interface creation system and method
CN105512042A (en) * 2015-12-22 2016-04-20 广东金赋信息科技有限公司 Automatic generation method and device for testing data of database and testing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030154197A1 (en) * 2002-02-13 2003-08-14 Permutta Technologies Flexible relational data storage method and apparatus
US20150310075A1 (en) * 2014-04-23 2015-10-29 Gerald Mescal Database interface creation system and method
CN105512042A (en) * 2015-12-22 2016-04-20 广东金赋信息科技有限公司 Automatic generation method and device for testing data of database and testing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林达德;: "用Javabean构建数据过滤的Script代码生成器", 宁波职业技术学院学报, no. 05 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399303A (en) * 2019-07-29 2019-11-01 中国工商银行股份有限公司 For the method for setup test data, data preparation device and electronic equipment
CN110399303B (en) * 2019-07-29 2024-01-26 中国工商银行股份有限公司 Method for preparing test data, data preparation device and electronic equipment
CN111176976A (en) * 2019-08-05 2020-05-19 腾讯科技(深圳)有限公司 Test data generation method and device, storage medium and electronic device
CN111176976B (en) * 2019-08-05 2022-02-08 腾讯科技(深圳)有限公司 Test data generation method and device, storage medium and electronic device
CN110516008A (en) * 2019-08-14 2019-11-29 北京海致星图科技有限公司 A kind of method of structural map platform test data
CN110908891A (en) * 2019-09-18 2020-03-24 泰康保险集团股份有限公司 Test data generation method and device, electronic equipment and storage medium
CN112579248A (en) * 2019-09-27 2021-03-30 北京国双科技有限公司 Data generation method and device
CN110851357A (en) * 2019-11-04 2020-02-28 紫光云技术有限公司 Test data automatic construction method based on multiple database types
CN111159040A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Test data generation method, device, equipment and storage medium
CN111290948A (en) * 2020-01-19 2020-06-16 腾讯科技(深圳)有限公司 Test data acquisition method and device, computer equipment and readable storage medium
CN111290948B (en) * 2020-01-19 2022-02-22 腾讯科技(深圳)有限公司 Test data acquisition method and device, computer equipment and readable storage medium
CN113569547A (en) * 2020-04-28 2021-10-29 北京国双科技有限公司 Police service system test method and related device
CN111625455A (en) * 2020-05-26 2020-09-04 中国建设银行股份有限公司 Program testing method, device, equipment and medium
CN112241369A (en) * 2020-10-16 2021-01-19 四川长虹电器股份有限公司 Automatic interface testing method based on python
CN112241369B (en) * 2020-10-16 2022-06-21 四川长虹电器股份有限公司 Automatic interface testing method based on python
CN112685288A (en) * 2020-12-03 2021-04-20 福建亿能达信息技术股份有限公司 Method, device, equipment and medium for generating test data of association table
CN113138933A (en) * 2021-05-13 2021-07-20 网易(杭州)网络有限公司 Data table testing method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN109815252A (en) Test data generating method, device, computer equipment and readable storage medium storing program for executing
CN106940428B (en) Chip verification method, device and system
CN109302522A (en) Test method, device and computer system and medium
CN111813661B (en) Global service data drive automatic test method, device, equipment and medium
CN106682036A (en) Data exchange system and exchange method thereof
US7636740B2 (en) Database cache system
CN107590075A (en) A kind of method for testing software and device
CN110557299A (en) network transmission function batch test method, system, terminal and storage medium
CN110362490B (en) Automatic testing method and system for integrating iOS and Android mobile applications
CN114328217A (en) Application testing method, device, equipment, medium and computer program product
CN108427635A (en) Quickly method, server and the computer readable storage medium of test web page
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN110347735A (en) The data forwarding of configurationization mends processing method, device and readable storage medium storing program for executing extremely
CN108427634A (en) Electronic device, the method for test and computer readable storage medium
CN111262753A (en) Method, system, terminal and storage medium for automatically configuring number of NUMA nodes
CN112559525B (en) Data checking system, method, device and server
CN112329273B (en) Method and device for improving chip verification efficiency, storage medium and terminal
CN115994085A (en) Code coverage rate test processing method, device, equipment and storage medium
CN111176924B (en) GPU card dropping simulation method, system, terminal and storage medium
CN112217886A (en) Testing method and system of distributed system, message production and consumption module
CN112463633B (en) Method, device, equipment and medium for checking address decoding of on-chip memory
CN111124890B (en) Distributed database performance test method, system, terminal and storage medium
CN109840213B (en) Test data creating method, device, terminal and storage medium for GUI test
CN111367894A (en) Data comparison method and device based on database migration
CN110650063A (en) Centralized bank third-party software simulation system and method

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