CN106354634A - Interface testing method and device - Google Patents
Interface testing method and device Download PDFInfo
- Publication number
- CN106354634A CN106354634A CN201610726881.4A CN201610726881A CN106354634A CN 106354634 A CN106354634 A CN 106354634A CN 201610726881 A CN201610726881 A CN 201610726881A CN 106354634 A CN106354634 A CN 106354634A
- Authority
- CN
- China
- Prior art keywords
- interface
- file
- test
- tested
- parameter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
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/362—Software debugging
- G06F11/3648—Software debugging using additional hardware
- G06F11/3656—Software debugging using additional hardware using a specific debug interface
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of invention provides an interface testing method and a device, comprising the steps of getting general testing files for the to-be-tested interface; combining values of all parameters of the to-be-tested interface and generating a plurality of parameter files; generating a plurality of testing examples based on the general testing files and a plurality of parameter files; testing the to-be-tested interface by the a plurality of testing examples. The interface testing method and device is used for enhancing efficiency in interface testing.
Description
Technical field
The present embodiments relate to communication technical field, more particularly, to a kind of interface test method and device.
Background technology
At present, Cloud Server generally passes through interface provides multiple services for client, in actual application, in order to protect
Card Cloud Server normally can provide service for client by interface, needs docking port to carry out routine test.
In the prior art, when needing docking port to be tested, first test case is write by tester, send out to interface
Give this test case corresponding interface requests message, and the response message of receiving interface feedback, connect according to test case is corresponding
Mouth request message and this response message determine test result.In actual application, each interface to there being parameter, often
One parameter may have multiple values;Each test case includes the value of all parameters, in order to ensure docking port test
Comprehensive it is thus necessary to determine that multiple test cases so that the plurality of test case can cover the combination of all parameter values.
However, when the optional parameters of interface is more, tester needs to write dozens of even up to a hundred test cases,
Make that test case writes is less efficient, so lead to docking port testing efficiency relatively low.
Content of the invention
The embodiment of the present invention provides a kind of interface test method and device, for improving the efficiency that docking port is tested.
In a first aspect, the embodiment of the present invention provides a kind of interface test method, comprising:
Obtain the universal test file of interface to be tested;
The value of all parameters of described interface to be tested is combined, generates multiple parameters file;
According to described universal test file and the plurality of Parameter File, generate multiple test cases;
By the plurality of test case, described interface to be tested is tested.
In a kind of possible embodiment, obtain the universal test file of interface to be tested, comprising:
Obtain the first packet sending to described interface to be tested;
Obtain the general information of preset kind in described first packet, and generated according to described general information described logical
Use test file.
In alternatively possible embodiment, the value of all parameters of described interface to be tested is combined, raw
Become multiple parameters file, comprising:
Obtain at least one mandatory parameter of described interface to be tested and at least one value of each described mandatory parameter;
Obtain at least one optional parameters of described interface to be tested and the default value of each described optional parameters;
The value of each described mandatory parameter is combined, obtains mandatory parameter file;
According to the default value of each described mandatory parameter file and each described optional parameters, determine the plurality of Parameter File.
In alternatively possible embodiment, described according to described universal test file and the plurality of Parameter File,
Generate multiple test cases, comprising:
Obtain test case template;
According to described test case template, process is merged to described universal test file and each described Parameter File,
Generate the plurality of test case.
In alternatively possible embodiment, described acquisition test case template, comprising:
Obtain the second packet sending to described interface to be tested;
Described second packet is parsed, to obtain each parameter in described universal test file and described Parameter File
Position and form;
According to the position of each parameter and form in described universal test file and described Parameter File, determine that described test is used
Example template.
In alternatively possible embodiment, for any one test case, described used by the plurality of test
Example is tested to described interface to be tested, comprising:
Obtain described test case corresponding interface requests message;
Send described interface requests message to described interface to be tested;
Receive the response message of described interface feedback to be tested;
According to described interface requests message and described response message, determine test result.
In alternatively possible embodiment, described universal test file is for storing HTML (Hypertext Markup Language) http
The application programming interface har file of requests/response messages.
Second aspect, the embodiment of the present invention provides a kind of interface test device, comprising:
Acquisition module, for obtaining the universal test file of interface to be tested;
First generation module, the value for all parameters to described interface to be tested is combined, and generates multiple ginsengs
Number file;
Second generation module, for according to described universal test file and the plurality of Parameter File, generating multiple tests
Use-case;
Test module, for being tested to described interface to be tested by the plurality of test case.
In a kind of possible embodiment, described acquisition module specifically for:
Obtain the first packet sending to described interface to be tested;
Obtain the general information of preset kind in described first packet, and generated according to described general information described logical
Use test file.
In alternatively possible embodiment, described first generation module is used for:
Obtain at least one mandatory parameter of described interface to be tested and at least one value of each described mandatory parameter;
Obtain at least one optional parameters of described interface to be tested and the default value of each described optional parameters;
The value of each described mandatory parameter is combined, obtains mandatory parameter file;
According to the default value of each described mandatory parameter file and each described optional parameters, determine the plurality of Parameter File.
In alternatively possible embodiment, described second generation module includes acquiring unit and signal generating unit, wherein,
Described acquiring unit is used for, and obtains test case template;
Described signal generating unit is used for, according to described test case template, to described universal test file and each described parameter
File merges process, generates the plurality of test case.
In alternatively possible embodiment, described acquiring unit specifically for:
Obtain the second packet sending to described interface to be tested;
Described second packet is parsed, to obtain each parameter in described universal test file and described Parameter File
Position and form;
According to the position of each parameter and form in described universal test file and described Parameter File, determine that described test is used
Example template.
In alternatively possible embodiment, described test module specifically for:
Obtain described test case corresponding interface requests message;
Send described interface requests message to described interface to be tested;
Receive the response message of described interface feedback to be tested;
According to described interface requests message and described response message, determine test result.
In alternatively possible embodiment, described universal test file is for storing HTML (Hypertext Markup Language) http
The application programming interface har file of requests/response messages.
Interface test method provided in an embodiment of the present invention and device, enter when interface test device needs to treat test interface
During row test, interface test device obtains the universal test file of interface to be tested and treats all parameters of test interface
Value is combined, and generates multiple parameters file;Interface test device is according to determining the universal test file that obtains and multiple ginseng
Number file, generates multiple test cases, and treats test interface by multiple test cases and tested.In above process,
Write test case without tester, further, the general file of all test cases of interface to be tested is identical, parameter
File is different, and interface test device, according to the value of universal test file and multiple parameters, can quickly generate multiple tests and use
Example, improves the efficiency generating test case, and then improves the efficiency that docking port is tested.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
Have technology description in required use accompanying drawing be briefly described it should be apparent that, drawings in the following description are these
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, acceptable
Other accompanying drawings are obtained according to these accompanying drawings.
The application scenarios schematic diagram of the interface test method that Fig. 1 provides for the present invention;
The schematic flow sheet of the interface test method that Fig. 2 provides for the present invention;
The schematic flow sheet of the acquisition universal test document method that Fig. 3 provides for the present invention;
The schematic flow sheet of the generation parameter document method that Fig. 4 provides for the present invention;
The schematic flow sheet of the generation method of test example that Fig. 5 provides for the present invention;
The structural representation one of the interface test device that Fig. 6 provides for the present invention;
The structural representation two of the interface test device that Fig. 7 provides for the present invention.
Specific embodiment
Purpose, technical scheme and advantage for making the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described it is clear that described embodiment is
The a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment being obtained under the premise of not making creative work, broadly falls into the scope of protection of the invention.
The application scenarios schematic diagram of the interface test method that Fig. 1 provides for the present invention, refers to Fig. 1, including Cloud Server
101 and interface test device 102.Cloud Server 101 includes multiple interfaces, and interface test device 102 can be to cloud service 101
In each interface tested, optionally, this interface can be HTML (Hypertext Markup Language) (hypertext transfer
Protocol, abbreviation http) and application programming interface (application programming interface, referred to as
api).Before interface test device 102 is tested to the interface in cloud service 101, interface test device 102 can be automatic
Generate all test cases of interface, and test interface is treated according to the test case generating and carry out automatic test.In this Shen
Please in, write test case without tester, interface test device can be according to the universal test file of interface and interface
The value of all parameters, quickly generates multiple test cases, improves the efficiency generating test case, and then raising docking port is carried out
The efficiency of test.Below, by specific embodiment, the technical scheme shown in the application is described in detail.
It should be noted that these specific embodiments can be combined with each other, for same or analogous concept below
Or process may repeat no more in certain embodiments.
The schematic flow sheet of the interface test method that Fig. 2 provides for the present invention, refers to Fig. 2, and the method may include that
S201, the universal test file of acquisition interface to be tested;
S202, the value of all parameters treating test interface are combined, and generate multiple parameters file;
S203, according to universal test file and multiple parameters file, generate multiple test cases;
S204, treat test interface by multiple test cases and tested.
The executive agent of technical scheme shown in the embodiment of the present invention is interface test device.Optionally, this interface testing dress
Put and can be arranged in Cloud Server it is also possible to be arranged on the testing service device for being tested to the interface in Cloud Server
In.Optionally, this interface test device can be realized by software and/or hardware.
In embodiments of the present invention, interface test device can be in the running of Cloud Server, periodically to cloud
Interface in server is tested;Interface test device is similar to the test process of the total interface in Cloud Server, below,
So that interface test device is to the test process of the interface to be tested of any one in Cloud Server as a example, to shown in Fig. 2 embodiment
Method be described in detail.
In actual application, when interface test device needs to treat test interface and tested, interface testing fills
Put the universal test file obtaining interface to be tested.Optionally, this universal test file can be for storing http request/sound
Answer the api file of message.Optionally, this interface to be tested can be for providing a user with the interface of inquiry business, providing a user with
Interface of business handling etc..Optionally, this universal test file can include interface that client sends to interface to be tested please
Seek the general information in message, for example, request address, domain name of interface to be tested etc. in interface requests message, can be included.Root
According to the difference of the type of interface to be tested, the corresponding universal test file of interface to be tested is likely to difference.In practical application mistake
Cheng Zhong, can arrange the content that the universal test file of interface to be tested includes according to actual needs, and the present invention does not make to this
Concrete restriction.
The value that interface test device also treats all parameters of test interface is combined, and generates multiple parameters file.
Interface to be tested potentially includes multiple parameters, and each parameter may have multiple values, and interface test device first obtains to be tested
At least one value of all parameters of interface, and at least one value of all parameters is combined, to generate multiple ginsengs
Number file.
Exemplary it is assumed that interface to be tested includes 3 parameters, be designated as parameter a, parameter b, parameter c, parameter a, ginseng respectively
Several b, the value of parameter c are distinguished as shown in table 1:
Table 1
The value of each parameter according to table 1 for the interface test device, is combined to the value of parameters, obtains many
Individual composite type, specifically, as shown in table 2:
Table 2
Composite type | The value of parameter |
Combination 1 | a1、b1、c1 |
Combination 2 | a1、b1、c2 |
Combination 3 | a1、b2、c1 |
Combination 4 | a1、b2、c2 |
Combination 5 | a2、b1、c1 |
Combination 6 | a2、b1、c2 |
Combination 7 | a2、b2、c1 |
Combination 8 | a2、b2、c2 |
After interface test device determines to obtain the multiple composite types shown in table 2, interface test device can basis
Each composite type, determines a Parameter File.
After the determination of information test device obtains universal test file and the multiple parameters file of interface to be tested, letter
Breath test device, according to universal test file and multiple parameters file, generates multiple test cases.Optionally, information test device
Process can be merged to universal test file and multiple parameters file, to generate multiple test cases.
After interface test device generates multiple test cases, information test device is treated according to the plurality of test case
Test interface is tested.Optionally, information test device can obtain use-case to be tested corresponding interface requests message, to treating
Test interface transmission interface request message, receives the response message of interface feedback to be tested, and according to interface requests message and sound
Answer message, determine test result.Optionally, if interface test device determine the test case of interface to be tested that obtains with to be measured
The form of mouth of trying corresponding interface requests message is identical, then the test case that determination can directly be obtained by interface test device
It is defined as interface requests message;If interface test device determines the test case of interface to be tested and interface pair to be tested obtaining
The form of the interface requests message answered differs, then the test case that interface test device obtains to determination enters row format conversion,
To obtain test case corresponding interface requests message.
Interface test method provided in an embodiment of the present invention, is tested when interface test device needs to treat test interface
When, the value of universal test file all parameters treating test interface that interface test device obtains interface to be tested is entered
Row combination, generates multiple parameters file;Interface test device according to determining the universal test file that obtains and multiple parameters file,
Generate multiple test cases, and treat test interface by multiple test cases and tested.In above process, need not test
Personnel write test case, and further, the universal test file of all test cases of interface is identical, and Parameter File is different,
In interface test device it needs to be determined that during multiple test case of interface, interface test device is according to universal test file and multiple
The value of parameter, can quickly generate multiple test cases, improve the efficiency generating test case, and then raising docking port is carried out
The efficiency of test.
On the basis of embodiment illustrated in fig. 2, optionally, interface test device can be by implementation feasible as follows
Obtain the universal test file (s202 in embodiment illustrated in fig. 2) of interface to be tested, specifically, reality shown in Figure 3
Apply example.
The schematic flow sheet of the acquisition universal test document method that Fig. 3 provides for the present invention, refers to Fig. 3, the method can
To include:
S301, acquisition send to the first packet of interface to be tested;
S302, in the first packet obtain preset kind general information;
S302, according to general information generate universal test file.
In the embodiment shown in fig. 3, when interface test device needs the universal test file obtaining interface to be tested,
Interface test device carries out packet capturing to the data sending to interface to be tested, to obtain the first data sending to interface to be tested
Bag.Due to sending the interface requests message sending to interface to be tested to the data of interface to be tested for client, therefore, obtain
The first packet obtaining includes at least one and sends to the interface requests message of interface to be tested.
Interface test device obtains the general information of preset kind in the first packet.Optionally, this preset kind can
To be pre-set by user.Optionally, the general information in the interface requests message that all clients send to interface to be tested
Identical, interface test device can also obtain the first packet including multiple interface requests message, and please according to multiple interfaces
Message is asked to determine the general information of preset kind, optionally, multiple interface requests message can be included by interface test device
Identical information be defined as general information.
After interface test device acquires general information, interface test device is according to the general information acquiring
Generate universal test file.
Below, by instantiation, the method shown in Fig. 3 embodiment is described in detail.
Exemplary it is assumed that interface to be tested is interface 1, when interface test device needs to obtain the universal test of interface 1
During file, the packet 1 of interface test device crawl transmission to interface 1 is it is assumed that packet 1 includes 3 transmission interfaces requests
Message, this 3 interface requests message are as shown in table 3 respectively:
Table 3
Interface test device is analyzed to three shown in table 3 interface requests message, determines that this three interface requests disappear
Protocol version in breath, url address and request type of service identical it is determined that universal test file is as shown in table 4:
Table 4
In above process, interface test device can determine universal test according to the packet sending to interface to be tested
File, this packet includes the actual interface requests message sending to interface to be tested of client, not only can improve interface
Test device determines the efficiency of universal test file, can also improve interface plan and is only device and determines the accurate of universal test file
Property.
On the basis of any one embodiment above-mentioned, optionally, interface test device can be by reality feasible as follows
The value of all parameters that existing mode treats test interface is combined, and generates multiple parameters file (in embodiment illustrated in fig. 2
S202), specifically, embodiment shown in Figure 4.
The schematic flow sheet of the generation parameter document method that Fig. 4 provides for the present invention, refers to Fig. 4, and the method can be wrapped
Include:
S401, acquisition at least one mandatory parameter of interface to be tested and at least one value of each mandatory parameter;
S402, acquisition at least one optional parameters of interface to be tested and the default value of each optional parameters;
S403, the value to each mandatory parameter are combined, and obtain mandatory parameter file;
S404, the default value according to each mandatory parameter file and each optional parameters, determine multiple parameters file.
In the embodiment shown in fig. 4, interface to be tested corresponds to multiple parameters, and in the plurality of parameter, partial parameters are essential
Parameter, partial parameters are optional parameters.Wherein, mandatory parameter is the parameter needing when generating Parameter File to fill in, and each must
Radix Ginseng selection number at least one fixing value corresponding;Optional parameters is to generate the parameter that need not fill in during Parameter File, and each can
Radix Ginseng selection number to should have a default value, the default value of optional parameters can pre-set for user or interface testing
The random generation of device.For example, for patent consulting system, search-type is mandatory parameter, and search-type includes invention, practicality
New and outward appearance, search key is optional parameters, and this search key is corresponding to be defaulted as to pre-set for user
's.
In actual application, when interface test device needs the multiple parameters file obtaining interface to be tested, connect
Mouth test device obtains at least one mandatory parameter of interface to be tested and at least one value of each mandatory parameter, and interface is surveyed
The default value of at least one optional parameters also obtaining interface to be tested and each optional parameters is put in trial assembly.Certainly, in practical application
During, if user participates in the generating process of test case, user can also input the value of optional parameters, accordingly, connect
Mouth test device uses the value of the optional parameters of user input, and does not use the default value of optional parameters.
Interface test device is combined to the value of each mandatory parameter, obtains mandatory parameter file, and according to each essential
Parameter File and the default value of each optional parameters, determine multiple parameters file.
Below, by specific example, the method shown in Fig. 4 embodiment is described in detail.
Exemplary it is assumed that interface to be tested is interface 1, this interface 1 is used for providing a user with information inquiry business, and this connects
Corresponding 5 parameters of mouth 1, respectively as shown in table 5:
Table 5
Parameter according to table 5 for the interface test device, is combined to the value of each mandatory parameter, obtains multiple combinations
Type, and obtain each composite type mandatory parameter file, optionally, each mandatory parameter file can be as shown in table 6:
Table 6
Mandatory parameter file | The value of parameter |
Mandatory parameter file 1 | Classification=classification 1, scope=scope 1 |
Mandatory parameter file 2 | Classification=classification 1, scope=scope 2 |
Mandatory parameter file 3 | Classification=classification 2, scope=scope 1 |
Mandatory parameter file 4 | Classification=classification 2, scope=scope 2 |
Interface test device also obtains the default value of each keyword, specifically, the default value of each optional parameters
As shown in table 7:
Table 7
Optional parameters | Default value |
Keyword | Keyword 1 |
Display language | Chinese |
Page information quantity | 10 |
Mandatory parameter file according to table 6 for the interface test device and the corresponding acquiescence of each optional parameters shown in table 7
Value, determines multiple parameters file, optionally, the plurality of Parameter File can be as shown in table 8:
Table 8
In above process, interface test device is according to the value of each mandatory parameter of interface to be tested and respectively can Radix Ginseng selection
The default value of number, generates multiple parameters file, so that the Parameter File generating is more proper with practical situation obtaining so that determining
Multiple parameters file more accurate.
On the basis of any one embodiment above-mentioned, optionally, can be by implementation feasible as follows according to logical
With test file and multiple parameters file, generate multiple test cases (s203 in embodiment illustrated in fig. 2), specifically, please join
Embodiment as shown in Figure 5.
The schematic flow sheet of the generation method of test example that Fig. 5 provides for the present invention, refers to Fig. 5, the method can be wrapped
Include:
S501, acquisition test case template;
S502, according to test case template, process is merged to universal test file and each Parameter File, generates multiple
Test case.
In the embodiment shown in fig. 5, universal test file and multiple parameters file are acquired in interface test device
Afterwards, when interface test device needs to obtain the corresponding multiple test case of interface to be tested, interface test device first obtains
Plan test case template.Optionally, interface test device can obtain test case template by implementation feasible as follows,
Specifically, interface test device obtains the second packet sending to interface to be tested, the second packet is parsed, to obtain
Take the position of each parameter and form in universal test file and Parameter File, respectively join according in universal test file and Parameter File
The position of number and form, determine test case template.Try to be measured for client to the data of interface to be tested due to sending
The interface requests message that mouth sends, therefore, the second packet acquiring includes at least one and sends to interface to be tested
Interface requests message.Optionally, universal test literary composition can also be obtained to the second packet after interface test device parses
The other information of each parameter in part and Parameter File, for example shared byte number etc., the present invention is not especially limited to this.
It should be noted that the first packet in the embodiment of the present invention and the second packet are interface test device and grab
Obtaining, send to the packet of interface to be tested, the first packet and the second packet can be identical packet,
Can be different packets.
After interface test device acquires test case template, interface test device according to test case template,
Process is merged to universal test file and each Parameter File, obtains multiple test cases.Optionally, interface test device can
To fill in the parameter in universal test file and Parameter File in test template, to obtain multiple test cases.
In above process, interface test device can obtain test case template, and is generated according to test case template
Multiple test cases, so, not only can improve generate test case efficiency it can also be ensured that generate test case rule
Plasticity.
The structural representation one of the interface test device that Fig. 6 provides for the present invention, refers to Fig. 6, and this device may include that
Acquisition module 601, for obtaining the universal test file of interface to be tested;
First generation module 602, the value for all parameters to described interface to be tested is combined, and generates multiple
Parameter File;
Second generation module 603, for according to described universal test file and the plurality of Parameter File, generating multiple surveys
Example on probation;
Test module 604, for being tested to described interface to be tested by the plurality of test case.
Interface test device shown in the embodiment of the present invention can execute the technical scheme shown in said method embodiment, its
Realize principle and beneficial effect is similar to, no longer repeated herein.
In a kind of possible embodiment, described acquisition module 601 specifically for:
Obtain the first packet sending to described interface to be tested;
Obtain the general information of preset kind in described first packet, and generated according to described general information described logical
Use test file.
In alternatively possible embodiment, described first generation module 602 is used for:
Obtain at least one mandatory parameter of described interface to be tested and at least one value of each described mandatory parameter;
Obtain at least one optional parameters of described interface to be tested and the default value of each described optional parameters;
The value of each described mandatory parameter is combined, obtains mandatory parameter file;
According to the default value of each described mandatory parameter file and each described optional parameters, determine the plurality of Parameter File.
The structural representation two of the interface test device that Fig. 7 provides for the present invention, on the basis of embodiment illustrated in fig. 6,
Refer to Fig. 7, described second generation module 603 includes acquiring unit 6031 and signal generating unit 6032, wherein,
Described acquiring unit 6031 is used for, and obtains test case template;
Described signal generating unit 6032 is used for, according to described test case template, described with each to described universal test file
Parameter File merges process, generates the plurality of test case.
In alternatively possible embodiment, described acquiring unit 6031 specifically for:
Obtain the second packet sending to described interface to be tested;
Described second packet is parsed, to obtain each parameter in described universal test file and described Parameter File
Position and form;
According to the position of each parameter and form in described universal test file and described Parameter File, determine that described test is used
Example template.
In alternatively possible embodiment, described test module 604 specifically for:
Obtain described test case corresponding interface requests message;
Send described interface requests message to described interface to be tested;
Receive the response message of described interface feedback to be tested;
According to described interface requests message and described response message, determine test result.
In alternatively possible embodiment, described universal test file is for storing HTML (Hypertext Markup Language) http
The application programming interface har file of requests/response messages.
Interface test device shown in the embodiment of the present invention can execute the technical scheme shown in said method embodiment, its
Realize principle and beneficial effect is similar to, no longer repeated herein.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each method embodiment can be led to
Cross the related hardware of programmed instruction to complete.Aforesaid program can be stored in a computer read/write memory medium.This journey
Sequence upon execution, executes the step including above-mentioned each method embodiment;And aforesaid storage medium includes: rom, ram, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it is noted that various embodiments above, only in order to technical scheme to be described, is not intended to limit;To the greatest extent
Pipe has been described in detail to the present invention with reference to foregoing embodiments, it will be understood by those within the art that: its according to
So the technical scheme described in foregoing embodiments can be modified, or wherein some or all of technical characteristic is entered
Row equivalent;And these modifications or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technology
The scope of scheme.
Claims (10)
1. a kind of interface test method is it is characterised in that include:
Obtain the universal test file of interface to be tested;
The value of all parameters of described interface to be tested is combined, generates multiple parameters file;
According to described universal test file and the plurality of Parameter File, generate multiple test cases;
By the plurality of test case, described interface to be tested is tested.
2. method according to claim 1 is it is characterised in that obtain the universal test file of interface to be tested, comprising:
Obtain the first packet sending to described interface to be tested;
Obtain the general information of preset kind in described first packet, and described general survey is generated according to described general information
Examination file.
3. method according to claim 1 and 2 is it is characterised in that the value of all parameters to described interface to be tested
It is combined, generate multiple parameters file, comprising:
Obtain at least one mandatory parameter of described interface to be tested and at least one value of each described mandatory parameter;
Obtain at least one optional parameters of described interface to be tested and the default value of each described optional parameters;
The value of each described mandatory parameter is combined, obtains mandatory parameter file;
According to the default value of each described mandatory parameter file and each described optional parameters, determine the plurality of Parameter File.
4. method according to claim 1 and 2 is it is characterised in that described according to described universal test file and described many
Individual Parameter File, generates multiple test cases, comprising:
Obtain test case template;
According to described test case template, process is merged to described universal test file and each described Parameter File, generate
The plurality of test case.
5. method according to claim 4 is it is characterised in that described acquisition test case template, comprising:
Obtain the second packet sending to described interface to be tested;
Described second packet is parsed, to obtain the position of each parameter in described universal test file and described Parameter File
Put and form;
According to the position of each parameter and form in described universal test file and described Parameter File, determine described test case mould
Plate.
6. method according to claim 1 and 2 it is characterised in that be directed to any one test case, described by described
Multiple test cases are tested to described interface to be tested, comprising:
Obtain described test case corresponding interface requests message;
Send described interface requests message to described interface to be tested;
Receive the response message of described interface feedback to be tested;
According to described interface requests message and described response message, determine test result.
7. method according to claim 1 and 2 is it is characterised in that described universal test file is for storing hypertext
The application programming interface har file of host-host protocol http request/response message.
8. a kind of interface test device is it is characterised in that include:
Acquisition module, for obtaining the universal test file of interface to be tested;
First generation module, the value for all parameters to described interface to be tested is combined, and generates multiple parameters literary composition
Part;
Second generation module, for according to described universal test file and the plurality of Parameter File, generating multiple test cases;
Test module, for being tested to described interface to be tested by the plurality of test case.
9. device according to claim 8 it is characterised in that described acquisition module specifically for:
Obtain the first packet sending to described interface to be tested;
Obtain the general information of preset kind in described first packet, and described general survey is generated according to described general information
Examination file.
10. device according to claim 8 or claim 9 is it is characterised in that described first generation module is used for:
Obtain at least one mandatory parameter of described interface to be tested and at least one value of each described mandatory parameter;
Obtain at least one optional parameters of described interface to be tested and the default value of each described optional parameters;
The value of each described mandatory parameter is combined, obtains mandatory parameter file;
According to the default value of each described mandatory parameter file and each described optional parameters, determine the plurality of Parameter File.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610726881.4A CN106354634A (en) | 2016-08-25 | 2016-08-25 | Interface testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610726881.4A CN106354634A (en) | 2016-08-25 | 2016-08-25 | Interface testing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106354634A true CN106354634A (en) | 2017-01-25 |
Family
ID=57854632
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610726881.4A Pending CN106354634A (en) | 2016-08-25 | 2016-08-25 | Interface testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106354634A (en) |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106909481A (en) * | 2017-02-28 | 2017-06-30 | 北京小米移动软件有限公司 | Interface test method, interface test device and electronic equipment |
CN107294808A (en) * | 2017-07-05 | 2017-10-24 | 网易(杭州)网络有限公司 | The methods, devices and systems of interface testing |
CN107301122A (en) * | 2017-05-10 | 2017-10-27 | 深圳市小牛在线互联网信息咨询有限公司 | interface test method, device, storage medium and computer equipment |
CN107577596A (en) * | 2017-08-09 | 2018-01-12 | 福建天泉教育科技有限公司 | Automatic interface testing method, the storage medium of adaptive language and browser |
CN107659949A (en) * | 2017-09-26 | 2018-02-02 | 上海斐讯数据通信技术有限公司 | A kind of wireless router cloud service functional interface method of testing and system |
CN107678902A (en) * | 2017-10-31 | 2018-02-09 | 郑州云海信息技术有限公司 | A kind of method of testing and its device of unified storage array |
CN107844421A (en) * | 2017-10-31 | 2018-03-27 | 平安科技(深圳)有限公司 | Interface test method, device, computer equipment and storage medium |
CN107894952A (en) * | 2017-11-08 | 2018-04-10 | 中国平安人寿保险股份有限公司 | Generation method, device, equipment and the readable storage medium storing program for executing of interface testing use-case |
CN108446221A (en) * | 2018-03-05 | 2018-08-24 | 平安普惠企业管理有限公司 | System detection method, device, computer equipment and storage medium |
CN108446190A (en) * | 2017-02-16 | 2018-08-24 | 杭州海康威视数字技术股份有限公司 | interface test method and device |
CN109189666A (en) * | 2018-08-02 | 2019-01-11 | 腾讯科技(北京)有限公司 | Interface test method, device and computer equipment |
CN109408370A (en) * | 2018-09-18 | 2019-03-01 | 深圳壹账通智能科技有限公司 | Interface testing document generating method, device, computer equipment and storage medium |
CN109450736A (en) * | 2018-12-11 | 2019-03-08 | 杭州网易再顾科技有限公司 | Network interface test method and device, medium and calculating equipment |
CN109522220A (en) * | 2018-10-23 | 2019-03-26 | 中国银行股份有限公司 | A kind of text test method and device |
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN110232016A (en) * | 2019-03-08 | 2019-09-13 | 上海蔚来汽车有限公司 | Interface testing case generation method, device and controller and medium |
CN110337076A (en) * | 2019-07-09 | 2019-10-15 | 深圳壹账通智能科技有限公司 | SMS platform interface test method, device, computer equipment and storage medium |
CN110609785A (en) * | 2018-06-15 | 2019-12-24 | 中移(杭州)信息技术有限公司 | Software interface testing method and device |
WO2020000706A1 (en) * | 2018-06-25 | 2020-01-02 | 平安科技(深圳)有限公司 | Database comparison-based interface testing method and system, device and storage medium |
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
CN110908908A (en) * | 2019-11-21 | 2020-03-24 | 深圳无域科技技术有限公司 | Method and device for testing micro-service Dubbo interface |
CN111090575A (en) * | 2018-10-23 | 2020-05-01 | 亿度慧达教育科技(北京)有限公司 | Test method |
CN111198809A (en) * | 2018-11-16 | 2020-05-26 | 北京奇虎科技有限公司 | Interface automation test method and device |
CN112131127A (en) * | 2020-09-28 | 2020-12-25 | 北京同邦卓益科技有限公司 | Interface testing method, device and system and electronic equipment |
CN114328274A (en) * | 2022-03-07 | 2022-04-12 | 深圳开源互联网安全技术有限公司 | Test template generation method and device, computer equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103164330A (en) * | 2011-12-14 | 2013-06-19 | 航天信息股份有限公司 | Automatic generation method for software test case |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
US20140013298A1 (en) * | 2012-07-06 | 2014-01-09 | International Business Machines Corporation | Auto generation and linkage of source code to test cases |
CN103631720A (en) * | 2013-12-20 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for generating test case |
CN104503900A (en) * | 2014-11-21 | 2015-04-08 | 北京奇虎科技有限公司 | Test case generation method and device |
-
2016
- 2016-08-25 CN CN201610726881.4A patent/CN106354634A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103164330A (en) * | 2011-12-14 | 2013-06-19 | 航天信息股份有限公司 | Automatic generation method for software test case |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
US20140013298A1 (en) * | 2012-07-06 | 2014-01-09 | International Business Machines Corporation | Auto generation and linkage of source code to test cases |
CN103631720A (en) * | 2013-12-20 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for generating test case |
CN104503900A (en) * | 2014-11-21 | 2015-04-08 | 北京奇虎科技有限公司 | Test case generation method and device |
Cited By (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108446190B (en) * | 2017-02-16 | 2021-08-17 | 杭州海康威视数字技术股份有限公司 | Interface test method and device |
CN108446190A (en) * | 2017-02-16 | 2018-08-24 | 杭州海康威视数字技术股份有限公司 | interface test method and device |
CN106909481A (en) * | 2017-02-28 | 2017-06-30 | 北京小米移动软件有限公司 | Interface test method, interface test device and electronic equipment |
CN106909481B (en) * | 2017-02-28 | 2021-03-16 | 北京小米移动软件有限公司 | Interface test method, interface test device and electronic equipment |
CN107301122A (en) * | 2017-05-10 | 2017-10-27 | 深圳市小牛在线互联网信息咨询有限公司 | interface test method, device, storage medium and computer equipment |
CN107294808A (en) * | 2017-07-05 | 2017-10-24 | 网易(杭州)网络有限公司 | The methods, devices and systems of interface testing |
CN107294808B (en) * | 2017-07-05 | 2020-11-24 | 网易(杭州)网络有限公司 | Interface test method, device and system |
CN107577596A (en) * | 2017-08-09 | 2018-01-12 | 福建天泉教育科技有限公司 | Automatic interface testing method, the storage medium of adaptive language and browser |
CN107659949B (en) * | 2017-09-26 | 2021-07-23 | 台州市吉吉知识产权运营有限公司 | Wireless router cloud service function interface test method and system |
CN107659949A (en) * | 2017-09-26 | 2018-02-02 | 上海斐讯数据通信技术有限公司 | A kind of wireless router cloud service functional interface method of testing and system |
CN107844421A (en) * | 2017-10-31 | 2018-03-27 | 平安科技(深圳)有限公司 | Interface test method, device, computer equipment and storage medium |
CN107678902A (en) * | 2017-10-31 | 2018-02-09 | 郑州云海信息技术有限公司 | A kind of method of testing and its device of unified storage array |
WO2019085079A1 (en) * | 2017-10-31 | 2019-05-09 | 平安科技(深圳)有限公司 | Interface test method and apparatus, computer device and storage medium |
CN107894952A (en) * | 2017-11-08 | 2018-04-10 | 中国平安人寿保险股份有限公司 | Generation method, device, equipment and the readable storage medium storing program for executing of interface testing use-case |
CN108446221A (en) * | 2018-03-05 | 2018-08-24 | 平安普惠企业管理有限公司 | System detection method, device, computer equipment and storage medium |
CN110609785A (en) * | 2018-06-15 | 2019-12-24 | 中移(杭州)信息技术有限公司 | Software interface testing method and device |
WO2020000706A1 (en) * | 2018-06-25 | 2020-01-02 | 平安科技(深圳)有限公司 | Database comparison-based interface testing method and system, device and storage medium |
CN109189666A (en) * | 2018-08-02 | 2019-01-11 | 腾讯科技(北京)有限公司 | Interface test method, device and computer equipment |
CN109408370A (en) * | 2018-09-18 | 2019-03-01 | 深圳壹账通智能科技有限公司 | Interface testing document generating method, device, computer equipment and storage medium |
CN111090575A (en) * | 2018-10-23 | 2020-05-01 | 亿度慧达教育科技(北京)有限公司 | Test method |
CN111090575B (en) * | 2018-10-23 | 2021-07-30 | 亿度慧达教育科技(北京)有限公司 | Test method |
CN109522220A (en) * | 2018-10-23 | 2019-03-26 | 中国银行股份有限公司 | A kind of text test method and device |
CN111198809A (en) * | 2018-11-16 | 2020-05-26 | 北京奇虎科技有限公司 | Interface automation test method and device |
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN109450736A (en) * | 2018-12-11 | 2019-03-08 | 杭州网易再顾科技有限公司 | Network interface test method and device, medium and calculating equipment |
CN109450736B (en) * | 2018-12-11 | 2021-03-30 | 杭州网易再顾科技有限公司 | Network interface test method and device, medium and computing equipment |
CN110232016A (en) * | 2019-03-08 | 2019-09-13 | 上海蔚来汽车有限公司 | Interface testing case generation method, device and controller and medium |
CN110337076A (en) * | 2019-07-09 | 2019-10-15 | 深圳壹账通智能科技有限公司 | SMS platform interface test method, device, computer equipment and storage medium |
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
CN110908908A (en) * | 2019-11-21 | 2020-03-24 | 深圳无域科技技术有限公司 | Method and device for testing micro-service Dubbo interface |
CN110908908B (en) * | 2019-11-21 | 2024-03-29 | 深圳无域科技技术有限公司 | Method and device for testing micro-service Dubbo interface |
CN112131127A (en) * | 2020-09-28 | 2020-12-25 | 北京同邦卓益科技有限公司 | Interface testing method, device and system and electronic equipment |
CN112131127B (en) * | 2020-09-28 | 2024-04-16 | 北京同邦卓益科技有限公司 | Interface testing method, device and system and electronic equipment |
CN114328274A (en) * | 2022-03-07 | 2022-04-12 | 深圳开源互联网安全技术有限公司 | Test template generation method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106354634A (en) | Interface testing method and device | |
CN111045756B (en) | Method, apparatus, computing device and medium for generating interface service | |
EP1576487B1 (en) | Web server hit multiplier and redirector | |
US9075914B2 (en) | Analytics driven development | |
CN105871947B (en) | The method and device of cross-domain request data | |
US10362086B2 (en) | Method and system for automating submission of issue reports | |
CN109726128A (en) | A kind of method for generating test case, device and server | |
US8660833B2 (en) | Method, computer program product and apparatus for providing an interactive network simulator | |
CN109460223A (en) | A kind of API gateway management system and its method | |
CN108183838B (en) | Method and device for testing source NAT function | |
CN106371993B (en) | Test method and test device based on data packet | |
WO2019085466A1 (en) | Association test method and system, application server, and computer readable storage medium | |
CN109446837A (en) | Text checking method, equipment and readable storage medium storing program for executing based on sensitive information | |
CN107026773A (en) | Automatic correlation method for interface automatic test | |
CN110221948A (en) | Test script generation method, device, computer installation and storage medium | |
CN103810092A (en) | Application system testing method and device | |
CN106384399A (en) | IOT (Internet of Things)-office-oriented network attendance method | |
CN105068935A (en) | Method and device for processing software test result | |
CN107704369A (en) | A kind of recording method of Operation Log, electronic equipment, storage medium, system | |
CN106295701A (en) | user identification method and device | |
CN113037505B (en) | Method and system for realizing trusted Web application | |
CN113362173A (en) | Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium | |
CN109241712A (en) | A kind of method and apparatus for accessing file system | |
CN107341645A (en) | Demand of human resources information processing method, device, computer equipment and storage medium | |
CN105512020B (en) | Test method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170125 |