CN110059011A - Interface test method, device, medium and electronic equipment - Google Patents

Interface test method, device, medium and electronic equipment Download PDF

Info

Publication number
CN110059011A
CN110059011A CN201910323400.9A CN201910323400A CN110059011A CN 110059011 A CN110059011 A CN 110059011A CN 201910323400 A CN201910323400 A CN 201910323400A CN 110059011 A CN110059011 A CN 110059011A
Authority
CN
China
Prior art keywords
interface
test
case
document
address
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
Application number
CN201910323400.9A
Other languages
Chinese (zh)
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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201910323400.9A priority Critical patent/CN110059011A/en
Publication of CN110059011A publication Critical patent/CN110059011A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present disclosure is related to information technology field, a kind of interface test method, device, medium and electronic equipment are provided, the interface test method includes: to generate multiple test cases according to the interface document of distinct interface, wherein not repeating between the multiple test case;The multiple test case is separately sent to destination address according to the address that the interface document describes;The test request from the distinct interface is responded accordingly by the destination address and is intercepted, postcondition verifying is carried out to the response of interception;The test sample of mistake is repaired, and carries out regression test after repairing successfully.The embodiment of the present disclosure continues in regression test after repairing to the test sample of mistake, can modify interface document at any time, be tested at any time, saves the cost consumption of multidisciplinary cooperation, accelerates testing efficiency.

Description

Interface test method, device, medium and electronic equipment
Technical field
This disclosure relates to information technology field, in particular to a kind of interface test method, device, medium and electronics Equipment.
Background technique
With web technology fast development, back-end services become to become increasingly complex, and front end website/APP etc. is required by answering Data friendship is carried out with Program Interfaces (Application Programming Interface, abbreviation API) and back-end services Mutually, it is essential how to guarantee that the defect of back-end services exposes as early as possible, reduce great production accident and comprehensively tested.
Interface testing scheme is that tester is based on the various request samples of business model design at present, then according to request sample Example carries out Black-box Testing, and the correctness of response data is judged by the way of artificial or detection instrument, in whole process Need a large amount of manual labor.If interface changes, it is also necessary to regression test is carried out, to guarantee that modification will not influence other The availability of interface results in the need for the regression test for carrying out a large amount of repeatability.
Therefore, there is also the places that has much room for improvement in technical solution in the prior art.
It should be noted that the information disclosed in above-mentioned background technique is only used for reinforcing the reason to the background of the disclosure Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
The embodiment of the present disclosure is designed to provide a kind of interface test method, device, medium and electronic equipment, Jin Erzhi Few disadvantage for overcoming existing access mechanism safety difference to a certain extent.
Other characteristics and advantages of the disclosure will be apparent from by the following detailed description or data subsegment pass through this It is disclosed practice and acquistion.
According to the first aspect of the embodiments of the present disclosure, a kind of interface test method is provided, comprising:
Multiple test cases are generated according to the interface document of distinct interface, wherein not weighing between the multiple test case It is multiple;
The multiple test case is separately sent to destination address according to the address that the interface document describes;
The test request from the distinct interface is responded accordingly by the destination address and is intercepted, to interception Response carry out postcondition verifying;
The test sample of mistake is repaired, and carries out regression test after repairing successfully.
It is described that multiple tests use are generated according to the interface document of distinct interface in a kind of exemplary embodiment of the disclosure Before example, the method also includes:
It is initialized according to the destination address of user setting.
It is described that multiple tests use are generated according to the interface document of distinct interface in a kind of exemplary embodiment of the disclosure After example, the method also includes:
The multiple test case is grouped according to type;
The interface document of the distinct interface and the test case of grouping are saved in the database respectively.
In a kind of exemplary embodiment of the disclosure, the method also includes:
Corresponding global parameter setting is carried out according to the precondition of user setting;And
According to the verification condition rule of the postcondition of user setting setting response.
In a kind of exemplary embodiment of the disclosure, according to the address of interface document description by the multiple test Use-case is separately sent to before destination address, the method also includes:
The multiple test case is handled according to the precondition.
In a kind of exemplary embodiment of the disclosure, after the response of described pair of interception carries out postcondition verifying, The method also includes:
If the verification passes, then be successfully tested, the availability of the interface be it is available, by this test request, corresponding Corresponding and verification result is saved in database.
In a kind of exemplary embodiment of the disclosure, after the response of described pair of interception carries out postcondition verifying, The method also includes:
If verifying does not pass through, test crash, the test case of mistake is deleted.
According to the second aspect of an embodiment of the present disclosure, a kind of interface test device is provided, comprising:
Use-case generation module, for generating multiple test cases according to the interface document of distinct interface, wherein the multiple It is not repeated between test case;
Use-case sending module, the address for being described according to the interface document send the multiple test case respectively To destination address;
Blocking module is responded, for ringing accordingly by the destination address to the test request from the distinct interface It should be intercepted, postcondition verifying is carried out to the response of interception;
Recovery test module repairs for the test sample to mistake, and carries out regression test after repairing successfully.
According to the third aspect of an embodiment of the present disclosure, a kind of computer-readable medium is provided, computer journey is stored thereon with Sequence realizes above-described interface test method when described program is executed by processor.
According to a fourth aspect of embodiments of the present disclosure, a kind of electronic equipment is provided, comprising:
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are one or more of When processor executes, so that one or more of processors realize above-described interface test method.
The technical solution that the embodiment of the present disclosure provides can include the following benefits:
In the technical solution provided by some embodiments of the present disclosure, on the one hand, repaired to the test sample of mistake Continued in regression test after multiple, interface document can be modified at any time, tested at any time, save multidisciplinary cooperation at Testing efficiency is accelerated in this consumption.On the other hand, by being intercepted to response, so as to by all test requests, response and Verifying is saved in database, and data can be reviewed, the difference between different editions, reduces repetitive operation, reduces building simulation The workload of data.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and constitutes a data subsegment of this specification, shows and meets the disclosure Embodiment, and together with specification for explaining the principles of this disclosure.It should be evident that the accompanying drawings in the following description is only this Disclosed some embodiments for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.In the accompanying drawings:
Fig. 1 is a kind of flow diagram of the interface test method provided according to one embodiment of the disclosure.
Fig. 2 is the overall flow figure of interface test method according to Fig. 1.
Fig. 3 is the architecture diagram for realizing the system of interface test method shown in Fig. 2.
Fig. 4 is a kind of schematic diagram of interface test device shown according to an exemplary embodiment.
Fig. 5 is the structural schematic diagram of the computer system of a kind of electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the disclosure will more Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.It is identical attached in figure Icon note indicates same or similar part, thus will omit repetition thereof.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner In example.In the following description, many details are provided to provide and fully understand to embodiment of the disclosure.However, It will be appreciated by persons skilled in the art that can with technical solution of the disclosure without one or more in specific detail, Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side Method, device, realization or operation are to avoid fuzzy all aspects of this disclosure.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity. I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step, It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close And or data subsegment merge, therefore the sequence actually executed is possible to change according to the actual situation.
It should be understood that although herein various assemblies may be described using term first, second, third, etc., these groups Part should not be limited by these terms.These terms are to distinguish a component and another component.Therefore, first group be discussed herein below Part can be described as the second component without departing from the teaching of disclosure concept.As used herein, term "and/or" includes associated All combinations for listing any of project and one or more.
It will be understood by those skilled in the art that attached drawing is the schematic diagram of example embodiment, module or process in attached drawing Necessary to not necessarily implementing the disclosure, therefore it cannot be used for the protection scope of the limitation disclosure.
There are the following problems for the scheme of interface testing in disclosure related embodiment:
For new product, tester and developer could be online after needing to carry out interface detailed interface testing.By In code revision, profile changes, and results in the need for the regression test for carrying out a large amount of repeatability;Again very because of test process It is cumbersome, need to design a large amount of mock data (needing back-end data to be simulated, i.e. simulation back-end data as front end), great Liang Chong It returns to work work, it is time-consuming and laborious;Due also to profile is the root that a system is designed and developed, if system modification profile, Test case also can be changed accordingly, cause document files asynchronous with test data version.
Based on the above issues, the disclosure provides a kind of interface test method, device, medium and electronic equipment, below to this Disclosed technical solution does specific introduction.
Fig. 1 is a kind of flow diagram of the interface test method provided according to one embodiment of the disclosure, should with reference to Fig. 1 Interface test method includes:
Step S110 generates multiple test cases according to the interface document of distinct interface, wherein the multiple test case Between do not repeat.
Step S120, according to the interface document description address by the multiple test case with being separately sent to target Location.
Step S130 responds the test request from the distinct interface accordingly by the destination address and blocks It cuts, postcondition verifying is carried out to the response of interception.
Step S140 repairs the test sample of mistake, and carries out regression test after repairing successfully.
In technical solution provided by embodiment shown in Fig. 1, on the one hand, repair to the test sample of mistake subsequent It is continuous to utilize in regression test, interface document can be modified at any time, is tested at any time, and the cost for saving multidisciplinary cooperation disappears Consumption accelerates testing efficiency.On the other hand, by being intercepted to response, so as to by all test requests, response and verifying It is saved in database, data can be reviewed, the difference between different editions, reduce repetitive operation, reduce building analogue data Workload.
The specific implementation of each step of embodiment illustrated in fig. 1 is described in detail below:
In step s 110, multiple test cases are generated according to the interface document of distinct interface, wherein the multiple test It is not repeated between use-case.
In a kind of exemplary embodiment of the disclosure, which generates multiple tests according to the interface document of distinct interface Before use-case, further includes:
It is initialized according to the destination address of user setting.
For example, according to the proxied item address order of the user setting received, i.e., destination address order (ip: Port, such as local 8080 ports are http: // 127.0.0.1:8080), object initialization is carried out, the present invention will be intercepted directly All requests of destination item address.
In a kind of exemplary embodiment of the disclosure, includes but is not limited to request path in the interface document, returns Parameter, required parameter, requesting method concurrently set the restrictive condition of each parameter, such as: character length, option, parameter type Deng.By interface document it is found that interface should be at least made of, part request address, requesting method, required parameter (enter ginseng and go out to join) Interface has request header header.Request header (header) is sent out before server passes HTML data to browser with http protocol Word string, it is still necessary to the separation of empty a line between request header and html file, general information such as storage cookie, token.
In a kind of exemplary embodiment of the disclosure, according to attribute (such as parameter of field in interface document in the step Type, limits value etc.) the different random value of production, a large amount of unduplicated test case is just formed after multiple field splicings.
In a kind of exemplary embodiment of the disclosure, which generates multiple tests according to the interface document of distinct interface After use-case, further includes:
Firstly, being grouped to the multiple test case according to type, such as include correct use-case group, mistake use-case Multiple groupings such as group, boundary use-case group, state use-case group;Then, by the test of the interface document of the distinct interface and grouping Use-case saves in the database respectively, and subsequent step is facilitated to inquire and call directly.It, can be in this way, test data can store It is needing to be to call and access test data, is finding the difference between different editions, solve interface document and fail with test data Synchronous problem in time.
In the step s 120, the multiple test case is separately sent to by mesh according to the address that the interface document describes Mark address.
In step s 130, by the destination address to the test request from the distinct interface respond accordingly into Row intercepts, and carries out postcondition verifying to the response of interception.
In a kind of exemplary embodiment of the disclosure, before step S120 further include: according to the preposition item of user setting Part carries out corresponding global parameter setting;And the verification condition rule according to the setting response of the postcondition of user setting.Its Middle precondition includes such as authenticating token, user information acquisition, Verification rule, the data processing before setting test, and The design parameter value in return parameters can be verified by postcondition, with the success or not of exact p-value.
In a kind of exemplary embodiment of the disclosure, step S120 will be described according to the address that the interface document describes Multiple test cases are separately sent to before destination address, further includes:
The multiple test case is handled according to the precondition, the test case that obtains that treated.
It, will be each mainly according to test command is started in step S120 in a kind of exemplary embodiment of the disclosure Test case carries out precondition processing, then sends destination item address for this use-case according to the address that document describes, and All responses are intercepted, postcondition verifying are carried out according to the response of interception, and success or not is marked according to verification result.Only All responses, such as header are intercepted, the data such as body can just compare, and then carry out the verifying of postcondition.
In a kind of exemplary embodiment of the disclosure, postcondition verifying is carried out to the response of interception in step S130 Specifically: it is returned the result by verifying interface with whether the generic attribute in interface document unanimously judges that verification result whether may be used With, if verifying interface return field and interface document attribute in field it is consistent if succeed, as long as interface return knot Fruit is proved to be successful, then must interface be available, but interface is available to be not necessarily proved to be successful.
In a kind of exemplary embodiment of the disclosure, after step S130, comprising:
If the verification passes, then be successfully tested, the availability of the interface be it is available, by this test request, corresponding Corresponding and verification result is saved in database, to facilitate subsequent step to obtain when needed.
In a kind of exemplary embodiment of the disclosure, step S130 carries out postcondition verifying to the response of interception, Then step S140 is analyzed according to verification result and is taken different subsequent strategies, as described in step S140, for mistake Test sample is repaired, and carries out regression test after repairing successfully, may be implemented to modify interface document at any time in this way, at any time It is tested.In addition, test crash deletes the test case of mistake if verifying does not pass through, guarantee to make next time With in this way can be with exclusive PCR item.Furthermore it is also possible to be carried out after facilitating modify next time using partial test use-case as test group Regression test.
Based on above-mentioned, Fig. 2 shows overall flow figures, comprising the following steps:
As shown in Fig. 2, mainly including two stages to realize the automation interface test described based on document: configuration rank Section and test phase include user's operation and the internal process behaviour that executes depending on the user's operation of application in process shown in Fig. 2 Make.
First stage: configuration phase
As shown in Fig. 2, in step s 201, user starts project.
As shown in Fig. 2, opening browsing access service according to the start command of user using inside in step S202.
As shown in Fig. 2, in step S203, user's grassroot project and proxy item destination IP.
As shown in Fig. 2, in step S204, using home agent destination item all request and response.
As shown in Fig. 2, in step S205, using internal real-time storage all test request and response.
As shown in Fig. 2, user writes interface document in step S206.
As shown in Fig. 2, generating multiple unduplicated tests according to the description of interface document using inside in step S207 Use-case.
As shown in Fig. 2, carrying out classification preservation to test case using inside in step S208.
As shown in Fig. 2, in step S209, user setting precondition.
As shown in Fig. 2, joining using inside according to the overall situation that the precondition of user setting is responded in step S210 Number setting.
As shown in Fig. 2, in step S211, user setting postcondition.
As shown in Fig. 2, testing for each response is arranged according to the postcondition of user setting using inside in step S212 Demonstrate,prove conditional plan.
Second stage: test phase
As shown in Fig. 2, user issues the order for starting test in step S213.
As shown in Fig. 2, carrying out test process using inside in step S214, stores all requests, response and state and sentence The availability of slave interrupt interface.
As shown in Fig. 2, in step S215, test result is grouped and is saved, particularly as being that be successfully tested is interface It can use, and test is unsuccessful, saves respectively in the database.
As shown in Fig. 2, in step S216, for the test sample of mistake, after repairing bug, regression test, still later Execute step S214 and S215.
Based on shown in Fig. 2, in test phase, user can check test case according to different condition, analyze and make mistake Test case after repairing bug, carries out regression test;User can also directly delete the test case of mistake, guarantee next time not It will use, reduce unnecessary workload;User can also facilitate modification next time laggard using partial test use-case as test group Row regression test.The test case that correct test case or analysis make mistake can store, subsequent to play back, between different editions Difference as it can be seen that maintaining easily.
Fig. 3 is the architecture diagram for realizing the system of interface test method shown in Fig. 2, as shown in figure 4, the system 300 includes User terminal 310 and server 320, wherein user terminal 310 be used for complete the first stage shown in Fig. 2 step S201, The step S213 and S216 of S203, S206, S209 and S211 and second stage;Server 320 is shown in Fig. 2 for completing The step S214 of step S201, S204, S205, S207, S208, S210 and S212 of first stage and second stage and S215.The order of user and the condition of setting are obtained, by user terminal 310 so as to the interface testing process to server 320 It is controlled.
In conclusion using the embodiment of the present disclosure provide interface test method, on the one hand, to mistake test sample into Row continues in regression test after repairing, and can modify interface document at any time, be tested at any time, save multidisciplinary cooperation Cost consumption, accelerate testing efficiency.On the other hand, by being intercepted to response, so as to by all test requests, sound It should be saved in database with verifying, data can be reviewed, the difference between different editions, reduce repetitive operation, reduce building The workload of analogue data.
Corresponding with above-mentioned interface test method, Fig. 4 is a kind of interface testing provided according to one embodiment of the disclosure The schematic diagram of device, with reference to Fig. 4, interface test device 400 includes: use-case generation module 410, use-case sending module 420, response Blocking module 430 and recovery test module 440.
Use-case generation module 410 is used to generate multiple test cases according to the interface document of distinct interface, wherein described more It is not repeated between a test case;Use-case sending module 420 is used for will be the multiple according to the address that the interface document describes Test case is separately sent to destination address;Blocking module 430 is responded to be used for through the destination address to from the difference The test request of interface responds intercepted accordingly, carries out postcondition verifying to the response of interception;Recovery test module 440 repair for the test sample to mistake, and carry out regression test after repairing successfully.
Each functional module and above-mentioned interface shown in Fig. 2 due to the interface test device of the example embodiment of the disclosure The step of example embodiment of test method, is corresponding, therefore for those undisclosed details in the apparatus embodiments, please refers to The embodiment of the above-mentioned interface test method of the disclosure.
In conclusion using the embodiment of the present disclosure provide interface test device, on the one hand, to mistake test sample into Row continues in regression test after repairing, and can modify interface document at any time, be tested at any time, save multidisciplinary cooperation Cost consumption, accelerate testing efficiency.On the other hand, by being intercepted to response, so as to by all test requests, sound It should be saved in database with verifying, data can be reviewed, the difference between different editions, reduce repetitive operation, reduce building The workload of analogue data.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the electronic equipment for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.The computer system 500 of electronic equipment shown in Fig. 5 is only an example, should not be to the embodiment of the present invention Function and use scope bring any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 505 and Execute various movements appropriate and processing.In RAM503, it is also stored with various programs and data needed for system operatio.CPU 501, ROM 502 and RAM 503 is connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to bus 504。
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media 511 are mounted.When the computer program is executed by central processing unit (CPU) 501, executes and limited in the system of the application Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment. Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs When standby execution, so that the electronic equipment realizes such as the above-mentioned medical data management method as described in the examples based on block chain.
For example, the electronic equipment may be implemented as shown in Figure 1: step S110, according to the interface of distinct interface The multiple test cases of document structure tree, wherein not repeated between the multiple test case;Step S120, according to the interface document The multiple test case is separately sent to destination address by the address of description;Step S130, by the destination address to next It responds and is intercepted accordingly from the test request of the distinct interface, postcondition verifying is carried out to the response of interception;Step Rapid S140 repairs the test sample of mistake, and carries out regression test after repairing successfully.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description Member, but this division is not enforceable.In fact, embodiment according to the present invention, it is above-described two or more Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould The feature and function of block or unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. a kind of interface test method characterized by comprising
Multiple test cases are generated according to the interface document of distinct interface, wherein not repeating between the multiple test case;
The multiple test case is separately sent to destination address according to the address that the interface document describes;
The test request from the distinct interface is responded accordingly by the destination address and is intercepted, to the sound of interception It should be worth and carry out postcondition verifying;
The test sample of mistake is repaired, and carries out regression test after repairing successfully.
2. interface test method according to claim 1, which is characterized in that described raw according to the interface document of distinct interface Before multiple test cases, further includes:
It is initialized according to the destination address of user setting.
3. interface test method according to claim 1, which is characterized in that described raw according to the interface document of distinct interface After multiple test cases, further includes:
The multiple test case is grouped according to type;
The interface document of the distinct interface and the test case of grouping are saved in the database respectively.
4. interface test method according to claim 1, which is characterized in that further include:
Corresponding global parameter setting is carried out according to the precondition of user setting;And
According to the verification condition rule of the postcondition of user setting setting response.
5. interface test method according to claim 4, which is characterized in that will according to the address of interface document description The multiple test case is separately sent to before destination address, further includes:
The multiple test case is handled according to the precondition.
6. interface test method according to claim 1, which is characterized in that the response of described pair of interception carries out postposition item After part verifying, further includes:
If the verification passes, then be successfully tested, the availability of the interface be it is available, by this test request, corresponding corresponding And verification result is saved in database.
7. interface test method according to claim 6, which is characterized in that the response of described pair of interception carries out postposition item After part verifying, further includes:
If verifying does not pass through, test crash, the test case of mistake is deleted.
8. a kind of interface test device characterized by comprising
Use-case generation module, for generating multiple test cases according to the interface document of distinct interface, wherein the multiple test It is not repeated between use-case;
The multiple test case is separately sent to mesh by use-case sending module, the address for being described according to the interface document Mark address;
Respond blocking module, for by the destination address to the test request from the distinct interface respond accordingly into Row intercepts, and carries out postcondition verifying to the response of interception;
Recovery test module repairs for the test sample to mistake, and carries out regression test after repairing successfully.
9. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is executed by processor Interface test method of the Shi Shixian as described in any one of claims 1 to 7.
10. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing When device executes, so that one or more of processors realize the interface testing side as described in any one of claims 1 to 7 Method.
CN201910323400.9A 2019-04-22 2019-04-22 Interface test method, device, medium and electronic equipment Pending CN110059011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910323400.9A CN110059011A (en) 2019-04-22 2019-04-22 Interface test method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910323400.9A CN110059011A (en) 2019-04-22 2019-04-22 Interface test method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110059011A true CN110059011A (en) 2019-07-26

Family

ID=67320015

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910323400.9A Pending CN110059011A (en) 2019-04-22 2019-04-22 Interface test method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110059011A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471859A (en) * 2019-09-12 2019-11-19 泰康保险集团股份有限公司 Service test method, device, medium and electronic equipment
CN111858335A (en) * 2020-07-20 2020-10-30 杭州溪塔科技有限公司 Block chain SDK testing method and device
CN111949520A (en) * 2020-07-31 2020-11-17 上海中通吉网络技术有限公司 Automatic interface test method and equipment
CN113760715A (en) * 2020-11-12 2021-12-07 北京京东振世信息技术有限公司 Method and device for testing system
CN114666301A (en) * 2020-12-22 2022-06-24 深圳Tcl新技术有限公司 APP testing method and system based on mock server
CN114676062A (en) * 2022-04-06 2022-06-28 北京百度网讯科技有限公司 Method and device for testing difference data of interface, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6415396B1 (en) * 1999-03-26 2002-07-02 Lucent Technologies Inc. Automatic generation and maintenance of regression test cases from requirements
US20090320002A1 (en) * 2008-06-20 2009-12-24 Cadence Design Systems, Inc. Method and system for testing and analyzing user interfaces
CN106776287A (en) * 2016-11-24 2017-05-31 泰康保险集团股份有限公司 Servlet interface test methods and test client
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
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN108681507A (en) * 2018-05-08 2018-10-19 浪潮软件集团有限公司 Method for realizing automatic testing of RESTful API and web service
CN109446071A (en) * 2018-09-26 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, interface test device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6415396B1 (en) * 1999-03-26 2002-07-02 Lucent Technologies Inc. Automatic generation and maintenance of regression test cases from requirements
US20090320002A1 (en) * 2008-06-20 2009-12-24 Cadence Design Systems, Inc. Method and system for testing and analyzing user interfaces
CN106776287A (en) * 2016-11-24 2017-05-31 泰康保险集团股份有限公司 Servlet interface test methods and test client
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
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN108681507A (en) * 2018-05-08 2018-10-19 浪潮软件集团有限公司 Method for realizing automatic testing of RESTful API and web service
CN109446071A (en) * 2018-09-26 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, interface test device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑人杰: "《计算机软件测试技术》", 31 December 1992 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471859A (en) * 2019-09-12 2019-11-19 泰康保险集团股份有限公司 Service test method, device, medium and electronic equipment
CN111858335A (en) * 2020-07-20 2020-10-30 杭州溪塔科技有限公司 Block chain SDK testing method and device
CN111949520A (en) * 2020-07-31 2020-11-17 上海中通吉网络技术有限公司 Automatic interface test method and equipment
CN113760715A (en) * 2020-11-12 2021-12-07 北京京东振世信息技术有限公司 Method and device for testing system
CN114666301A (en) * 2020-12-22 2022-06-24 深圳Tcl新技术有限公司 APP testing method and system based on mock server
CN114676062A (en) * 2022-04-06 2022-06-28 北京百度网讯科技有限公司 Method and device for testing difference data of interface, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN110059011A (en) Interface test method, device, medium and electronic equipment
CN109446099A (en) Automatic test cases generation method, device, medium and electronic equipment
US10318667B2 (en) Test case generation
CN109358858A (en) Automatically dispose method, apparatus, medium and electronic equipment
CN108897691A (en) Data processing method, device, server and medium based on interface analog service
CN111309343A (en) Development deployment method and device
CN109614319B (en) Automatic testing method and device, electronic equipment and computer readable medium
CN108111364A (en) The test method and device of a kind of operation system
CN109002385A (en) Method for testing pressure and device for data flow system
JP2021192214A (en) Method and device for verifying operation states of applications
CN112363938A (en) Data processing method and device, electronic equipment and storage medium
CN112988588B (en) Client software debugging method and device, storage medium and electronic equipment
CN111767209A (en) Code testing method, device, storage medium and terminal
US10310962B2 (en) Infrastructure rule generation
CN112988600A (en) Service scene testing method and device, electronic equipment and storage medium
CN115221033A (en) Interface protocol testing method and device, computer readable medium and electronic equipment
CN112988578A (en) Automatic testing method and device
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN112328473A (en) Code automation integration test method and device and electronic equipment
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN111382057A (en) Test case generation method, test method and device, server and storage medium
US11687441B2 (en) Intelligent dynamic web service testing apparatus in a continuous integration and delivery environment
CN112560462B (en) Event extraction service generation method, device, server and medium
CN108459890A (en) Interface display method and device for application
CN113961405B (en) State switching instruction verification method and device, electronic 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190726

RJ01 Rejection of invention patent application after publication