Summary of the invention
The embodiment of the present invention provides a kind of test, method of calibration and device, to solve in the prior art to interface testing
The cumbersome problem for causing efficiency lower of process.
A kind of test method provided in an embodiment of the present invention, comprising:
Test data is made in test platform reception by oneself;
Obtain test template data set, wherein include test template data, the test in the test template data set
The quantity for the type of test data that platform received make by oneself is less than the quantity of the type of test template data;
Test data is made by oneself for each of receiving, and in the test template data set, test number is made by oneself using this
Test data is made by oneself with this according to replacement and belongs to same type of test template data, generates test data;
According to the test data, object to be measured is tested.
A kind of method of calibration that the embodiment of the present invention separately provides, comprising:
Test platform is received from the data that set the goal;
Obtain target template data set, wherein include target template data, the test in the target template data set
The quantity for the type of target data that platform received make by oneself is less than the quantity of the type of target template data;
Target data is made by oneself for each of receiving, and in the target template data set, number of targets is made by oneself using this
Target data is made by oneself with this according to replacement and belongs to same type of target template data, generates target data;
According to the target data, verification is compared to test result data.
A kind of test device that the embodiment of the present invention separately provides, is applied to test platform, and described device includes:
Receiving module makes test data by oneself for receiving;
Module is obtained, for obtaining test template data set, wherein include test template in the test template data set
Data, the quantity for the type of test data that the test platform received make by oneself are less than the number of the type of test template data
Amount;
Synthesis module, for for receive each make test data by oneself, in the test template data set, use
This, which is made test data replacement by oneself and makes test data by oneself with this, belongs to same type of test template data, generation test data;
Test module, for testing object to be measured according to the test data.
A kind of calibration equipment that the embodiment of the present invention separately provides, is applied to test platform, and described device includes:
Receiving module, for being obtained from the data that set the goal;
Module is obtained, for obtaining target template data set, wherein include target template in the target template data set
Data, the quantity for the type of target data that the test platform received make by oneself are less than the number of the type of target template data
Amount;
Merging module, for for receive each make target data by oneself, in the target template data set, use
This, which is made target data replacement by oneself and makes target data by oneself with this, belongs to same type of target template data, generation target data;
Correction verification module, for verification to be compared to test result data according to the target data.
The embodiment of the present invention provides a kind of test, method of calibration and device, wherein by the test method, test is flat
It is directed to each object to be measured in platform, the test template data set for belonging to each object to be measured is preset, in the test template data set
All kinds of test template data that object to be measured can operate normally are contained, during being tested, test platform passes through
The test script received, it is available to the customized partial data of tester (that is, making test data by oneself), and survey will be made by oneself
Examination data are merged with the test template data in the test template data set for belonging to the object to be measured, are generated needed for test
Test data.Unlike the prior art, by the way of making test data and test template data set in the application by oneself,
The appearance that repetition setting data cases can utmostly be reduced improves convenience during the test, and test
Efficiency.
Similarly, for the method for calibration in the application, similar mode is also used, has equally reached similar effect
Fruit.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with the specific embodiment of the invention and
Technical solution of the present invention is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Fig. 1 be test process provided in an embodiment of the present invention, the process specifically includes the following steps:
S101: test data is made in test platform reception by oneself.
S102: test template data set is obtained.
It wherein, include test template data in the test template data set, what the test platform received makes survey by oneself
The quantity of the type of examination data is less than the quantity of the type of test template data.
In conjunction with above-mentioned two step:
In the embodiment of the present application, the test platform can be a kind of test environment with exploitation, test function,
It may operate in corresponding server, provide testing service for different users, such as: eclipse platform.In test platform
In, different test frames can be provided, to (test object can be application, interface, operation system for different test objects
System etc.) specifically tested, such as: the core test frame system (Core-Test-Fram- for being tested for interface
System, CTS).Certainly, the restriction to the application is not constituted here.
In practical application, when testing object to be measured, generally require that corresponding data are arranged, with object to be measured be to
It surveys for interface: all including usually volume of data (such as: interface parameters) in interface, these data not only ensure that interface just
Often work also may make interface to realize corresponding function.In order to be directed to operation logic of interface under the conditions of different test scenes,
The total data in interface to be measured is arranged generally according to different test cases for existing test process, for different tests
For data corresponding to use-case, be to a certain extent it is identical, there is difference, but using existing only between partial data
Test mode, each time test require repeat be arranged parameter, it is clear that such mode it is excessively cumbersome and increase it is unnecessary
Repeated work.
The case where in order to reduce repetition setting data, therefore in the embodiment of the present application, tester can customized test when
Certain data needed for it, that is, making test data by oneself.Meanwhile in test platform, the test of distinct interface is pre-set
Template data set.As it can be seen that tester only needs to define least a portion of data in primary test, for undefined data, by
Test template data set provides.This will effectively reduce repetition for data and be arranged.
It should be noted that making test data by oneself in the embodiment of the present application, can both be defined in test script, it can also
To be transferred in specific configuration file by test script, certainly, the method for determination for making test data by oneself is not constituted
Restriction to the application.
S103: test data is made by oneself for each of receiving, in the test template data set, survey is made by oneself using this
The replacement of examination data makes test data by oneself with this and belongs to same type of test template data, generates test data.
Making test data by oneself is the partial data in total data needed for object to be measured, then, before being tested, phase
The data that the test frame answered will make tester by oneself, the test mould in test template data set corresponding with the object to be measured
Plate data merge.Its mode merged is exactly that the test template data similar with test data is made by oneself are replaced with and made by oneself
Test data, namely generate the required test data of this test.
S104: according to the test data, object to be measured is tested.
After having obtained above-mentioned test data, target to be measured can be tested, in the embodiment of the present application,
The target may is that application to be measured, interface, operating system etc., not constitute the restriction to the application here.
Through the above steps, it is directed to each object to be measured in test platform, presets the test mould for belonging to each object to be measured
Plate data set contains all kinds of test template data that object to be measured can operate normally in the test template data set, into
During row test, test platform passes through the test script received, available to arrive the customized partial data of tester
(that is, making test data by oneself), and the test mould that test data will be made by oneself with belonged in the test template data set of the object to be measured
Plate data merge, test data needed for generating test.Unlike the prior art, using making test in the application by oneself
The mode of data and test template data set can utmostly reduce the appearance of repetition setting data cases, improve
Convenience in test process, and the efficiency of test.
It should be noted that test process is carried out according to corresponding test case each time in the application, in order to
It is able to carry out the process of test, it usually needs operation test script corresponding with the test case.The test script, by not
Same tester provides (such as: can be write by tester), does not constitute the restriction to the application here.
As a kind of possible mode, making test data by oneself can be edited by tester into test platform in advance, be passed through
Test script can get this in the test platform and make test data by oneself.
And as alternatively possible mode, make test data by oneself is carried by test script, in the case, for above-mentioned
Step S101, test platform reception are made test data by oneself, specifically included: the test platform, which receives, to be carried in test script
Make test data by oneself.Above-mentioned steps S104 tests object to be measured, specifically include: root according to the test data
According to the test data, object to be measured is tested using the test script.
Certainly, the possibility mode that above two mode is used as the application to plant, does not constitute the restriction to the application.
Just because of test process is carried out according to corresponding test case each time in the application, that is to say, that
Test case is different each time, then, during the test to make test data by oneself also just not identical, corresponding with object to be measured
Test template data set in test template data merge after, different test datas will be generated.It is each in order to guarantee
After secondary test, the data (the test template data in test template data set) in test frame will not be to rear primary test
It impacts, so, after testing each time, used test data when this test will be all deleted, so,
Test template data in test template data set corresponding to object to be measured are not influenced still by test data is made by oneself.Therefore at this
Apply in embodiment, the method also includes: after test, delete the test data.
Under the scene of interface testing, complete interface test process had both included obtaining test result number to interface testing
According to also including being verified to test result data, judge whether the internal logic of interface is normal.Above content, which solves, to be obtained
Process before obtaining test result data needs to repeat the problem of setting data, but just it has been observed that in practical application, to test
In the verification process of result data, it is also desirable to which different target datas is set, to verify to test result data, also
It is to say, in verification process, there is also the phenomenon that data are arranged is repeated, so as to cause test process, so, implement in the application
In example, a kind of method of calibration is also provided, as shown in Figure 2.In Fig. 2, the method specifically comprises the following steps:
S201: test platform is received from the data that set the goal.
Wherein, the test result data is test platform test data according to needed for test script, is connect to tested
What mouth generated after being tested.
S202: target template data set is obtained.
It wherein, include target template data in the target template data set, what the test platform received makes mesh by oneself
The quantity of the type of mark data is less than the quantity of the type of target template data.
Equally, in order to avoid or utmostly reduce repeat setting target data the phenomenon that, therefore tester can in advance from
Target data needed for definition, that is, target makes test data by oneself.Similarly, in the test platform, also it is previously provided with phase
The target template data set answered.And the quantity that the customized all kinds of targets of tester make test data by oneself is less than target template data
Concentrate the quantity of all kinds of target template data.Obviously, unlike in the prior art, tester only needs setting unit number of targets
According to, without target complete data are arranged, the target data not set for tester will be provided by target template data, this
The mode of sample will effectively reduce the phenomenon that repetition of target data is arranged in verification process.
S203: target data is made by oneself for each of receiving, in the target template data set, mesh is made by oneself using this
The replacement of mark data makes target data by oneself with this and belongs to same type of target template data, generates target data.
It is similar with replacement test template data in test template data set, determined it is all kinds of make by oneself target data and
After target template data set, it can will be replaced with all kinds of target template data for making target data the same category by oneself,
Thus target data needed for obtaining test case.Specific replacement process is similar with above-mentioned method as shown in Figure 1, therefore herein
It repeats no more.
S204: according to the target data, verification is compared to test result data.
Specifically, test result data described in the present embodiment can be final in above-mentioned method as shown in Figure 1 obtain
The test result data arrived is also possible to the test result obtained from other approach, does not constitute the restriction to the application here.
It should be noted that the corresponding expected data (target namely in this step generally comprised in test case
Data), so as to whether be matched with the target data according to target data validation test result data, if it does,
The internal logic normal operation of the object to be measured of test is turned out, conversely, it is different to indicate that the internal logic of the object to be measured occurs
Often.
Through the above steps, during the verifying of test result data, tester can be according to test case voluntarily
It defines corresponding target data (that is, making target data by oneself), similar with test data is made by oneself, making target data by oneself is not yet
Whole target datas, i.e. tester need to only define partial target data, and the target data undefined for tester and
Speech, will be provided, test platform can will make target data and target template number by oneself by target template data preset in test platform
According to merging, target data is generated, so that verification be compared with test result data.Unlike the prior art, originally
The case where tester in application only needs the target data of self-defining minority, and repetition setting target data can be effectively reduced
Appearance.It is thus possible to effectively be lifted at the efficiency to convenience and verifying in the verification step in interface test process.
It is similar with the above process, the checking procedure of object to be measured is executed, is usually also required to run corresponding test script.
So making target data by oneself can be edited by tester into test platform in advance as a kind of possible mode, pass through test
Script can get this in the test platform and make target data by oneself.
And as alternatively possible mode, make test data by oneself is carried by test script, in the case, for above-mentioned
Step S201, test platform are specifically included received from the data that set the goal: the test platform, which receives, to be carried in test script
Make target data by oneself.For above-mentioned steps S204, according to the target data, verification is compared to test result data, is had
Body includes: that verification is compared to the test result data using the test script according to the target data.
Similarly, in practical applications, different checking procedures usually requires different test cases, specifically, often
Target data needed for primary checking procedure is different from, then, in order to avoid the target data pair in this checking procedure
Checking procedure next time impacts, therefore after checking procedure each time, will delete and generates in this checking procedure
Target data, therefore, in the embodiment of the present application, the method also includes: after the verification, delete the number of targets
According to.
In conjunction with above-mentioned method as shown in Figures 1 and 2 it is found that in this application, being mentioned in test process and checking procedure
A kind of function of merging data is supplied, so that corresponding test data and target data are obtained, in order to realize the function of merging data
It can, it is necessary to a kind of test frame for having data pooling function, that is, as shown in figure 3, being interface provided by the embodiments of the present application
Test frame, which belongs to CTS frame, and in Fig. 3, overloading data mould is provided in the test frame
Block, reference data module, merging module and processing module.
In Fig. 3, overloading data module is used to provide making test data by oneself and making target data by oneself for tester, in one kind
Under possible mode, the configuration file storage in overloading data module with conf format makes test data by oneself and makes number of targets by oneself
According to.It is believed that during test (or verification) each time, make test data by oneself and make by oneself target data all with test case
It is associated,
Reference data module is for providing test template data set and target template data set corresponding to each interface, In
Under a kind of possible mode, test template data set and target template number are stored with the file of csv format in reference data module
According to collection.
For the course of work for the interface testing framework being clearly set forth under practical application scene in Fig. 3, now answered with one
It is described in detail with example.
Assuming that once tested for interface A, determined in this test case tested required test data with
And target data, respectively shown in following Tables 1 and 2.
Interface parameters 1 |
Interface parameters 2 |
Interface parameters 3 |
…… |
Interface parameters n |
a |
B |
c |
…… |
N |
Table 1
In table 1, n kind interface parameters (that is, test data) and its assignment are shown.
Target data 1 |
Target data 2 |
Target data 3 |
…… |
Target data n |
a’ |
B’ |
c’ |
…… |
N’ |
Table 2
N kind target data and corresponding expected result are shown in table 2 (only indicates expectation knot in the form of value in table 2
Fruit can also use the clearly corresponding expected result of text mode, not constitute the limit to the application here in practical applications
It is fixed).
It is now assumed that carrying out the process of interface testing, process is specifically included:
Step 1: test script corresponding with the test case is run in interface testing framework.
Step 2: it according to test script, obtains the corresponding test template data set of the test script and makes test number by oneself
According to.
Specifically, it is assumed that corresponding test template data set has been previously stored in the frame, as shown in table 3 below.
Template parameter 1 |
Template parameter 2 |
Template parameter 3 |
…… |
Template parameter n |
a |
b |
c |
…… |
n |
Table 3
All kinds of standardized interface parameters (that is, all kinds of test template data) are shown in table 3.
Assuming that it is as shown in table 4 below to make test data by oneself corresponding to the test script.
Interface parameters 1 |
Interface parameters 2 |
Interface parameters 3 |
…… |
Interface parameters n |
|
B |
|
…… |
N |
Table 4
As seen from Table 4, in the case where carrying out each test, tester does not need the whole interface parameters of setting,
And only need to be arranged the part of interface parameter needed for it, as shown in Table 4, tester is only provided with " interface in this test
Parameter 2 " and " interface parameters n " two parameters.
Step 3: the test template data in test template data set are merged with test data is made by oneself, are generated and are surveyed
Try data.
It specifically, is by survey similar with test data is made by oneself in test template data set during data merge
Examination template data merges, and ultimately forms test data as shown in Table 1.That is, when merging, it will be in table 4
" interface parameters 2 " and " interface parameters n " two parameters, two of " interface parameters 2 " and " interface parameters n " in substitution table 3
Parameter.
Step 4: calling interface A is simultaneously tested using test data, and test result data is obtained.
Assuming that as shown in table 5 below by the test result data that step 4 obtains.
Result data 1 |
Result data 2 |
Result data 3 |
…… |
Result data n |
a’ |
b’ |
c’ |
…… |
N’ |
Table 5
So far, terminate for the test process of interface A, and in order to determine whether the operation logic inside interface A normal,
It also needs to verify test result data shown in table 5, that is, executing checking procedure (following step five).
Step 5: test result data is verified.
Certainly, in checking procedure, tester also needs to set corresponding target data, with the step in above-mentioned test process
Rapid two is similar with step 3, and interface testing framework provides target template data set, then, tester can also only setting section
It makes target data by oneself, and target template data set is merged with target data is made by oneself.
Specifically, it is assumed that target template data set is as shown in table 6 below.
Template data 1 |
Template data 2 |
Template data 3 |
…… |
Template data n |
a’ |
b’ |
c’ |
…… |
n’ |
Table 6
And assume that make target template by oneself as shown in table 7 below.
Template data 1 |
Template data 2 |
Template data 3 |
…… |
Template data n |
|
B’ |
|
…… |
N’ |
Table 7
It is merged by the data in above-mentioned table 6 and 7, target data shown in above-mentioned table 2 can be obtained.
To can also use target data that verification is compared with test result data shown in table 5, and obtain phase
The check results answered: result data 2 and target data 2 are inconsistent.
So far, a set of complete test process for interface A terminates.In from the discussion above as it can be seen that in entire test process
In, synthesize two kinds of data: test data and target data, both data are all needed for this test case, but may
It is different from when testing next time, so, in order to avoid the data in this test process impact test next time, therefore will
Data scrubbing operation is executed, i.e. execution following step six.
Step 6: the test data and target data of synthesis are cleared up.
In conjunction with above content as it can be seen that using test mode in the application, tester need to only set the part needed for it and make by oneself
Test data, by way of making test data and preset template data by oneself and merging, test number needed for generating test
According to and target data, can utmostly reduce the appearance of repetition setting data cases, improve during the test convenient
Property, and the efficiency of test.
The above are test methods provided in an embodiment of the present invention, are based on same thinking, and the embodiment of the present invention also provides one
Kind test device, is applied to test platform.
As shown in figure 4, test device includes:
Receiving module 401 makes test data by oneself for receiving;
Module 402 is obtained, for obtaining test template data set, wherein include test in the test template data set
Template data, the quantity for the type of test data that the test platform received make by oneself are less than the type of test template data
Quantity;
Synthesis module 403, for making test data by oneself for each of receiving, in the test template data set,
It test data replacement is made by oneself using this makes test data by oneself with this and belong to same type of test template data, generate and test number
According to;
Test module 404, for testing object to be measured according to the test data.
As one of the embodiment of the present application mode, the receiving module 401 is specifically used for receiving carrying and is testing foot
Test data is made by oneself in this.The test module 404 is specifically used for according to the test data, using the test script
Object to be measured is tested.
In the embodiment of the present application, described device further include: data scrubbing module 405, for deleting after test
The test data.
In the embodiment of the present application, described device operates in a kind of test platform including core test frame system CTS
On.The test template data set includes: the test template data set stored with csv file.The test data of making by oneself includes:
Test data is made by oneself with the storage of conf file.
By above-mentioned device as shown in Figure 4, interface test process is carried out after having obtained test result data, needs needle
The test result data is verified.Correspondingly, in the embodiment of the present application, a kind of calibration equipment is also provided, is applied to survey
Platform is tried, described device is as shown in Figure 5.Described device includes:
Receiving module 501, for being obtained from the data that set the goal;
Module 502 is obtained, for obtaining target template data set, wherein include target in the target template data set
Template data, the quantity for the type of target data that the test platform received make by oneself are less than the type of target template data
Quantity;
Merging module 503, for making target data by oneself for each of receiving, in the target template data set,
It target data replacement is made by oneself using this makes target data by oneself with this and belong to same type of target template data, generation number of targets
According to;
Correction verification module 504, for verification to be compared to test result data according to the target data.
As one of the embodiment of the present application mode, the receiving module 501 is specifically used for receiving carrying and is testing foot
Target data is made by oneself in this;The correction verification module 502 is specifically used for according to the target data, using the test script
Verification is compared to the test result data.
Described device further include: data scrubbing module 505, for deleting the target data after test.
Similar with above-mentioned test device, for calibration equipment in this present embodiment, operating in a kind of includes core
On the test platform of test frame system CTS.The test template data set includes: the test template number stored with csv file
According to collection.The test data of making by oneself includes: to make test data by oneself with the storage of conf file.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that the embodiment of the present invention can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the present invention
Form.It is deposited moreover, the present invention can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above description is only an embodiment of the present invention, is not intended to restrict the invention.For those skilled in the art
For, the invention may be variously modified and varied.All any modifications made within the spirit and principles of the present invention are equal
Replacement, improvement etc., should be included within scope of the presently claimed invention.