The content of the invention
In view of this, the present invention provides a kind of method and device for being used to test, it is possible to increase testing efficiency.
Other characteristics and advantage of the present invention will be apparent from by following detailed description, or partially by the present invention
Practice and acquistion.
According to the first aspect of the invention, there is provided a kind of method for being used to test, wherein, methods described includes:
Obtain the test script that with the addition of test data;
Configure the unbroken executing rule of testing process of the test script;
Configure the output rule of the test result after the test script performs;
According to the output of the executing rule and test result rule, the test script is performed.
According to some embodiments, the acquisition with the addition of the test script of test data, including:
The test script of each function point is automatically generated according to business function, and addition batch obtains in the test script
The method for taking test data, to get the test script that with the addition of the test data.
According to some embodiments, the unbroken executing rule of testing process, which refers to work as, to be tested out program error and stops
During test, described program mistake is recorded, and continue to test.
According to some embodiments, the unbroken executing rule of testing process of the configuration test script, including:It is logical
Cross the unbroken executing rule of calling Teardown method configuration testing flows.
According to some embodiments, in the unbroken executing rule of the testing process of the configuration test script, the side
Method also includes:Configure the execution sequence rule of the test script.
According to some embodiments, the execution sequence rule of the configuration test script, including:By calling Test side
Method configures the execution sequence of the test script.
According to some embodiments, the output rule of the test result after the test script performs is configured, including:Configuration institute
State title, form, transmission/reception object and the transmission time during test result output after test script performs.
It is described in the output rule of the test result after configuring the execution of the test script according to some embodiments
Method also includes:Configure the execution time of the test script, perform the cycle.
According to the second aspect of the invention, there is provided a kind of device for being used to test, wherein, described device includes:
Acquisition module, the test script of test data is with the addition of for obtaining;
First configuration module, the unbroken executing rule of testing process for configuring the test script;
Second configuration module, for configuring the output rule of the test result after the test script performs;
Execution module, for the output rule according to the executing rule and the test result, perform the test pin
This.
According to some embodiments, the acquisition module, for automatically generating the test of each function point according to business function
Script, and the method that addition batch obtains test data in the test script, the test data is with the addition of to get
Test script.
According to some embodiments, first configuration module, it is additionally operable to configure the execution sequence rule of the test script.
According to some embodiments, second configuration module, for configuring the test result after the test script performs
Title, form, transmission/reception object and transmission time during output.
According to the third aspect of the invention we, there is provided a kind of computer-readable recording medium, computer program is stored thereon with,
Wherein, method and step as described in relation to the first aspect is realized when the program is executed by processor.
According to the fourth aspect of the invention, there is provided a kind of electronic equipment, wherein, including:One or more processors;Storage
Device, for storing one or more programs, when one or more of programs are by one or more of computing devices,
So that one or more of processors realize method and step as described in relation to the first aspect
In the embodiment of the present invention, the test script of test data is with the addition of by obtaining;Configure the survey of the test script
Try the unbroken executing rule of flow;Configure the output rule of the test result after the test script performs;Held according to described
The output rule of line discipline and the test result, the technological means of the test script is performed, realize the test number of acquisition
According to diversity, by the unbroken executing rule of configuration testing flow, realize unbroken, smooth test, improve
The flexibility of test, the output rule of the test result after being performed by configuring the test script, easily by test result
Related personnel is sent to, related personnel is avoided and actively goes to obtain test result, improve testing efficiency and communication efficiency, carry
Consumer's Experience is risen.
Embodiment
Example embodiment is described more fully with referring now to accompanying drawing.However, example embodiment can be real in a variety of forms
Apply, and be not understood as limited to embodiment set forth herein;On the contrary, these embodiments are provided so that the present invention will be comprehensively and complete
It is whole, and the design of example embodiment is comprehensively communicated to those skilled in the art.Identical reference represents in figure
Same or similar part, thus repetition thereof will be omitted.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, there is provided many details fully understand so as to provide to embodiments of the invention.However,
It will be appreciated by persons skilled in the art that technical scheme can be put into practice without one or more in specific detail,
Or other methods, constituent element, device, step etc. can be used.In other cases, side known in being not shown in detail or describe
Method, device, realization are operated to avoid fuzzy each aspect of the present invention.
Block diagram shown in accompanying drawing is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in accompanying drawing is merely illustrative, it is not necessary to including all contents and operation/step,
It is not required to perform by described order.For example, some operation/steps can also decompose, and some operation/steps can close
And or partly merging, therefore the order actually performed is possible to be changed according to actual conditions.
Although it should be understood that describe configuration module using first, second grade term in the embodiment of the present invention, these arts
Language can not limit these configuration modules, be only used for configuration module being distinguished from each other out.
Fig. 1 is a kind of flow chart of method for being used to test according to an exemplary embodiment.
As shown in figure 1, in S110, the test script that with the addition of test data is obtained.
According to example embodiment, when automatically generating test script, the function of needing to test can be combed according to business rule
Point, so as to automatically generate test script by testing tool.
For example, the project business function point tested can be needed at combing, pass through the auxiliary of testing tool-PostMan
Help, Configuration network host-host protocol, required parameter, automatically generate test case script.
It should be noted that the test script automatically generated there may be the monistic defect of test data, therefore can
To be adjusted to the test script automatically generated.According to example embodiment, it can add and criticize in the test script automatically generated
The method that amount obtains test data, to get the test script that with the addition of the test data.
For example, after test script is automatically generated, the test automatically generated is opened in java developing instruments IntelliJ
Script, the method (random device and traversal method can also be write) that batch obtains test data is write in script, so as to real
Existing test script obtains a variety of test parameters automatically.
Obtained it should be noted that the method that batch obtains data can be local file, generate test data, database
Obtain, and be subject to out of order acquisition data.Test data source can be read from locally fixed file, can also be from data
Read in storehouse.
In above-described embodiment, test script obtains test data automatically, realizes the diversity of the test data of acquisition, carries
The high accuracy and testing efficiency of test data.
In S120, the unbroken executing rule of testing process of above-mentioned test script is configured.
According to example embodiment, the unbroken executing rule of the testing process, which refers to work as, to be tested out program error and stops surveying
During examination, described program mistake is recorded, and continue to test.
For example, when if some testing process can not continue to test follow-up process because of BUG, this problem is recorded,
And perform next testing process.
, can be with the unbroken executing rule of the testing process that configures the test script according to example embodiment
Configure the execution sequence rule of the test script.For the unbroken executing rule of the testing process of configuration testing script and match somebody with somebody
The execution sequence rule of the test script is put, protos test suite PROTOS can be write, to control the execution sequence of test script and perform rule
Then.For example, in a java file, a function is defined to perform test script, and performs rule by define the function
The execution sequence of each test script then is adjusted, is re-defined during another function carrys out the testing process of regulation test script not
Disconnected executing rule, when some testing process can not continue to test follow-up process because of BUG, this problem is recorded, and
Perform next testing process.
The embodiment of the present invention provides a kind of unbroken executing rule of testing process for specifically configuring the test script
And the method for configuring the execution sequence rule of the test script, can be by calling Teardown method configuration testings flow not
The executing rule of interruption, can be by calling Test methods to configure the execution sequence of the test script.
For example, a java file is write, at the beginning of calling TestNG plug-in unit Before methods to carry out some in this document
Beginningization operates, and then, calls Test methods to perform test script, by the executing rules of Test methods come it is self-defined each
The execution sequence (can be achieved to perform the purpose of test script according to operation flow batch) of test script, calls Teardown side
Method carrys out the unbroken executing rule of testing process of self-defined test script, when some testing process can not continue because of BUG
During flow afterwards, the problem is recorded, stops the test of follow-up process, performs next testing process.
In above-described embodiment, test can be avoided because of journey with the unbroken executing rule of the testing process of configuration testing script
Sequence mistake and interrupt, improve the fluency and testing efficiency of test.Furthermore it is also possible to the execution of free configuration testing script
The executing rule of order, add flexibility and the controllability of test.
In S130, the output rule of the test result after above-mentioned test script performs is configured.
According to example embodiment, title, form when can configure the test result output after above-mentioned test script performs,
Transmission/reception object and transmission time.
It should be noted that test result output form can include but is not limited to mail he, short message form, Yi Jishe
Hand over the form of the instant message of software.The text lattice of the instant message of mail, short message and social software can also be preset
Formula etc..
According to example embodiment, in the output rule of the test result after configuring the execution of the test script, may be used also
With the execution time of configuration testing script, perform the cycle.Advised for the output of the test result after the execution of configuration testing script
Then and the execution time of configuration testing script, perform the cycle, a tasks carrying script can be write, configuration testing task is held
Row time, test assignment perform the cycle, in order to carry out regression test, stability test, and configuration testing result to software
Output rule, such as when being exported with mail he, can by configuration testing result title, in the form of message body, transmission/reception pair
As, send time etc..
For example, a java file can be write, test assignment is set to perform time, test assignment execution in this document
Cycle, test result mail notification etc..Set test assignment to perform time, test assignment execution cycle, be easy to carry out software
Regression test, stability test;Test result mail, it can configure test report title, message body form, transmission/reception pair
As, send time etc..
, can be with the execution time of configuration testing script, execution cycle, so as to improve test script in above-described embodiment
Flexibility and controllability, still further aspect, by the output rule of configuration testing result, test result is easily sent to phase
Pass personnel, avoid related personnel and actively go to obtain test result, improve testing efficiency and communication efficiency, improve user
Experience.
In S140, according to the output of above-mentioned executing rule and test result rule, above-mentioned test script is performed.
When performing test script, according to the output of the unbroken executing rule of the testing process of configuration and test result
Rule so that testing process is not interrupted and exported test result with the output rule configured when test script performs.
It should be noted that when performing test script, can also be according to the testing process in the configuration test script
During unbroken executing rule, after the execution sequence rule of the test script configured, and the configuration test script execution
Test result output rule when, execution time of the test script configured, perform the cycle and perform test script.
In the embodiment of the present invention, the test script of test data is with the addition of by obtaining;Configure the survey of the test script
Try the unbroken executing rule of flow;Configure the output rule of the test result after the test script performs;Held according to described
The output rule of line discipline and the test result, the technological means of the test script is performed, realize the test number of acquisition
According to diversity, by the unbroken executing rule of configuration testing flow, realize unbroken, smooth test, improve
The flexibility of test, the output rule of the test result after being performed by configuring the test script, easily by test result
Related personnel is sent to, related personnel is avoided and actively goes to obtain test result, improve testing efficiency and communication efficiency, carry
Consumer's Experience is risen.
It will be clearly understood that the present disclosure describe how formation and using particular example, but the principle of the present invention is not limited to
Any details of these examples.On the contrary, the teaching based on present disclosure, these principles can be applied to many other
Embodiment.
Following is apparatus of the present invention embodiment, can be used for performing the inventive method embodiment.Device is retouched below
In stating, with preceding method identical part, it will not be described in great detail.
Fig. 2 is a kind of structure chart of the device for being used to test shown according to embodiments of the present invention.
As shown in Fig. 2 the device 200 includes:
Acquisition module 210, the test script of test data is with the addition of for obtaining;
First configuration module 220, the unbroken executing rule of testing process for configuring the test script;
Second configuration module 230, for configuring the output rule of the test result after the test script performs;
Execution module 240, for the output rule according to the executing rule and the test result, perform the test
Script.
According to example embodiment, the acquisition module 210, for automatically generating the survey of each function point according to business function
Training sheet, and the method that addition batch obtains test data in the test script, the test number is with the addition of to get
According to test script.
According to example embodiment, first configuration module 220, the execution sequence for being additionally operable to configure the test script is advised
Then.
According to example embodiment, second configuration module 230, for configuring the test knot after the test script performs
Title, form, transmission/reception object and transmission time when fruit exports.
In the embodiment of the present invention, the test script of test data is with the addition of by obtaining;Configure the survey of the test script
Try the unbroken executing rule of flow;Configure the output rule of the test result after the test script performs;Held according to described
The output rule of line discipline and the test result, the technological means of the test script is performed, realize the test number of acquisition
According to diversity, by the unbroken executing rule of configuration testing flow, realize unbroken, smooth test, improve
The flexibility of test, the output rule of the test result after being performed by configuring the test script, easily by test result
Related personnel is sent to, related personnel is avoided and actively goes to obtain test result, improve testing efficiency and communication efficiency, carry
Consumer's Experience is risen.
As on the other hand, present invention also provides a kind of computer-readable medium, the computer-readable medium can be
Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating
Machine computer-readable recording medium carries one or more program, when said one or multiple programs are performed by the equipment, makes
Obtaining the equipment can perform:Obtain the test script that with the addition of test data;In configuring the testing process of the test script not
Disconnected executing rule;Configure the output rule of the test result after the test script performs;According to the executing rule and institute
The output rule of test result is stated, performs the test script.
Fig. 3 is the structural representation of a kind of electronic equipment according to an exemplary embodiment.It should be noted that figure
Electronic equipment shown in 3 is only an example, should not bring any restrictions to the function and use range of the embodiment of the present application.
As shown in figure 3, computer system 300 includes CPU (CPU) 301, it can be read-only according to being stored in
Program in memory (ROM) 302 or be loaded into program in random access storage device (RAM) 303 from storage part 308 and
Perform various appropriate actions and processing.In RAM 303, also it is stored with system 300 and operates required various programs and data.
CPU 301, ROM 302 and RAM 303 are connected with each other by bus 304.Input/output (I/O) interface 305 is also connected to always
Line 304.
I/O interfaces 305 are connected to lower component:Importation 306 including keyboard, mouse etc.;Penetrated including such as negative electrode
The output par, c 307 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage part 308 including hard disk etc.;
And the communications portion 309 of the NIC including LAN card, modem etc..Communications portion 309 via such as because
The network of spy's net performs communication process.Driver 310 is also according to needing to be connected to I/O interfaces 305.Detachable media 311, such as
Disk, CD, magneto-optic disk, semiconductor memory etc., it is arranged on as needed on driver 310, in order to read from it
Computer program be mounted into as needed storage part 308.
Especially, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product, it includes being carried on computer-readable medium
On computer program, the computer program include be used for execution flow chart shown in method program code.In such reality
To apply in example, the computer program can be downloaded and installed by communications portion 309 from network, and/or from detachable media
311 are mounted.When the computer program is performed by CPU (CPU) 301, perform what is limited in the terminal of the application
Above-mentioned function.
It should be noted that the computer-readable medium shown in the application can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer-readable recording medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, system, device or the device of infrared ray or semiconductor, or it is any more than combination.Meter
The more specifically example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more wires, just
Take formula computer disk, hard disk, random access storage device (RAM), read-only storage (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In this application, computer-readable recording medium can any include or store journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this
In application, computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium beyond storage medium is read, the computer-readable medium, which can send, propagates or transmit, to be used for
By instruction execution system, device either device use or program in connection.Included on computer-readable medium
Program code can be transmitted with any appropriate medium, be included but is not limited to:Wirelessly, electric wire, optical cable, RF etc., or it is above-mentioned
Any appropriate combination.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of the various embodiments of the application, method and computer journey
Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation
The part of one module of table, program segment or code, a part for above-mentioned module, program segment or code include one or more
For realizing the executable instruction of defined logic function.It should also be noted that some as replace realization in, institute in square frame
The function of mark can also be with different from the order marked in accompanying drawing generation.For example, two square frames succeedingly represented are actual
On can perform substantially in parallel, they can also be performed in the opposite order sometimes, and this is depending on involved function.Also
It is noted that the combination of each square frame and block diagram in block diagram or flow chart or the square frame in flow chart, can use and perform rule
Fixed function or the special hardware based system of operation are realized, or can use the group of specialized hardware and computer instruction
Close to realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit can also be set within a processor, for example, can be described as:A kind of processor bag
Include receiving module, acquisition module and playing module.Wherein, the title of these modules is not formed to the module under certain conditions
The restriction of itself.
Specifically illustrate and describe above the exemplary embodiment of the present invention.It should be appreciated that the invention is not restricted to this
In the detailed construction, set-up mode or the implementation method that describe;On the contrary, it is intended to cover the essence included in appended claims
God and the various modifications in scope and equivalence setting.