CN109634836A - Test data packaging method, device, equipment and storage medium - Google Patents
Test data packaging method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109634836A CN109634836A CN201811238550.1A CN201811238550A CN109634836A CN 109634836 A CN109634836 A CN 109634836A CN 201811238550 A CN201811238550 A CN 201811238550A CN 109634836 A CN109634836 A CN 109634836A
- Authority
- CN
- China
- Prior art keywords
- parameter
- data
- evidence
- target
- test
- 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.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 92
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004806 packaging method and process Methods 0.000 title claims abstract description 31
- 238000005538 encapsulation Methods 0.000 claims abstract description 24
- 238000000586 desensitisation Methods 0.000 claims description 52
- 241000208340 Araliaceae Species 0.000 claims description 36
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 36
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 36
- 235000008434 ginseng Nutrition 0.000 claims description 36
- 230000015654 memory Effects 0.000 claims description 15
- 238000013507 mapping Methods 0.000 claims description 8
- 239000000284 extract Substances 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims 1
- 238000013522 software testing Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000000977 initiatory effect Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 239000003999 initiator Substances 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000005611 electricity Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013497 data interchange Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
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/3696—Methods or tools to render software testable
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 present invention relates to automation software testing, a kind of test data packaging method, device, equipment and storage medium are disclosed, this method comprises: by receiving parameter acquisition instruction, the inquiry field for including in extracting parameter acquisition instruction;That preset quantity is chosen from inquiry field enters parameter evidence, is searched in preset electrical form into parameter according to corresponding parameter evidence out;The evidence of parameter out is packaged to obtain encapsulation of data, since test data packaging method provided by the invention does not need to obtain out parameter evidence from the called system in outside or interconnected system, but corresponding parameter evidence out is inquired from preset electrical form according to the parameter evidence that enters got, then it is returned after being packaged to the evidence of parameter out, it avoids called system and the case where can not be successfully feedback returned data when unstable or delay machine occurs, ensure that going on smoothly for automatic test.
Description
Technical field
The present invention relates to software testing technology field more particularly to a kind of test data packaging method, device, equipment and deposit
Storage media.
Background technique
With the fast development of Internet technology and computer software technology, automatic test improves test because having
Efficiency shortens many advantages, such as regression test time, release manpower and is widely used in software service industry.Usual situation
Under, in the development cycle process of project, require to do one to the calling interface of program before application issued is online
A little comprehensive tests, including automatic test.
Based on the reason of existing enterprise-level project or program are essentially all distributed collaborative, interface is carried out in multisystem
When the automatic test of calling, interface calling system needs to obtain return parameters from called system (or interconnected system) to complete
Automatic test, but can not be successfully instead once the case where unstable or delay machine occurs in called system during actual test
Return parameters are presented, therefore, how to guarantee the normal acquisition of return parameters and going on smoothly for automatic test, becomes one
Urgent problem to be solved.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of test data packaging method, device, equipment and storage medium, purports
The technical issues of automatic test is gone on smoothly can not be effectively ensured solving existing measuring technology.
To achieve the above object, it the present invention provides a kind of test data packaging method, the described method comprises the following steps:
Parameter acquisition instruction is received, the inquiry field for including in the parameter acquisition instruction is extracted;
That preset quantity is chosen from the inquiry field enters parameter evidence, enters parameter described in lookup in preset electrical form
According to corresponding parameter evidence out;
The evidence of parameter out is packaged to obtain encapsulation of data.
Preferably, before described the step of being packaged the evidence of parameter out to obtain encapsulation of data, the method packet
It includes:
Read locally prestore data desensitization rule, according to the data desensitization rule to it is described go out parameter according to carry out data
Desensitization obtains target data;
The described the step of evidence of parameter out is packaged to obtain encapsulation of data, comprising:
The target data is packaged to obtain encapsulation of data.
Preferably, described to read the data desensitization rule locally prestored, go out to join to described according to data desensitization rule
Before the step of data carry out data desensitization, obtain target data, the method also includes:
The terminal iidentification for including in the parameter acquisition instruction is obtained, the end is searched in the mapping relations constructed in advance
End identifies corresponding target data format;
The current data format of the parameter evidence out is obtained, and detects the current data format and the target data lattice
Whether formula is consistent;
If consistent, the step of the data desensitization rule for reading and locally prestoring is executed.
Preferably, the current data format of parameter evidence is gone out described in the acquisition, and detects the current data format and institute
After stating the whether consistent step of target data format, the method also includes:
If inconsistent, the parameter out is obtained according to formatting wait desensitize according to the target data format
Data;
The data desensitization rule that the reading locally prestores, according to data desensitization rule to the parameter out according to progress
The step of data desensitization, acquisition target data, including
The data desensitization rule locally prestored is read, the data to be desensitized are counted according to data desensitization rule
According to desensitization, target data is obtained.
Preferably, the reception parameter acquisition instruction extracts the step for the inquiry field for including in the parameter acquisition instruction
Before rapid, the method also includes:
Parameter configuration instruction is received, corresponding electronic watch is obtained according to the template identification for including in parameter configuration instruction
Grid template includes at least into ginseng list items in the corresponding list item to be configured of the electronic form template and goes out ginseng list items;
Receive based on it is described enter join list items input enter parameter evidence, and based on it is described go out ginseng list items input go out to join
Data;
The parameter that enters received is associated according to the evidence of parameter out, and the electronic form template is written into association results
To obtain preset electrical form.
Preferably, described to choose preset quantity from the inquiry field and enter parameter evidence, it looks into preset electrical form
Look for it is described enter parameter according to it is corresponding go out parameter according to the step of, comprising:
That preset quantity is chosen from the inquiry field enters parameter evidence, is entered according to include in the preset electrical form
Parameter enters parameter according to matching according to selection;
The target for obtaining successful match enters parameter evidence, and obtains the target according to the association results and enter parameter according to correspondence
Go out parameter evidence.
Preferably, it is described from it is described inquiry field in choose preset quantity enter parameter according to the step of, comprising:
The parameter to be matched for including in the inquiry field is read, is detected in the parameter to be matched with the presence or absence of having and institute
State the identical target component of the data stored in preset electrical form;
The number of parameters of the target component is then obtained if it exists, and detects whether the number of parameters is more than default threshold
Value;
The parameter of preset quantity is chosen from the target component if being more than as parameter evidence is entered, the preset quantity is small
In the preset threshold;
If being no more than, using the target component as entering parameter evidence.
In addition, to achieve the above object, the present invention also proposes a kind of test data packaging system, described device includes:
Field obtains module and extracts the inquiry word for including in the parameter acquisition instruction for receiving parameter acquisition instruction
Section;
Data search module enters parameter evidence for choosing preset quantity from the inquiry field, in preset electronic watch
Enter parameter described in searching in lattice according to corresponding parameter evidence out;
Data package module, for being packaged the evidence of parameter out to obtain encapsulation of data.
In addition, to achieve the above object, the present invention also proposes a kind of test data sealed in unit, the equipment includes: to deposit
Reservoir, processor and it is stored in the test data canned program that can be run on the memory and on the processor, it is described
Test data canned program is arranged for carrying out the step of test data packaging method as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, test is stored on the storage medium
Data canned program, the test data canned program realize test data encapsulation side as described above when being executed by processor
The step of method.
The present invention is by receiving parameter acquisition instruction, the inquiry field for including in extracting parameter acquisition instruction;From inquiry word
That preset quantity is chosen in section enters parameter evidence, is searched in preset electrical form into parameter according to corresponding parameter evidence out;To ginseng out
Data are packaged to obtain encapsulation of data, since test data packaging method provided by the invention does not need to be adjusted from outside
Parameter evidence is obtained out with system or interconnected system, but enters parameter according to the inquiry correspondence from preset electrical form according to what is got
Go out parameter evidence, then to parameter out according to returning after being packaged, avoid when there is unstable or delay machine in called system without
Method smoothly feeds back the case where returned data, ensure that going on smoothly for automatic test.
Detailed description of the invention
Fig. 1 is the structural representation of the test data sealed in unit for the hardware running environment that the embodiment of the present invention is related to
Figure;
Fig. 2 is the flow diagram of test data packaging method first embodiment of the present invention;
Fig. 3 is the flow diagram of test data packaging method second embodiment of the present invention;
Fig. 4 is the flow diagram of test data packaging method 3rd embodiment of the present invention;
Fig. 5 is the structural block diagram of test data packaging system first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the test data sealed in unit structure for the hardware running environment that the embodiment of the present invention is related to
Schematic diagram.
As shown in Figure 1, the test data sealed in unit may include: processor 1001, such as central processing unit
(Central Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory
1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display
Shield (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include that the wired of standard connects
Mouth, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as Wireless Fidelity
(WIreless-FIdelity, WI-FI) interface).Memory 1005 can be the random access memory (Random of high speed
Access Memory, RAM) memory, be also possible to stable nonvolatile memory (Non-Volatile Memory,
), such as magnetic disk storage NVM.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 does not constitute the limit to test data sealed in unit
It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, data storage mould in a kind of memory 1005 of storage medium
Block, network communication module, Subscriber Interface Module SIM and test data canned program.
In test data sealed in unit shown in Fig. 1, network interface 1004 is mainly used for being counted with network server
According to communication;User interface 1003 is mainly used for carrying out data interaction with user;Processing in test data sealed in unit of the present invention
Device 1001, memory 1005 can be set in test data sealed in unit, and the test data sealed in unit passes through processor
The test data canned program stored in 1001 calling memories 1005, and execute test data envelope provided in an embodiment of the present invention
Dress method.
The embodiment of the invention provides a kind of test data packaging methods, are test data of the present invention envelope referring to Fig. 2, Fig. 2
The flow diagram of dress method first embodiment.
In the present embodiment, the test data packaging method the following steps are included:
Step S10: parameter acquisition instruction is received, the inquiry field for including in the parameter acquisition instruction is extracted;
It is constructed it should be noted that the executing subject of the present embodiment method can be developer according to actual test demand
Virtual test system (hereinafter referred to as mock system), the mock system be used for simulate in actual test called system (or
Interconnected system) with interface calling system data interaction is carried out, it, can not will be wait adjust thus when avoiding interconnected system unstable or delay machine
Test is caused to can not be successfully the case where carrying out according to the normal interface calling system that is back to the corresponding parameter out of interface.
It should be understood that mock system can receive interface calling system (such as client or shifting in automatic test course
Dynamic terminal) parameter acquisition instruction that sends, parsing then is carried out to instruction and reads inquiry field wherein included, the inquiry word
Section, which can be interface calling system and pass to mock system, carries out field data matched into ginseng, different dimensions, including but not
It is limited to parameter etc. required when title, path and the interface calling of interface to be called.
Step S20: that preset quantity is chosen from the inquiry field enters parameter evidence, and institute is searched in preset electrical form
It states into parameter according to corresponding parameter evidence out;
It should be noted that developer can construct one in advance and deposit in the form of a spreadsheet before executing this step
Store up different test cases it is corresponding enter ginseng and the automatic test database of parameter evidence out, i.e., the described preset electrical form;It is described
Preset electrical form can be the electrical form of different document format, in the present embodiment and following each embodiments, the preset electricity
Sub-table is preferably Excel table.
Further, the corresponding field data of each test cases includes at least in the Excel table: entering ginseng column and goes out to join
The list items such as column.Developer can configure corresponding parameter for each list item, for example, be into ginseng column configuration it is corresponding enter parameter evidence
" { " entering ginseng 1 ": " value1 ", " entering ginseng 2 ": " value2 " } " goes out to join the corresponding parameter out of column configuration according to " [{ " key1 ": "
Value1 " }, { " key2 ": " value2 " }] ", and enter parameter evidence and it is corresponding go out parameter it is mutual according to that can be come by case coding
Association.
Further, developer, can also be according to test cases applied field when constructing the automatic test database
The difference of scape encodes to set case, to distinguish mutually independent test cases.Wherein, the format of the case coding can basis
In " interface number+scene number " Lai Dingyi, such as case coding " 101001000000 ", interface number is " 10100 ", and scene number is
" 1000000 ", the specific test scene that the scene number is directed to characterization test case.
In addition, it is understood that being generally comprised in the inquiry field that interface calling system transmits during actual test more
A parameter;By taking Account Registration as an example, interface calling system transmitting parameter (the i.e. described inquiry field) in generally comprise user name,
The parameters such as password, gender, age, registered address, it is equal to all parameters but if mock system is when getting above-mentioned parameter
The workload of mock system can undoubtedly be increased by carrying out Data Matching, reduce testing efficiency.Therefore, in the present embodiment, mock system
When getting the inquiry field, enter parameter evidence for choose preset quantity from the inquiry field, such as choose " user
Name, password, registered address " as enter parameter according to carry out it is subsequent go out parameter evidence matching.
Further, the specific value of the preset quantity and the design parameter of selection can be according to the preset electronic watches
Include in lattice enters parameter according to determining, specifically, mock system is after getting inquiry field, it can according to preset electrical form
Storage enters parameter evidence to carry out all parameters to be matched carried in inquiry field comprising matching, to detect preset electronic watch
The parameter that enters of lattice storage (is examined in the presence or absence of the parameter to be matched carried in one or more data and inquiry field is identical
Survey and whether there is identical parameters), if it exists then using the number of the identical parameters as the preset quantity, and will be described identical
Parameter enters parameter evidence described in being used as.Wherein, described comprising matching, that is, whether at least to detect in the parameter that the inquiry field includes
Have a parameter be contained in Excel table it is any enter ginseng column in configure enter parameter evidence, then show successful match if it exists, such as
Inquire field include tri- parameters to be matched of a, b, c, if in Excel table xth row enter ginseng column in configure enter parameter according to comprising
[a, e, f], then inquire in field that there are parameter a to be matched to be contained in into parameter according to [a, e, f], can determine that at this time matching at
Function, it is subsequent corresponding parameter evidence out to be searched in preset electrical form according to [a, e, f] according to the parameter that enters of successful match.
Certainly, in the concrete realization, mock system can also be by reading the ginseng to be matched for including in the inquiry field
Number, detecting, which whether there is in the parameter to be matched, has target identical with the data stored in the preset electrical form to join
Number;The number of parameters of the target component is then obtained if it exists, and detects whether the number of parameters is more than preset threshold;If super
It crosses, the parameter that preset quantity is chosen from the target component is used as parameter evidence;If being no more than, by the target component
As parameter evidence is entered, parameter is then entered according to progress according to selection according to the parameter that enters for including in the preset electrical form
Match;The target for obtaining successful match enters parameter evidence, and according to the association results obtain the target enter parameter according to it is corresponding go out
Parameter evidence, wherein the preset quantity is less than or equal to the preset threshold.
Step S30: the evidence of parameter out is packaged to obtain encapsulation of data.
It should be understood that data and behavior (or function) that so-called encapsulation will be abstracted combine, forming one has
The entirety of machine makes influencing each other between inhomogeneity to reach the reasonable control to visitor or caller access authority
Minimize, and then enhances the safety of data.Therefore in the present embodiment, mock system is from preset electrical form
Parameter is got out after, then encapsulation of data can be back to by the parameter out according to being packaged to obtain encapsulation of data
The initiator of the parameter acquisition instruction guarantees going on smoothly for entire automatic test.
The present embodiment is by receiving parameter acquisition instruction, the inquiry field for including in extracting parameter acquisition instruction;From inquiry
That preset quantity is chosen in field enters parameter evidence, is searched in preset electrical form into parameter according to corresponding parameter evidence out;To out
Parameter is according to being packaged to obtain encapsulation of data, since test data packaging method provided in this embodiment is not needed from outside
Called system or interconnected system obtain out parameter evidence, but are inquired according to the parameter that enters got according to from preset electrical form
Corresponding parameter evidence out avoids called system and unstable or delay machine occurs then to parameter out according to returning after being packaged
When can not be successfully feedback returned data the case where, ensure that going on smoothly for automatic test.
With reference to Fig. 3, Fig. 3 is the flow diagram of test data packaging method second embodiment of the present invention.
Based on above-mentioned first embodiment, in the present embodiment, before the step S30, which comprises
Step S201: the data desensitization rule that reading locally prestores, according to data desensitization rule to the parameter out
According to data desensitization is carried out, target data is obtained;
It should be understood that the privacy number for relating to userspersonal information may be carried in by going out parameter in practical applications
According to (such as identification card number, cell-phone number, card number, customer ID etc.) or commercial sensitive data, to guarantee that these data are not let out
Dew, the present embodiment mock system need to carry out data desensitization to it after getting out parameter evidence.It is opened before carrying out data desensitization
Hair personnel can be directed to different test cases according to the actual situation and write corresponding data desensitization rule, then be saved to
The corresponding memory space of mock system.
It will be appreciated that the data desensitization refers under the conditions of not violating system convention, truthful data is transformed
And test is provided and is used, i.e., certain sensitive informations or data are carried out with the deformation of data by desensitization rule, realizes privacy-sensitive
The reliably protecting of data.
In the concrete realization, mock system reads the data desensitization rule locally prestored, is then desensitized according to the data
Rule, according to data desensitization is carried out, obtains target data, then be packaged the target data to be sealed to the parameter out
Fill data.
Further, it is contemplated that the often relatively fixed (example of the corresponding data format of the data stored in preset electrical form
Such as, generally object numbered musical notation (JavaScript Object Notation, JSON) format), and the initiation of parameter acquisition instruction
It side may be with current parameter out according to difference, therefore, in order to ensure that parameter acquisition refers in the data format used when data processing
The data format data processing format corresponding with itself for going out parameter evidence that the initiator of order receives is consistent, and then reduces data
The workload of processing, in the present embodiment mock system to parameter out according to data desensitization is carried out before, also following steps will be executed:
Step S21 ': obtaining the terminal iidentification for including in the parameter acquisition instruction, in the mapping relations constructed in advance
Search the corresponding target data format of the terminal iidentification;
It should be noted that the initiator that the terminal iidentification can be the parameter acquisition instruction (hereinafter referred to as initiates
Terminal) corresponding device identification, such as device name, equipment Serial Number, Internet protocol address (Internet Protocol
Address, IP) etc., which can be used for determining the corresponding initiating terminal of the parameter acquisition instruction;The data format
It is the rule for describing data and being stored in file or record, a kind of data interchange format, such as JSON, extensible markup language
XML, hypertext markup language HTML etc..
Further, developer can get the corresponding device identification of all possible initiating terminal and correspondence in advance
Data format, then with the device identification be mapping end source, built using the corresponding data format of initiating terminal as target side source
Mapping relations between vertical device identification and data format, so that the end that mock system includes in getting parameter acquisition instruction
When the mark of end, the corresponding target data format of the terminal iidentification is rapidly and accurately got according to the mapping relations.
Step S22 ': obtain it is described go out parameter evidence current data format, and detect the current data format with it is described
Whether target data format is consistent;
In the concrete realization, mock system also will acquire out parameter according to correspondence after getting the target data format
Current data format, then detect the current data format and whether the target data format consistent, and according to detection
As a result corresponding operating is executed.
Step S23 ': if consistent, the step of the data desensitization rule for reading and locally prestoring is executed.
In the concrete realization, if mock system detection is consistent with target data format to current data format, show nothing
The evidence of parameter out need to need to be only packaged to parameter out according to Data Format Transform is carried out;If detecting current data format
It is inconsistent with target data format, then the evidence of parameter out can be formatted according to the target data format, be obtained
Then data to be desensitized read the data desensitization rule locally prestored, according to data desensitization rule to the number to be desensitized
According to data desensitization is carried out, target data is obtained.
The present embodiment is looked into the mapping relations constructed in advance by the terminal iidentification for including in the acquisition instruction that gets parms
Look for the corresponding target data format of terminal iidentification;Obtain out the current data format of parameter evidence, and detect current data format with
Whether target data format is consistent;If unanimously, the data desensitization rule locally prestored is read, according to data desensitization rule to out
Parameter obtains target data according to data desensitization is carried out;If inconsistent, according to target data format to the parameter out according to progress
Format conversion, obtains data to be desensitized, and then treats desensitization data according to data desensitization rule and carries out data desensitization, obtains target
Data, while user information is not leaked in guaranteeing practical application, it is ensured that eventually return to the encapsulation number of initiating terminal
According to data format accuracy, improve the testing efficiency of entire automatic test.
With reference to Fig. 4, Fig. 4 is the flow diagram of test data packaging method 3rd embodiment of the present invention.
Based on the various embodiments described above, in the present embodiment, before the step S10, the method also includes:
Step S01: receiving parameter configuration instruction, is obtained and is corresponded to according to the template identification for including in parameter configuration instruction
Electronic form template, include at least into ginseng list items in the corresponding list item to be configured of the electronic form template and go out ginseng list
?;
It will be appreciated that the electronic form template can be " blank " electrical form (example for carrying out parameter configuration
Such as Excel table), the template identification, which can be, can distinguish different document format (Word, Excel, TXT) electronic stencil
Character information.
In the concrete realization, mock system is instructed in response to the parameter configuration received, and parsing obtains the parameter configuration and refers to
Then the template identification for including in order obtains corresponding electronic form template according to the template identification from template database.
It should be noted that including multiple list items to be configured in the electronic form template, such as case identifies, enters ginseng
Column go out the list items such as ginseng column, interface IP address, interface description and interface type.Electronic form template described in the present embodiment is corresponding
List item to be configured in include at least into ginseng list items and go out ginseng list items.It is described to enter to join corresponding under list items store into parameter
According to correspondence stores out parameter evidence under the list items of ginseng out.
Step S02: receive based on it is described enter join list items input enter parameter evidence, and based on it is described go out ginseng list items it is defeated
What is entered goes out parameter evidence;
In the concrete realization, mock system can be incited somebody to action after getting the electronic form template by man-machine interaction panel
Electronic form template show developer and prompt developer input in a template accordingly enter ginseng (such as " " enter ginseng
1 ": " value1 ", " entering ginseng 2 ": " value2 " }) or out parameter according to (such as " entering ginseng 3 ": " value3 ", " entering ginseng 4 ": "
value4"})。
Certainly, it is saved extremely after the completion of preset electrical form described in the present embodiment can also be pre-filled with by developer
In mock system, the present embodiment to this with no restriction.
Step S03: the parameter that enters received is associated according to the evidence of parameter out, and the electronics is written into association results
Form template is to obtain preset electrical form.
It should be noted that mock system developer can be inputted enter parameter according to parameter out according to being matched two-by-two
Association, such as parameter will be entered carry out pairing according to a with parameter out according to a to be associated with, if also including case in certain electronic form template
When identifying list item, it can also will enter parameter evidence and parameter, then will be mutual according to being associated respectively with corresponding case mark out
Data after association are written to electronic form template to obtain preset electrical form.
Electrical form of the present embodiment by building comprising different list items, will test out parameter evidence needed for test process
It is stored in also to improve survey while going on smoothly ensure that automatic test in the case library of spreadsheet building
Try efficiency.
In addition, the embodiment of the present invention also proposes a kind of storage medium, test data encapsulation is stored on the storage medium
Program, the test data canned program realize the step of test data packaging method as described above when being executed by processor
Suddenly.
It is the structural block diagram of test data packaging system first embodiment of the present invention referring to Fig. 5, Fig. 5.
As shown in figure 5, the test data packaging system that the embodiment of the present invention proposes includes:
Field obtains module 501 and extracts the inquiry for including in the parameter acquisition instruction for receiving parameter acquisition instruction
Field;
Data search module 502 enters parameter evidence for choosing preset quantity from the inquiry field, in preset electronics
Enter parameter described in searching in table according to corresponding parameter evidence out;
Data package module 503, for being packaged the evidence of parameter out to obtain encapsulation of data.
The present embodiment is by receiving parameter acquisition instruction, the inquiry field for including in extracting parameter acquisition instruction;From inquiry
That preset quantity is chosen in field enters parameter evidence, is searched in preset electrical form into parameter according to corresponding parameter evidence out;To out
Parameter is according to being packaged to obtain encapsulation of data, since test data packaging method provided in this embodiment is not needed from outside
Called system or interconnected system obtain out parameter evidence, but are inquired according to the parameter that enters got according to from preset electrical form
Corresponding parameter evidence out avoids called system and unstable or delay machine occurs then to parameter out according to returning after being packaged
When can not be successfully feedback returned data the case where, ensure that going on smoothly for automatic test.
Based on the above-mentioned test data packaging system first embodiment of the present invention, test data packaging system of the present invention is proposed
Second embodiment.
In the present embodiment, the data package module 503 is also used to read the data desensitization rule locally prestored, root
Target data is obtained according to data desensitization is carried out to the parameter out according to data desensitization rule;The target data is carried out
Encapsulation is to obtain encapsulation of data.
Further, the data package module 503 is also used to obtain the terminal mark in the parameter acquisition instruction included
Know, the corresponding target data format of the terminal iidentification is searched in the mapping relations constructed in advance;Obtain the parameter evidence out
Current data format, and detect the current data format and whether the target data format consistent;If consistent, execute
The step for reading the data desensitization rule locally prestored.
Further, the data package module 503 is also used to detecting the current data format and the number of targets
When inconsistent according to format, data to be desensitized are obtained according to formatting to the parameter out according to the target data format;
The data desensitization rule locally prestored is read, data desensitization is carried out to the data to be desensitized according to data desensitization rule,
Obtain target data.
Further, in this embodiment the test data packaging system further includes parameter configuration module, for receiving ginseng
Number configuration-direct obtains corresponding electronic form template, the electricity according to the template identification for including in parameter configuration instruction
It is included at least in the corresponding list item to be configured of sublist grid template into ginseng list items and goes out ginseng list items;It receives and enters to join column based on described
List item input enters parameter evidence, and goes out to join the parameter evidence out of list items input based on described;By receive enter parameter according to
Parameter evidence is associated out, and the electronic form template is written to obtain preset electrical form in association results.
Further, the data search module 502, be also used to choose preset quantity from the inquiry field enters ginseng
Data enter parameter according to matching according to selection according to the parameter that enters for including in the preset electrical form;Obtain matching at
The target of function enters parameter evidence, and obtains the target according to the association results and enter parameter according to corresponding parameter evidence out.
Further, the data search module 502 is also used to read the ginseng to be matched in the inquiry field included
Number, detecting, which whether there is in the parameter to be matched, has target identical with the data stored in the preset electrical form to join
Number;The number of parameters of the target component is then obtained if it exists, and detects whether the number of parameters is more than preset threshold;If super
It crosses, the parameter that preset quantity is chosen from the target component is less than the default threshold as parameter evidence, the preset quantity is entered
Value;If being no more than, using the target component as entering parameter evidence.
The other embodiments or specific implementation of test data packaging system of the present invention can refer to above-mentioned each method and implement
Example, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
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.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as read-only memory/random access memory, magnetic disk, CD), including some instructions are used so that a terminal device (can
To be mobile phone, computer, server, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
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 packaging method, which is characterized in that the described method includes:
Parameter acquisition instruction is received, the inquiry field for including in the parameter acquisition instruction is extracted;
That preset quantity is chosen from the inquiry field enters parameter evidence, enters parameter according to right described in lookup in preset electrical form
That answers goes out parameter evidence;
The evidence of parameter out is packaged to obtain encapsulation of data.
2. the method as described in claim 1, which is characterized in that described to be packaged the evidence of parameter out to obtain encapsulation number
According to the step of before, which comprises
The data desensitization rule that reading locally prestores, it is de- according to data are carried out to the parameter out according to data desensitization rule
It is quick, obtain target data;
The described the step of evidence of parameter out is packaged to obtain encapsulation of data, comprising:
The target data is packaged to obtain encapsulation of data.
3. method according to claim 2, which is characterized in that it is described to read the data desensitization rule locally prestored, according to institute
State data desensitization rule to it is described go out parameter according to carry out data desensitization, obtain target data the step of before, the method is also wrapped
It includes:
The terminal iidentification for including in the parameter acquisition instruction is obtained, the terminal mark is searched in the mapping relations constructed in advance
Know corresponding target data format;
The current data format of the parameter evidence out is obtained, and detect the current data format and the target data format to be
It is no consistent;
If consistent, the step of the data desensitization rule for reading and locally prestoring is executed.
4. method as claimed in claim 3, which is characterized in that go out the current data format of parameter evidence described in the acquisition, and
After detecting the current data format and the whether consistent step of the target data format, the method also includes:
If inconsistent, data to be desensitized are obtained according to formatting to the parameter out according to the target data format;
It is described read locally prestore data desensitization rule, according to the data desensitization rule to it is described go out parameter according to carry out data
The step of desensitization, acquisition target data, including
The data desensitization rule locally prestored is read, it is de- to carry out data to the data to be desensitized according to data desensitization rule
It is quick, obtain target data.
5. such as the described in any item methods of Claims 1-4, which is characterized in that the reception parameter acquisition instruction, described in extraction
Before the step of inquiry field for including in parameter acquisition instruction, the method also includes:
Parameter configuration instruction is received, corresponding electrical form mould is obtained according to the template identification for including in parameter configuration instruction
Plate includes at least into ginseng list items in the corresponding list item to be configured of the electronic form template and goes out ginseng list items;
Receive based on it is described enter join list items input enter parameter evidence, and based on it is described go out ginseng list items input go out parameter
According to;
The parameter that enters received is associated according to the evidence of parameter out, and the electronic form template is written into obtain in association results
Obtain preset electrical form.
6. method as claimed in claim 5, which is characterized in that the selection preset quantity from the inquiry field enters ginseng
Data, in preset electrical form search described in enter parameter according to it is corresponding go out parameter according to the step of, comprising:
That preset quantity is chosen from the inquiry field enters parameter evidence, enters parameter according to include in the preset electrical form
Enter parameter according to matching according to selection;
The target for obtaining successful match enters parameter evidence, and according to the association results obtain the target enter parameter according to it is corresponding go out
Parameter evidence.
7. the method as described in claim 1, which is characterized in that the selection preset quantity from the inquiry field enters ginseng
The step of data, comprising:
Read the parameter to be matched for including in the inquiry field, detect in the parameter to be matched with the presence or absence of have with it is described pre-
Set the identical target component of the data stored in electrical form;
The number of parameters of the target component is then obtained if it exists, and detects whether the number of parameters is more than preset threshold;
The parameter for choosing preset quantity from the target component if being more than is less than institute as parameter evidence, the preset quantity is entered
State preset threshold;
If being no more than, using the target component as entering parameter evidence.
8. a kind of test data packaging system, which is characterized in that described device includes:
Field obtains module and extracts the inquiry field for including in the parameter acquisition instruction for receiving parameter acquisition instruction;
Data search module enters parameter evidence for choosing preset quantity from the inquiry field, in the preset electrical form
Enter parameter described in lookup according to corresponding parameter evidence out;
Data package module, for being packaged the evidence of parameter out to obtain encapsulation of data.
9. a kind of test data sealed in unit, which is characterized in that the equipment includes: memory, processor and is stored in described
On memory and the test data canned program that can run on the processor, the test data canned program are configured to reality
Now the step of test data packaging method as described in any one of claims 1 to 7.
10. a kind of storage medium, which is characterized in that be stored with test data canned program, the test on the storage medium
Data canned program realizes the step of test data packaging method as described in any one of claim 1 to 7 when being executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811238550.1A CN109634836B (en) | 2018-10-23 | 2018-10-23 | Test data encapsulation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811238550.1A CN109634836B (en) | 2018-10-23 | 2018-10-23 | Test data encapsulation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109634836A true CN109634836A (en) | 2019-04-16 |
CN109634836B CN109634836B (en) | 2024-07-02 |
Family
ID=66066583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811238550.1A Active CN109634836B (en) | 2018-10-23 | 2018-10-23 | Test data encapsulation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109634836B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110324670A (en) * | 2019-07-30 | 2019-10-11 | 北京奇艺世纪科技有限公司 | A kind of transmission method of video, device and server |
CN112100079A (en) * | 2020-11-02 | 2020-12-18 | 北京淇瑀信息科技有限公司 | Test method and system based on simulation data calling and electronic equipment |
CN113342667A (en) * | 2021-06-18 | 2021-09-03 | 杭州网易再顾科技有限公司 | Data processing method, data processing device, electronic equipment and computer readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101763348A (en) * | 2008-12-26 | 2010-06-30 | 英业达股份有限公司 | Dynamic table type data acquisition system and method |
CN105515963A (en) * | 2015-12-03 | 2016-04-20 | 中国联合网络通信集团有限公司 | Data gateway device and big data system |
CN106371975A (en) * | 2016-08-31 | 2017-02-01 | 国信优易数据有限公司 | Automatic operation and maintenance early-warning method and system |
CN106528393A (en) * | 2015-09-09 | 2017-03-22 | 北京京东尚科信息技术有限公司 | Method and device for Mock testing of WebService |
CN106598851A (en) * | 2016-12-05 | 2017-04-26 | 广州唯品会信息科技有限公司 | Software interface test method and system |
CN107679418A (en) * | 2017-09-30 | 2018-02-09 | 武汉汉思信息技术有限责任公司 | Data desensitization method, server and storage medium |
CN107766574A (en) * | 2017-11-13 | 2018-03-06 | 天津开心生活科技有限公司 | Data query method and device, date storage method and device |
CN107766741A (en) * | 2017-10-23 | 2018-03-06 | 中恒华瑞(北京)信息技术有限公司 | Data desensitization system and method |
-
2018
- 2018-10-23 CN CN201811238550.1A patent/CN109634836B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101763348A (en) * | 2008-12-26 | 2010-06-30 | 英业达股份有限公司 | Dynamic table type data acquisition system and method |
CN106528393A (en) * | 2015-09-09 | 2017-03-22 | 北京京东尚科信息技术有限公司 | Method and device for Mock testing of WebService |
CN105515963A (en) * | 2015-12-03 | 2016-04-20 | 中国联合网络通信集团有限公司 | Data gateway device and big data system |
CN106371975A (en) * | 2016-08-31 | 2017-02-01 | 国信优易数据有限公司 | Automatic operation and maintenance early-warning method and system |
CN106598851A (en) * | 2016-12-05 | 2017-04-26 | 广州唯品会信息科技有限公司 | Software interface test method and system |
CN107679418A (en) * | 2017-09-30 | 2018-02-09 | 武汉汉思信息技术有限责任公司 | Data desensitization method, server and storage medium |
CN107766741A (en) * | 2017-10-23 | 2018-03-06 | 中恒华瑞(北京)信息技术有限公司 | Data desensitization system and method |
CN107766574A (en) * | 2017-11-13 | 2018-03-06 | 天津开心生活科技有限公司 | Data query method and device, date storage method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110324670A (en) * | 2019-07-30 | 2019-10-11 | 北京奇艺世纪科技有限公司 | A kind of transmission method of video, device and server |
CN112100079A (en) * | 2020-11-02 | 2020-12-18 | 北京淇瑀信息科技有限公司 | Test method and system based on simulation data calling and electronic equipment |
CN113342667A (en) * | 2021-06-18 | 2021-09-03 | 杭州网易再顾科技有限公司 | Data processing method, data processing device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109634836B (en) | 2024-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109766262B (en) | Interface data processing method, automatic testing method, device, equipment and medium | |
US8745641B1 (en) | Automatic verification and anomaly detection in a representational state transfer (REST) application programming interface | |
US8306805B2 (en) | Scenario generation method and scenario generation apparatus | |
US9229844B2 (en) | System and method for monitoring web service | |
CN109376291B (en) | Website fingerprint information scanning method and device based on web crawler | |
CN109634837A (en) | Automated testing method, device, equipment and storage medium | |
CN109783388A (en) | UI automated testing method, device and electronic equipment | |
CN109634836A (en) | Test data packaging method, device, equipment and storage medium | |
CN107729246A (en) | For the auxiliary test methods of intended application, device, equipment and storage medium | |
CN113536185B (en) | Application page loading method, storage medium and related equipment | |
CN112597052A (en) | Interface testing method and device and computer readable storage medium | |
CN114116078A (en) | Application data processing method, device, equipment and medium based on micro front end | |
CN112181822A (en) | Test method and test method for starting time consumption of application program | |
CN109815083B (en) | Application crash monitoring method and device, electronic equipment and medium | |
CN111431767A (en) | Multi-browser resource synchronization method and device, computer equipment and storage medium | |
CN110838929B (en) | System error checking method and system error checking device | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
CN110674023B (en) | Interface testing method and device | |
CN111625465B (en) | Program generation method, device and system and electronic equipment | |
CN111831277B (en) | Virtual data generation method, system, device and computer readable storage medium | |
CN111881043B (en) | Page testing method and device, storage medium and processor | |
CN112328504A (en) | Buried point data inspection method, buried point data inspection device, buried point data inspection system, computer equipment and storage medium | |
CN117194259A (en) | Interface testing method, system, electronic equipment and storage medium | |
CN116361793A (en) | Code detection method, device, electronic equipment and storage medium | |
KR20200066778A (en) | Code coverage measuring apparatus, code coverage measuring method of the code coverage mearusing apparatus, and code coverage measuring system |
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 |