CN107329861B - Multi-interface testing method and device - Google Patents

Multi-interface testing method and device Download PDF

Info

Publication number
CN107329861B
CN107329861B CN201710439040.XA CN201710439040A CN107329861B CN 107329861 B CN107329861 B CN 107329861B CN 201710439040 A CN201710439040 A CN 201710439040A CN 107329861 B CN107329861 B CN 107329861B
Authority
CN
China
Prior art keywords
interface
tested
command sequence
interfaces
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710439040.XA
Other languages
Chinese (zh)
Other versions
CN107329861A (en
Inventor
高强
郭海超
***
高国政
姚俊晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qax Technology Group Inc
Original Assignee
Qax Technology Group Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qax Technology Group Inc filed Critical Qax Technology Group Inc
Priority to CN201710439040.XA priority Critical patent/CN107329861B/en
Publication of CN107329861A publication Critical patent/CN107329861A/en
Application granted granted Critical
Publication of CN107329861B publication Critical patent/CN107329861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention provides a multi-interface testing method and device. The method comprises the following steps: analyzing the test case to obtain a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested; according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server; receiving response results corresponding to the interface requests returned by the server; analyzing the response result to complete the test of the plurality of interfaces to be tested; and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested. The embodiment of the invention increases the interface testing depth by appointing the dependency relationship of each interface to be tested in the testing case, and can meet the testing requirements of a plurality of interfaces with higher coupling degree in a complex service scene.

Description

Multi-interface testing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a multi-interface testing method and device.
Background
With the continuous development of computer technology, more and more application programs and more interfaces developed in each application program are provided, and each application program performs data transmission through the corresponding interface. For the newly developed interface, an interface test is required to verify whether the newly developed interface is correct, whether the operation is stable, and a mechanism for processing abnormal data.
In the prior art, interface testing is completed through test cases (testcases), which are message character strings that can be recognized by a service interface and are assembled according to an interface protocol, and generally include input data, testing steps, expected results, and other contents. The existing multi-interface test method arranges and combines a plurality of interfaces to be tested together to form a test interface group. For example, in a conventional multi-interface testing method, a plurality of interfaces to be tested are combined into a testing interface group by a thread group method based on a stress testing tool meter. For another example, in another existing multi-interface testing method, a plurality of interfaces to be tested are combined into a testing interface group in the form of an XML file based on an automated testing framework. In the existing multi-interface testing method, each interface to be tested in the testing interface group (the thread group or the XML file) completes the test in sequence.
However, the inventors found in the course of implementing embodiments of the present invention that: in the prior art, the test result of each single interface to be tested generally has no problem, but in the actual interface test process, the interaction among the application programs generally relates to multiple complex service scenes, and the test of multiple interfaces with higher coupling degree under the complex service scenes has problems.
Disclosure of Invention
The embodiment of the invention provides a multi-interface testing method and device, which are used for solving the problem that the existing multi-interface testing method does not support interface testing in a complex service scene.
The embodiment of the invention provides a multi-interface testing method, which comprises the following steps:
analyzing the test case to obtain a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested;
according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server;
receiving response results corresponding to the interface requests returned by the server;
analyzing the response result to complete the test of the plurality of interfaces to be tested;
and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested.
Optionally, the dependency relationship of each interface under test is specified by a position of each interface under test in the command sequence.
Optionally, the dependency relationship of each interface to be tested is specified by a dependency field.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent by using the response result corresponding to the previous interface to be tested as the input parameter.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
Optionally, the method further comprises:
extracting a target command sequence from a pre-stored public command sequence file by adopting a command, wherein the target command sequence comprises a plurality of common interfaces to be tested and the dependency relationship of each common interface to be tested;
and writing the extracted target command sequence into a target test case.
The embodiment of the invention provides a multi-interface testing device, which comprises:
the test case analysis unit is used for analyzing the test case to acquire a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested;
the interface request sending unit is used for sequentially sending a plurality of interface requests corresponding to the interfaces to be tested to a server according to the dependency relationship of the interfaces to be tested;
a response result receiving unit, configured to receive response results corresponding to the interface requests returned by the server;
the response result analyzing unit is used for analyzing the response result so as to complete the test of the plurality of interfaces to be tested;
and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested.
Optionally, the dependency relationship of each interface under test is specified by a position of each interface under test in the command sequence.
Optionally, the dependency relationship of each interface to be tested is specified by a dependency field.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent by using the response result corresponding to the previous interface to be tested as the input parameter.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
Optionally, the method further comprises:
the system comprises a target command sequence extracting unit, a target command sequence extracting unit and a processing unit, wherein the target command sequence extracting unit is used for extracting a target command sequence from a pre-stored public command sequence file by adopting a command, and the target command sequence comprises a plurality of commonly used interfaces to be tested and the dependency relationship of each commonly used interface to be tested;
and the target command sequence writing unit is used for writing the extracted target command sequence into the target test case.
An embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus; wherein,
the processor and the memory complete mutual communication through the bus;
the processor is used for calling the program instructions in the memory to execute the multi-interface test method.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the multi-interface testing method described above.
According to the multi-interface test method and the multi-interface test device, the test case is analyzed, and a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested are obtained; according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server; receiving response results corresponding to the interface requests returned by the server; analyzing the response result to complete the test of the plurality of interfaces to be tested; and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested. According to the embodiment of the invention, the dependency relationship of each interface to be tested is specified in the test case, so that the depth of interface test is increased, and the test requirements of a plurality of interfaces with higher coupling degree in a complex service scene can be met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart illustrating a multi-interface testing method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a multi-interface testing method of one embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a multi-interface testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flow chart of a multi-interface testing method according to an embodiment of the present invention. As shown in fig. 1, the method of this embodiment uses a test terminal as an execution subject, where the test terminal may be an electronic device such as a smart phone, a Personal Digital Assistant (PDA), a tablet computer, and a notebook computer, and the invention is not limited thereto.
The multi-interface test method of the embodiment comprises the following steps:
s11: analyzing the test case to obtain a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested;
it should be noted that, in the multi-interface testing method in the prior art, each interface to be tested completes the test in sequence, and the dependency relationship between each interface to be tested is not considered, so that the interface test in a complex service scene cannot be supported.
The test terminal of the embodiment of the invention stores the pre-generated test case, and the test case designates the dependency relationship of a plurality of interfaces to be tested, thereby meeting the test requirements of a plurality of interfaces with higher coupling degree under a complex service scene.
In practical application, the test case in the test terminal may be saved in json (JS Object tagging) which is a lightweight data exchange format, may be edited once, and may be used indefinitely, or may be saved in files in other formats such as XML files and csv files, which is not limited in this respect.
In practical application, the test case at least includes a command sequence, and the multiple interfaces to be tested and the dependency relationship of each interface to be tested are stored in the command sequence.
S12: according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server;
it should be noted that, in the two interfaces to be tested having the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the previous interface to be tested.
S13: receiving response results corresponding to the interface requests returned by the server;
it should be noted that, after receiving the interface request sent by the test terminal, the server according to the embodiment of the present invention processes the interface request, generates a response result, and sends the generated response result to the test terminal.
S14: analyzing the response result to complete the test of the plurality of interfaces to be tested;
it should be noted that the test terminal analyzes the response result, compares the response result with the expected result of the test case, and verifies whether the multiple interfaces to be tested operate as expected, so as to complete the test of the multiple interfaces to be tested.
According to the multi-interface testing method provided by the embodiment of the invention, the dependency relationship of each interface to be tested is specified in the testing case, so that the interface testing depth is increased, and the testing requirements of a plurality of interfaces with higher coupling degree under a complex service scene can be met.
In practical application, the multi-interface test method provided by the embodiment of the invention can be suitable for interface tests of standard protocols such as Http, TCP and the like, and can also be suitable for interface tests of private protocols.
In an optional implementation manner of the embodiment of the present invention, the dependency relationship of each interface to be tested is specified by a position of each interface to be tested in the command sequence.
It should be noted that the test case includes a plurality of interfaces to be tested, and the interface arranged in front is tested before the interface arranged in back, that is, the test of the interface arranged in back depends on the response result of the interface arranged in front. It will be appreciated that the dependencies of the multiple interfaces under test in this embodiment are default dependencies, and no special fields are required to specify dependencies.
The following is exemplified by a multi-interface test process in a service scenario of red packet robbing, as shown in fig. 2, a test terminal 22 sends an interface request to a server 21; the application program of the server 21 includes an interface a and an interface B (of course, the application program may also include other interfaces, and here, two interfaces are taken as an example for description), where the interface a is a red packet robbing interface and the interface B is a red packet opening interface. In practical application, the red envelope needs to be preempted to obtain the certificate for opening the red envelope, and then the certificate is used for opening the red envelope, namely, the interface B depends on the response result of the interface A for appropriating the red envelope as input.
Part of the source code of the test case is as follows:
Figure BDA0001319378920000061
Figure BDA0001319378920000071
analyzing the source codes, it can be known that, in the command sequence of the test case, the interface a is located before the interface B, and the response result of the interface a is used as the input of the interface B.
In another optional implementation manner of the embodiment of the present invention, the dependency relationship of each interface to be tested is specified by a dependency field.
It should be noted that the test case includes at least one command sequence, each command sequence has a unique identifier, and this embodiment specifies the dependency relationship of each interface to be tested by relying on the dependendid field.
For example, testcase1 and testcase2 are two test cases, and test case testcase1 is assumed to be used for test interface a, and test case testcase2 is assumed to be used for test interface B; the current traffic scenario requires that the first command sequence (tc1# c1) and the third command sequence (tc1# c3) in testcase1 be executed first, and then the command sequences in testcase2 be executed.
Part of the source code of the test case is as follows:
Figure BDA0001319378920000081
Figure BDA0001319378920000091
analyzing the above source code, it can be seen that the first command sequence (tc2# c1) in test case testcase2 depends on the first command sequence (tc1# c1) and the third command sequence (tc1# c3) in test case testcase 1. According to the embodiment of the invention, by specifying the dependedId field, the flexibility of the combination test of the multiple interfaces to be tested is improved, the deep coverage of the multi-interface test of a complex service scene is completed, and the defect of the stacking test of the existing multi-interface test method is overcome.
Specifically, the dependency relationship of the interface to be tested includes: and taking the response result of the interface request corresponding to the interface to be tested at first as the input parameter of the interface request corresponding to the interface to be tested at last, wherein the processing result of the interface request of the interface to be tested at first is the premise of the processing result of the interface request corresponding to the interface to be tested at last.
In an optional implementation manner of the embodiment of the present invention, the interface request corresponding to the subsequent interface to be tested is sent by using the response result corresponding to the previous interface to be tested as the input parameter.
For example, in the multi-interface test in the red packet preemption service scenario in the above embodiment, the interface request corresponding to the subsequent interface B is sent with the response result corresponding to the previous interface a as the input parameter. The test terminal firstly sends an interface request corresponding to the interface A to the server according to the dependency relationship between the interface A and the interface B, receives a response result corresponding to the interface request returned by the server, takes the response result as an input parameter of the interface request corresponding to the interface B and sends the interface request corresponding to the interface B to the server.
In another optional implementation manner of the embodiment of the present invention, the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
It can be understood that, in another service scenario, the input parameter of the interface request corresponding to the subsequent interface to be tested does not depend on the response result of the interface request corresponding to the previous interface to be tested, but the processing result of the interface request of the previous interface to be tested is the premise of the processing result of the interface request corresponding to the subsequent interface to be tested, and therefore, the interface request corresponding to the subsequent interface to be tested is sent after the response result corresponding to the previous interface to be tested is received.
In practical application, after a multi-interface test in a complex service scene is completed, the test terminal can resend the interface request to call the interface of the server to simulate more service scenes, and the test of multiple interfaces with higher coupling degree is completed.
Further, the method further comprises:
extracting a target command sequence from a pre-stored public command sequence file by adopting a command, wherein the target command sequence comprises a plurality of common interfaces to be tested and the dependency relationship of each common interface to be tested;
and writing the extracted target command sequence into a target test case.
It should be noted that, the test case generation in the existing multi-interface test method does not have the above-mentioned pull-out operation, which increases the complexity and time cost of test case generation. In order to simplify the generation process of the test case, the embodiment of the invention stores the command sequence corresponding to the common interface to be tested (such as the interface to be tested corresponding to the login operation) into the common command sequence file, and extracts the target command sequence from the common command sequence file by using the include command in the process of actually generating the target test case.
Specifically, the format of the common command sequence file is a json file (although the common command sequence may also be stored in other file forms, which is not limited in this embodiment of the present invention), and the data structure of the common command sequence file is Map, where key represents the name of the command sequence and value is the command sequence.
For example, the partial source codes of the common command sequence file comm.
Figure BDA0001319378920000101
In practical application, the command sequence corresponding to comm.json can be written into an actual test case by using an include command according to the command sequence name, so that the complexity and the time cost of test case generation are reduced.
Through the optimization, some interface requests with high reuse rate are put into a container similar to the template, when the interface requests need to be called, the interface requests can be directly included, the repeated data need not be edited every time a new interface test task is needed, the efficiency of the interface test is greatly improved, and the interface requests can be edited for unlimited reference at one time.
Fig. 3 is a schematic structural diagram of a multi-interface testing apparatus according to an embodiment of the present invention. As shown in fig. 3, the apparatus of the embodiment of the present invention includes: the test case analyzing unit 31, the interface request sending unit 32, the response result receiving unit 33, and the response result analyzing unit 34 specifically:
the test case analysis unit 31 is configured to analyze a test case to obtain a plurality of interfaces to be tested in the test case and a dependency relationship between each interface to be tested;
an interface request sending unit 32, configured to sequentially send, to a server, a plurality of interface requests corresponding to each interface to be tested according to the dependency relationship of each interface to be tested;
a response result receiving unit 33, configured to receive response results corresponding to the interface requests returned by the server;
a response result analyzing unit 34, configured to analyze the response result to complete testing of the multiple interfaces to be tested;
and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested.
According to the multi-interface testing device provided by the embodiment of the invention, the dependency relationship of each interface to be tested is specified in the testing example, so that the interface testing depth is increased, and the testing requirements of a plurality of interfaces with higher coupling degree under a complex service scene can be met.
Optionally, the dependency relationship of each interface under test is specified by a position of each interface under test in the command sequence.
Optionally, the dependency relationship of each interface to be tested is specified by a dependency field.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent by using the response result corresponding to the previous interface to be tested as the input parameter.
Optionally, the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
Optionally, the method further comprises:
the system comprises a target command sequence extracting unit, a target command sequence extracting unit and a processing unit, wherein the target command sequence extracting unit is used for extracting a target command sequence from a pre-stored public command sequence file by adopting a command, and the target command sequence comprises a plurality of commonly used interfaces to be tested and the dependency relationship of each commonly used interface to be tested;
and the target command sequence writing unit is used for writing the extracted target command sequence into the target test case.
The multi-interface testing device of the embodiment of the invention can be used for executing the method embodiment, the principle and the technical effect are similar, and the details are not repeated here.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Referring to fig. 4, the electronic device includes: a processor (processor)41, a memory (memory)42, and a bus 43; wherein,
the processor 41 and the memory 42 communicate with each other via a bus 43;
processor 41 is configured to call program instructions in memory 42 to perform the multi-interface test methods provided by the various method embodiments described above.
Furthermore, the logic instructions in the memory 42 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiments provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the multi-interface testing method provided by the above-described method embodiments.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the multi-interface testing method provided by the above-described method embodiments.
According to the multi-interface test method and the multi-interface test device, the test case is analyzed, and a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested are obtained; according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server; receiving response results corresponding to the interface requests returned by the server; analyzing the response result to complete the test of the plurality of interfaces to be tested; and in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested. The embodiment of the invention increases the interface testing depth by appointing the dependency relationship of each interface to be tested in the testing case, and can meet the testing requirements of a plurality of interfaces with higher coupling degree in a complex service scene.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It is to be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the description of the present invention, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description. Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
The above examples are only for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. A multi-interface test method is characterized by comprising the following steps:
analyzing the test case to obtain a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested;
according to the dependency relationship of each interface to be tested, sequentially sending a plurality of interface requests corresponding to each interface to be tested to a server;
receiving response results corresponding to the interface requests returned by the server;
analyzing the response result to complete the test of the plurality of interfaces to be tested;
in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested;
the method further comprises the following steps:
extracting a target command sequence from a pre-stored public command sequence file by adopting a command, wherein the target command sequence comprises a plurality of common interfaces to be tested and the dependency relationship of each common interface to be tested;
writing the extracted target command sequence into a target test case;
further comprising: and storing the command sequence corresponding to the common interface to be tested into a common command sequence file.
2. The method of claim 1, wherein the dependency of each interface under test is specified by a location of each interface under test in the test case.
3. The method of claim 1, wherein the dependency of each interface under test is specified by a dependency field.
4. The method of claim 1, wherein the interface request corresponding to the subsequent interface to be tested is sent with the response result corresponding to the previous interface to be tested as the input parameter.
5. The method of claim 1, wherein the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
6. A multi-interface testing apparatus, comprising:
the test case analysis unit is used for analyzing the test case to acquire a plurality of interfaces to be tested in the test case and the dependency relationship of each interface to be tested;
the interface request sending unit is used for sequentially sending a plurality of interface requests corresponding to the interfaces to be tested to a server according to the dependency relationship of the interfaces to be tested;
a response result receiving unit, configured to receive response results corresponding to the interface requests returned by the server;
the response result analyzing unit is used for analyzing the response result so as to complete the test of the plurality of interfaces to be tested;
in the two interfaces to be tested with the dependency relationship, the interface request corresponding to the subsequent interface to be tested is sent according to the response result corresponding to the prior interface to be tested;
further comprising:
the system comprises a target command sequence extracting unit, a target command sequence extracting unit and a processing unit, wherein the target command sequence extracting unit is used for extracting a target command sequence from a pre-stored public command sequence file by adopting a command, and the target command sequence comprises a plurality of commonly used interfaces to be tested and the dependency relationship of each commonly used interface to be tested;
the target command sequence writing unit is used for writing the extracted target command sequence into a target test case;
further comprising: and storing the command sequence corresponding to the common interface to be tested into a common command sequence file.
7. The apparatus of claim 6, wherein the dependencies of each interface under test are specified by a location of each interface under test in the test case.
8. The apparatus of claim 6, wherein the dependency of each interface under test is specified by a dependency field.
9. The apparatus of claim 6, wherein the interface request corresponding to the subsequent interface to be tested is sent with the response result corresponding to the previous interface to be tested as the input parameter.
10. The apparatus of claim 6, wherein the interface request corresponding to the subsequent interface to be tested is sent after receiving the response result corresponding to the previous interface to be tested.
11. An electronic device, comprising: a processor, a memory, and a bus; wherein,
the processor and the memory complete mutual communication through the bus;
the processor is configured to call program instructions in the memory to perform the multi-interface test method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions that cause the computer to perform the multi-interface testing method of any one of claims 1-5.
CN201710439040.XA 2017-06-12 2017-06-12 Multi-interface testing method and device Active CN107329861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710439040.XA CN107329861B (en) 2017-06-12 2017-06-12 Multi-interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710439040.XA CN107329861B (en) 2017-06-12 2017-06-12 Multi-interface testing method and device

Publications (2)

Publication Number Publication Date
CN107329861A CN107329861A (en) 2017-11-07
CN107329861B true CN107329861B (en) 2020-12-22

Family

ID=60195521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710439040.XA Active CN107329861B (en) 2017-06-12 2017-06-12 Multi-interface testing method and device

Country Status (1)

Country Link
CN (1) CN107329861B (en)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153670B (en) * 2017-11-30 2021-07-30 北京奇艺世纪科技有限公司 Interface testing method and device and electronic equipment
CN109871312B (en) * 2017-12-05 2022-08-12 航天信息股份有限公司 Interface testing method, device, equipment and readable storage medium
CN107957952A (en) * 2017-12-18 2018-04-24 马上消费金融股份有限公司 Interface test method, device and medium
CN107995068B (en) * 2017-12-20 2020-04-07 北京百度网讯科技有限公司 Network port testing method, equipment and computer readable storage medium
CN108255738A (en) * 2018-04-09 2018-07-06 平安普惠企业管理有限公司 Automated testing method, device, computer equipment and storage medium
CN109254920A (en) * 2018-09-06 2019-01-22 上海精数信息科技有限公司 Interface testing case generation method, device, electronic equipment, storage medium
CN111124871A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Interface test method and device
CN110008111A (en) * 2019-01-31 2019-07-12 阿里巴巴集团控股有限公司 A kind of service test method and device
CN110109656B (en) * 2019-03-25 2024-06-28 平安科技(深圳)有限公司 Interface simulation method, device, computer equipment and storage medium
CN111752821B (en) * 2019-03-29 2024-06-04 上海哔哩哔哩科技有限公司 Method, device, computer equipment and readable storage medium for packet pressure measurement
CN109960658B (en) * 2019-03-29 2022-06-03 北京金山云网络技术有限公司 Application programming interface testing method and device, electronic equipment and storage medium
CN110532168B (en) * 2019-07-05 2024-03-29 中国平安财产保险股份有限公司 Full-link interface pressure measurement method and device, computer equipment and storage medium
CN110618906B (en) * 2019-08-07 2023-07-18 中移(杭州)信息技术有限公司 Missing detection interface detection method and device, network equipment and storage medium
CN110609781A (en) * 2019-08-29 2019-12-24 凡普数字技术有限公司 Interface test method, device and storage medium
CN110543386B (en) * 2019-09-16 2022-06-10 上海达梦数据库有限公司 Data storage method, device, equipment and storage medium
CN110659209A (en) * 2019-09-19 2020-01-07 北京达佳互联信息技术有限公司 Automatic testing method, device and system based on interface calling
CN113094251B (en) * 2019-12-23 2024-02-23 深圳奇迹智慧网络有限公司 Method and device for testing embedded system, computer equipment and storage medium
CN111708690B (en) * 2020-05-22 2022-07-26 苏州浪潮智能科技有限公司 Container-based simulation interface test method and device
CN112463588A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Automatic test system and method, storage medium and computing equipment
CN112540915B (en) * 2020-11-30 2024-07-19 锐捷网络股份有限公司 Interface testing method, device and system
CN112486828A (en) * 2020-12-01 2021-03-12 广州品唯软件有限公司 Test case generation method and device, computer equipment and storage medium
CN113238904B (en) * 2021-05-25 2023-04-28 海光信息技术股份有限公司 Interface switching device, interface testing method and interface switching system
CN117349185B (en) * 2023-12-04 2024-02-23 杭银消费金融股份有限公司 System testing method based on interface strength dependence grading

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096631A (en) * 2009-12-11 2011-06-15 华为技术有限公司 Interface testing method and device
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN105138461A (en) * 2015-09-23 2015-12-09 网易(杭州)网络有限公司 Interface testing method and device for application program
CN106528418A (en) * 2016-10-28 2017-03-22 广东浪潮大数据研究有限公司 Test method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277186C (en) * 2003-12-22 2006-09-27 联想(北京)有限公司 Software interface testing method
US8649995B2 (en) * 2011-04-07 2014-02-11 Infosys Technologies, Ltd. System and method for efficient test case generation using input dependency information
US20140310690A1 (en) * 2013-04-15 2014-10-16 Futurewei Technologies, Inc. System and Method for Generating Automated Test Cases for Command Line Based Applications
CN106095673B (en) * 2016-06-07 2018-12-14 深圳市泰久信息***股份有限公司 Automated testing method and system based on WEB interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096631A (en) * 2009-12-11 2011-06-15 华为技术有限公司 Interface testing method and device
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN105138461A (en) * 2015-09-23 2015-12-09 网易(杭州)网络有限公司 Interface testing method and device for application program
CN106528418A (en) * 2016-10-28 2017-03-22 广东浪潮大数据研究有限公司 Test method and device

Also Published As

Publication number Publication date
CN107329861A (en) 2017-11-07

Similar Documents

Publication Publication Date Title
CN107329861B (en) Multi-interface testing method and device
CN108958714B (en) Business component type development method and device, computer equipment and storage medium
CN107665233B (en) Database data processing method and device, computer equipment and storage medium
US20150128103A1 (en) System and method for automating application programming interface integration
US9418241B2 (en) Unified platform for big data processing
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN109460358B (en) Configuration management method and system based on Cmdb
CN103927314B (en) A kind of method and apparatus of batch data processing
US10284561B2 (en) Method and server for providing image captcha
CN110798445B (en) Public gateway interface testing method and device, computer equipment and storage medium
CN113760730B (en) Automatic test method and device
CN110413594A (en) A kind of more example method for testing pressure of Redis and device
CN113656503A (en) Data synchronization method, device and system and computer readable storage medium
CN111367690A (en) Method and device for supporting combined API service calling
CN109656791B (en) gPC performance test method and device based on Jmeter
CN113609427B (en) System data resource extraction method and system under no-interface condition
CN106528066B (en) Business process operation method and device
CN110727416B (en) Development framework generation method and related device
CN103326892B (en) The operating method and device of web interface
CN110389754B (en) Service processing method, system, server, terminal, electronic equipment and storage medium
CN113986747A (en) Data generation method and device, electronic equipment and storage medium
CN109981548B (en) Method and device for analyzing charging message
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN113537931A (en) Electronic seal generation method and device and electronic seal verification method and device
CN112765038A (en) Distributed cluster software testing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100088 Building 3 332, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing

Applicant after: QAX Technology Group Inc.

Address before: 100015 Jiuxianqiao Chaoyang District Beijing Road No. 10, building 15, floor 17, layer 1701-26, 3

Applicant before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant