CN109766228A - Verification method and device on a kind of line based on interface - Google Patents

Verification method and device on a kind of line based on interface Download PDF

Info

Publication number
CN109766228A
CN109766228A CN201711108400.4A CN201711108400A CN109766228A CN 109766228 A CN109766228 A CN 109766228A CN 201711108400 A CN201711108400 A CN 201711108400A CN 109766228 A CN109766228 A CN 109766228A
Authority
CN
China
Prior art keywords
interface
verifying
external file
survey tool
read
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
CN201711108400.4A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711108400.4A priority Critical patent/CN109766228A/en
Publication of CN109766228A publication Critical patent/CN109766228A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses verification method and devices on a kind of line based on interface, are related to field of computer technology.One specific embodiment of this method includes: to enter the IP address of Servers-all belonging to each interface, interface in ginseng and interface function test case write-in external file;Operation pressure survey tool, will enter ginseng from the interface of each method of each interface and interface function test case is read into different verifying scripts in external file;Wherein, it is arranged in the pressure survey tool for controlling the outer loop and the interior loop for controlling the verifying script execution number that each IP address is read;It reads an IP address in external file every time by outer loop, all verifying scripts of IP address corresponding interface is executed according to verifying script execution number.The embodiment is based on pressure survey tool and inside and outside two layers of loop control, goes to execute identical verifying script by platform server, completes the interface function verifying to Servers-all.

Description

Verification method and device on a kind of line based on interface
Technical field
The present invention relates to verification method and devices in computer field more particularly to a kind of line based on interface.
Background technique
Instantly Large-Scale Interconnected net application is all clustered deploy(ment), and cluster is mostly built by Docker.It is sent out in application program After cloth, need to verify whether the application deployment on each Docker correct, whether normal and performance is with the presence or absence of asking for function Topic.In the prior art by the end Web calling interface come to Web test object carry out automatic test, to realize interface function Verifying and performance verification.In calling interface, call request is got at random on any one Docker by Distribution Center and is carried out Processing.Here Docker is a kind of virtual server.
In realizing process of the present invention, at least there are the following problems in the prior art: application issued for inventor's discovery Afterwards, can not verify whether application deployment on each Docker is correct, whether normal and performance is with the presence or absence of problem for function; The script at the end Web is difficult in maintenance and fluctuation of service;More then several hundred of Docker in cluster, it is few then tens, Docker sheet The spread in performance of body is uneven, can not check out the Docker of performance difference.
Summary of the invention
In view of this, the embodiment of the present invention provides verification method and device on a kind of line based on interface, work is surveyed based on pressure Tool and inside and outside two layers of loop control, go to execute identical verifying script by platform server, complete the interface to Servers-all Functional verification.
To achieve the above object, according to an aspect of an embodiment of the present invention, it provides and is tested on a kind of line based on interface Card method.
Verification method on a kind of line based on interface of the embodiment of the present invention, comprising: by all services belonging to each interface The IP address of device, interface enter in ginseng and interface function test case write-in external file;Operation pressure survey tool, by the external text Interface corresponding from each method of each interface enters ginseng in part and interface function test case is read into different verifying scripts; Wherein, it is arranged in the pressure survey tool for controlling the outer loop and control the verifying script that each IP address is read Execute the interior loop of number;An IP address in the external file is read every time by the outer loop, according to institute State all verifying scripts that verifying script execution number executes the IP address corresponding interface.
Optionally, the interface of a method by interface each in the external file enters ginseng and interface function test is used Example be read into a verifying script, comprising: by it is described press survey tool parameterized treatment by the external file with it is described Pressure survey tool is associated;Read the external file by the pressure survey tool, by the external file with each interface The corresponding interface of each method enter ginseng and interface function test case is read into different verifying scripts.
Optionally, all verifying feet that the IP address corresponding interface is executed according to the verifying script execution number After this step of, further includes: the verification result for obtaining each interface is surveyed according to the interface function of interface each in the verification result Example implementing result on probation, obtains the functional verification result of each interface;The response time for summarizing each interface, by the response time with The response time of former each interface of application program is compared, and obtains the performance verification result of each interface;Conclude institute on each server There is the performance verification of interface as a result, to obtain the performance difference between each server according to conclusion interpretation of result.
Optionally, the cycle-index of the outer loop is equal to the number of the server, and the script execution number is big In equal to the interface function test case number.
Optionally, the pressure survey tool is Jmeter, and the external file is text file, and the server is Docker Virtual server.
Optionally, the cycle-index of the outer loop is arranged by the sets of threads of the Jmeter, the interior loop Number is arranged by the cycle controller of the Jmeter.
To achieve the above object, according to another aspect of an embodiment of the present invention, it provides and is tested on a kind of line based on interface Card device.
Device is verified on a kind of line based on interface of the embodiment of the present invention, comprising: writing module is used for each interface institute The IP address of the Servers-all of category, interface enter in ginseng and interface function test case write-in external file;Module is read in, is used for Interface corresponding with each method of each interface in the external file is entered ginseng and interface function test is used by operation pressure survey tool Example is read into different verifying scripts;Wherein, it is arranged in the pressure survey tool for controlling each IP address reading Outer loop and the interior loop for controlling the verifying script execution number;Execution module, for every by the outer loop The secondary IP address read in the external file executes the IP address correspondence according to the verifying script execution number and connects All verifying scripts of mouth.
Optionally, the reading module, is also used to: by the parameterized treatment of the pressure survey tool by the external file It is associated with the pressure survey tool;And the external file is read by the pressure survey tool, by the external file In interface corresponding from each method of each interface enter ginseng and interface function test case is read into different verifying scripts.
Optionally, described device further include: result obtains module, for obtaining the verification result of each interface, according to described The interface function test case implementing result of each interface, obtains the functional verification result of each interface in verification result;Summarize and respectively connects The response time is compared with the response time of each interface of former application program, obtains each interface by the response time of mouth Performance verification result;And the performance verification of total interface on each server is concluded as a result, to obtain according to conclusion interpretation of result Performance difference between each server.
Optionally, the cycle-index of the outer loop is equal to the number of the server, and the script execution number is big In equal to the interface function test case number.
Optionally, the pressure survey tool is Jmeter, and the external file is text file, and the server is Docker Virtual server.
Optionally, the cycle-index of the outer loop is arranged by the sets of threads of the Jmeter, the interior loop Number is arranged by the cycle controller of the Jmeter.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention, comprising: one or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more A processor realizes verification method on a kind of line based on interface of the embodiment of the present invention.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed Verification method on a kind of line based on interface of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that based on pressing survey tool and following for inside and outside two layers Ring control, goes to execute identical verifying script by platform server, completes the interface function verifying to Servers-all;Passing through will External file carries out parametrization with pressure survey tool and is associated with, and the interface being arranged in external file is entered ginseng and interface function test case Read in verifying script;The functional verification result for summarizing to obtain each interface, performance verification result and each are concluded from verification result Performance difference between server;By the cycle-index of setting verifying script, reduce the randomness of verification result, guarantees every Interface function test case can be performed;Survey tool is pressed to use Jmeter (a kind of performance testing tool of open source), easily Functional verification, performance verification and server performance investigation itself after solving the problems, such as application issued.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of verification method on the line according to an embodiment of the present invention based on interface;
Fig. 2 is the relation schematic diagram between verifying script according to an embodiment of the present invention and the method for interface;
Fig. 3 is the main flow schematic diagram of verification method on the line according to an embodiment of the present invention based on interface;
Fig. 4 is the schematic diagram that the main modular of device is verified on the line according to an embodiment of the present invention based on interface;
Fig. 5 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 6 is the structural schematic diagram for being suitable for the computer installation of the electronic equipment to realize the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is the schematic diagram of the key step of verification method on the line according to an embodiment of the present invention based on interface.Such as Fig. 1 Shown, verification method on the line based on interface of the embodiment of the present invention mainly includes the following steps:
Step S101: the IP address of Servers-all belonging to each interface, interface are entered into ginseng and interface function test case It is written in external file.The IP address of Servers-all belonging to each interface is individually extracted and is made into and can be read from outside The parameter taken, to press survey tool to read IP address from external file and then to complete loop iteration.It includes configuration that interface, which enters ginseng, Default parameters needed for pressing survey tool, initiation parameter (such as creation example, specified URL (Uniform Resource Locator, uniform resource locator)), verifying script execute sequence, interface method of calling etc..
Step S102: operation pressure survey tool enters interface corresponding with each method of each interface in the external file Ginseng and interface function test case are read into different verifying scripts;Wherein, it is arranged in the pressure survey tool for controlling The outer loop and control the interior loop for verifying script execution number that each IP address is read.In pressure survey tool setting Two layers of circulation, outer loop are used to read the IP address of each server, verify each server by outer loop;Internal layer follows Whether the interface function that ring is used to verify on every server is normal.It can recorde verification result in embodiment, facilitate subsequent point Interface capability is analysed with the presence or absence of the performance difference between problem and each server.Here pressure survey tool can be Jmeter, Loadrunner etc..Wherein, Jmeter is the pressure test tool of the open source based on Java, for doing pressure test to software; Loadrunner is the load testing tool of a kind of forecasting system behavior and performance, being capable of forecasting system behavior and assessment system Energy.
It is associated with by the way that external file is carried out parametrization with pressure survey tool, and then is reading external file using pressure survey tool When, the interface being arranged in external file can be entered to ginseng and interface function test case reads in verifying script.One interface may Including multiple methods, a method of script corresponding interface is verified for one in the embodiment of the present invention, by interface needed for this method Enter ginseng and interface function test case is read in verifying script.In the specific implementation, each verifying script, which can be set, executes sequence To verify all methods.
Step S103: an IP address in the external file is read by the outer loop every time, according to described Verifying script execution number executes all verifying scripts of the IP address corresponding interface.Outer loop reads a service every time Device IP address, interior loop execute the corresponding interface function test of each method of each interface in the server by recycling Use-case, and then realize the functional verification to each interface of each server.
Fig. 2 is the relation schematic diagram between verifying script according to an embodiment of the present invention and the method for interface.Such as Fig. 2 institute Show, an interface might have multiple methods, and each method needs a plurality of interface function test case that could sufficiently verify The correctness of the interface function.Therefore, verifying script is refine to method rank, a verifying script pair in the embodiment of the present invention Answer a method of interface.In embodiment, interface 1 includes three methods (method 1 to method 3), verifying script corresponding interface 1 Method 2 includes three interface function test case (interface function test cases 1 to interface function test case in this method 2 3)。
The basic principle of verification method on the line based on interface of the embodiment of the present invention are as follows: firstly, by belonging to each interface The IP address of Servers-all, interface enter ginseng and interface function test case write-in external file, and external file and pressure are surveyed work Tool is associated;Secondly, the interface of one of method of interface each in external file is entered ginseng and interface by pressure survey tool Functional test use-case is read into a verifying script, the corresponding verifying script of a method;Again, pass through pressure survey tool IP address is read in outer loop control, executes all verifying scripts of current IP address corresponding interface, and pressure survey tool is every to complete one Secondary circulation just re-reads a new IP address, until Servers-all is verified and finishes;Later, verification result is concluded, To obtain the functional verification result of each interface, the performance difference of performance verification result and each Docker;Finally, according to each interface The performance difference of functional verification result, performance verification result and each Docker generates verifying report.
Fig. 3 is the main flow schematic diagram of verification method on the line according to an embodiment of the present invention based on interface.The present invention It is Jmeter that survey tool is pressed in embodiment, and server is Docker virtual server.Wherein, Docker is the application of an open source Container engine allows developer that can be packaged their application and relies on packet into a transplantable container, is then published to On the Linux machine of any prevalence, it also may be implemented to virtualize.As shown in figure 3, on the line based on interface of the embodiment of the present invention Verification method, comprising the following steps:
Step S301: the IP address of all Docker, interface belonging to each interface are entered into ginseng and interface function test case It is written in text file.The format of external file will match with pressure survey tool, and Jmeter only supports File format, therefore Corresponding external file is text file.Interface enter ginseng include configuration Jmeter needed for default parameters, various initiation parameters, Verifying script executes sequence, interface method of calling (such as direct-connected) etc..
Step S302: it is arranged in Jmeter for controlling the outer loop and control verifying foot that each IP address is read The interior loop of this execution number.The cycle-index of outer loop is equal to the number of Docker, is set by the sets of threads of Jmeter It sets;Script execution number, that is, memory circulation cycle-index is verified, 10 times of interface function test case number are more than or equal to, It is arranged by the cycle controller of Jmeter.If verifying script execution number is less than interface function test case number 10 Times, then the value of TP90 will be equal to maximum value in verification result.Wherein, TP90 refers to that 90% user can be at this Interior completion operation.Than if any 100 time data, these time data are arranged from small to large, the 90th time data are just It is TP90.When to interface operation, the value of first time is that (not being that query caching obtains) is obtained by directly inquiring database, The time can be long, that is, maximum value, but generally only will appear primary.If TP90 is equal to maximum value, it is unfavorable for assessing System performance.Assuming that the method for interface has 3 interface function test cases, then the cycle-index of memory circulation may be configured as 30 It is secondary, to ignore the randomness of verification result, and guarantee that every interface function test case can be performed.
The corresponding interface of each method of the external file each interface in is entered to join by step S303: operation Jmeter It is read into interface function test case in different verifying scripts.Interface is called and Jmeter is combined, passes through Jmeter Complete the Automation Design of verifying script.The verifying script is significantly larger than the script at the end Web in maintainable and stability.It tests Card script refine to method rank, a method of a verifying script corresponding interface.
Step S304: an IP address in the external file is read by the outer loop every time, according to described Verifying script execution number executes all verifying scripts of the IP address corresponding interface.The every completion one cycle of Jmeter, just A new IP address is re-read, the verifying script that identical interface executes in all Dcker is identical, until all Docker is verified and finishes.By executing the interface function test case in verifying script determines whether the application program is correct Work.
Step S305: obtaining the verification result of each interface, concludes the verification result to obtain the functional verification of each interface As a result, the performance difference of performance verification result and each Docker.Specific generalization procedure are as follows: with interface and interface function test case Judge that the function of each interface is according to the interface function test case implementing result of interface each in the verification result for dimension No normal, which is that the functional verification result of each interface (if there is the interface function test case of failure, lists mistake Detail is lost, the IP address including Docker, the description of interface function test case, interface enters ginseng and the frequency of failure);It is with interface Dimension summarizes the response time of each interface out according to the verification result, and the response time and former application program are respectively connect The response time of mouth is compared, and obtains the performance verification of each interface as a result, to verify the performance for the application program newly issued;With Docker and interface are dimension, summarize the performance verification of total interface on each Docker as a result, can divide according to result is concluded The performance difference between each Docker is precipitated, to verify the behavior pattern of Docker itself.Wherein, former application program is new Application issued before application program.
Step S306: it is tested according to the generation of the performance difference of the functional verification result, performance verification result and each Docker Card report.
Advertisement broadcast method through the embodiment of the present invention can be seen that based on pressure survey tool and the control of inside and outside two layers of circulation System, goes to execute identical verifying script by platform server, completes the interface function verifying to Servers-all;By will be external File carries out parametrization with pressure survey tool and is associated with, and the interface being arranged in external file is entered ginseng and interface function test case is read in Verify script;The functional verification result for summarizing to obtain each interface, performance verification result and each service are concluded from verification result Performance difference between device;By the cycle-index of setting verifying script, reduce the randomness of verification result, guarantees every interface Functional test use-case can be performed;Survey tool is pressed to use Jmeter, the function after easily solving application issued is tested Card, performance verification and server performance itself check problem.
Fig. 4 is the schematic diagram that the main modular of device is verified on the line according to an embodiment of the present invention based on interface.Such as Fig. 4 It is shown, device 400 is verified on the line based on interface of the embodiment of the present invention, is specifically included that
Writing module 401, for the IP address of Servers-all belonging to each interface, interface to be entered ginseng and interface function survey In example write-in external file on probation.The IP address of Servers-all belonging to each interface individually extracts to be made into can be from The parameter that outside is read, to press survey tool to read IP address from external file and then to complete loop iteration.Interface enters ginseng packet Default parameters needed for including configuration pressure survey tool, initiation parameter (such as creation example, specified URL etc.).
Reading in module 402 will be opposite with each method of each interface in the external file for running the pressure survey tool The interface answered enters ginseng and interface function test case is read into different verifying scripts;Wherein, it is set in the pressure survey tool It sets for controlling the outer loop and the interior loop for controlling the verifying script execution number that each IP address is read.It is pressing Two layers of circulation is arranged in survey tool, and outer loop is used to read the IP address of each server, verifies each clothes by outer loop Business device;Whether the interface function that interior loop is used to verify on every server is normal.It can recorde verification result in embodiment, Facilitate subsequent analysis interface capability with the presence or absence of the performance difference between problem and each server.Here pressure surveys tool can be with It is Jmeter, Loadruner etc..
It is associated with by the way that external file is carried out parametrization with pressure survey tool, and then is reading external file using pressure survey tool When, the interface being arranged in external file can be entered to ginseng and interface function test case reads in verifying script.One interface may Multiple methods are had, and each method needs a plurality of interface function test case that could sufficiently verify the correct of the interface function Property.Therefore, in the embodiment of the present invention one verifying script corresponding interface a method, can be set it is each verifying script execution Sequence verifies all methods.
Execution module 403, for reading an IP address in the external file, root every time by the outer loop All verifying scripts of the IP address corresponding interface are executed according to the verifying script execution number.Outer loop reads one every time A server ip address, interior loop execute the corresponding interface function of each method of each interface in the server by recycling Energy test case, and then realize the functional verification to each interface of each server.
It can also include: that result obtains module that device 400 is verified on the line based on interface of the embodiment of the present invention, for obtaining The verification result for taking each interface obtains each according to the interface function test case implementing result of interface each in the verification result The functional verification result of interface;The response time for summarizing each interface, by the sound of the response time and each interface of former application program It is compared between seasonable, obtains the performance verification result of each interface;And conclude the performance verification of total interface on each server As a result, to obtain the performance difference between each server according to conclusion interpretation of result.
From the above, it can be seen that going to execute phase by platform server based on pressure survey tool and inside and outside two layers of loop control Same verifying script completes the interface function verifying to Servers-all;By the way that external file and pressure survey tool are joined The interface being arranged in external file is entered ginseng and interface function test case reads in verifying script by numberization association;From verification result Middle conclusion summarizes to obtain the performance difference between the functional verification result, performance verification result and each server of each interface;It is logical The cycle-index for crossing setting verifying script, reduces the randomness of verification result, guarantees that every interface function test case can be by It executes;Survey tool is pressed to use Jmeter, functional verification, performance verification and server after easily solving application issued Performance itself checks problem.
Fig. 5 is shown can be using on verification method on the line based on interface of the embodiment of the present invention or the line based on interface Verify the exemplary system architecture 500 of device.
As shown in figure 5, system architecture 500 may include terminal device 501,502,503, network 504 and server 505. Network 504 between terminal device 501,502,503 and server 505 to provide the medium of communication link.Network 504 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 501,502,503 and be interacted by network 504 with server 505, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 501,502,503 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 501,502,503 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 505 can be to provide the server of various services, such as utilize terminal device 501,502,503 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It should be noted that verification method is generally by server on the line based on interface provided by the embodiment of the present application 505 execute, and correspondingly, on the line based on interface verify device and are generally positioned in server 505.
It should be understood that the number of terminal device, network and server in Fig. 5 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, the present invention also provides a kind of electronic equipment and a kind of computer-readable medium.
Electronic equipment of the invention includes: one or more processors;Storage device, for storing one or more journeys Sequence, when one or more of programs are executed by one or more of processors, so that one or more of processors are real Verification method on a kind of line based on interface of the existing embodiment of the present invention.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor Verification method on a kind of line based on interface of the existing embodiment of the present invention.
Below with reference to Fig. 6, it illustrates the computer systems 600 being suitable for realize the electronic equipment of the embodiment of the present invention Structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and Execute various movements appropriate and processing.In RAM 603, also it is stored with computer system 600 and operates required various programs And data.CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 It is connected to bus 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable Computer program on medium, the computer program include the program code for executing method shown in key step figure.? In such embodiment, which can be downloaded and installed from network by communications portion 609, and/or from can Medium 611 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 601, system of the invention is executed The above-mentioned function of middle restriction.
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 module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet It includes writing module, read in module and execution module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, writing module is also described as " by the IP address of Servers-all belonging to each interface, interface Enter the module in ginseng and interface function test case write-in external file ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: that the IP address of Servers-all belonging to each interface, interface are entered ginseng and the write-in of interface function test case In external file;The pressure survey tool is run, the interface of a method of interface each in the external file is entered into ginseng and interface Functional test use-case is read into verifying script;Wherein, setting is read for controlling each IP address in the pressure survey tool The interior loop of outer loop and control the verifying script execution number taken;Described in being read every time by the outer loop An IP address in external file executes described all of IP address corresponding interface according to the verifying script execution number and tests Demonstrate,prove script.
According to the technique and scheme of the present invention, it based on pressure survey tool and inside and outside two layers of loop control, goes to execute by platform server Identical verifying script completes the interface function verifying to Servers-all;By the way that external file and pressure survey tool are carried out The interface being arranged in external file is entered ginseng and interface function test case reads in verifying script by parametrization association;It is tied from verifying It is concluded in fruit and summarizes to obtain the performance difference between the functional verification result, performance verification result and each server of each interface; By the cycle-index of setting verifying script, reduce the randomness of verification result, guarantees that every interface function test case can It is performed;Survey tool is pressed to use Jmeter, functional verification, performance verification and service after easily solving application issued Device performance itself checks problem.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (14)

1. verification method on a kind of line based on interface characterized by comprising
The IP address of Servers-all belonging to each interface, interface are entered into ginseng and interface function test case write-in external file In;
Operation pressure survey tool, enters ginseng for interface corresponding with each method of each interface in the external file and interface function is surveyed Example on probation is read into different verifying scripts;Wherein, setting is read for controlling each IP address in the pressure survey tool The interior loop of outer loop and control the verifying script execution number taken;
An IP address in the external file is read every time by the outer loop, according to the verifying script execution time Number executes all verifying scripts of the IP address corresponding interface.
2. the method according to claim 1, wherein each method by the external file with each interface Corresponding interface enters ginseng and interface function test case is read into different verifying scripts, comprising:
The external file and the pressure survey tool are associated by the parameterized treatment of the pressure survey tool;
The external file is read by the pressure survey tool, it will be corresponding with each method of each interface in the external file Interface enter ginseng and interface function test case is read into different verifying scripts.
3. the method according to claim 1, wherein described according to verifying script execution number execution After the step of all verifying scripts of IP address corresponding interface, further includes:
The verification result for obtaining each interface, according to the interface function test case implementing result of interface each in the verification result, Obtain the functional verification result of each interface;
The response time for summarizing each interface, the response time was compared with the response time of each interface of former application program, Obtain the performance verification result of each interface;
The performance verification of total interface on each server is concluded as a result, to obtain between each server according to conclusion interpretation of result Performance difference.
4. the method according to claim 1, wherein the cycle-index of the outer loop is equal to the server Number, the script execution number be more than or equal to the interface function test case number.
5. method according to any one of claims 1 to 4, which is characterized in that the pressure survey tool is Jmeter, described outer Portion's file is text file, and the server is Docker virtual server.
6. according to the method described in claim 5, it is characterized in that, the cycle-index of the outer loop passes through the Jmeter Sets of threads setting, the interior loop number is arranged by the cycle controller of the Jmeter.
7. verifying device on a kind of line based on interface characterized by comprising
Writing module, for the IP address of Servers-all belonging to each interface, interface to be entered ginseng and interface function test case It is written in external file;
Module is read in, for running pressure survey tool, interface corresponding with each method of each interface in the external file is entered Ginseng and interface function test case are read into different verifying scripts;Wherein, it is arranged in the pressure survey tool for controlling The outer loop and control the interior loop for verifying script execution number that each IP address is read;
Execution module, for reading an IP address in the external file every time by the outer loop, according to described Verifying script execution number executes all verifying scripts of the IP address corresponding interface.
8. device according to claim 7, which is characterized in that the reading module is also used to:
The external file and the pressure survey tool are associated by the parameterized treatment of the pressure survey tool;And
The external file is read by the pressure survey tool, it will be corresponding with each method of each interface in the external file Interface enter ginseng and interface function test case is read into different verifying scripts.
9. device according to claim 7, which is characterized in that described device further include: result obtains module, for obtaining The verification result of each interface is respectively connect according to the interface function test case implementing result of interface each in the verification result The functional verification result of mouth;
The response time for summarizing each interface, the response time was compared with the response time of each interface of former application program, Obtain the performance verification result of each interface;And
The performance verification of total interface on each server is concluded as a result, to obtain between each server according to conclusion interpretation of result Performance difference.
10. device according to claim 7, which is characterized in that the cycle-index of the outer loop is equal to the service The number of device, the script execution number are more than or equal to the interface function test case number.
11. according to the described in any item devices of claim 7 to 10, which is characterized in that the pressure survey tool is Jmeter, described External file is text file, and the server is Docker virtual server.
12. device according to claim 11, which is characterized in that the cycle-index of the outer loop passes through described The sets of threads of Jmeter is arranged, and the interior loop number is arranged by the cycle controller of the Jmeter.
13. 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 executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 6 is realized when row.
CN201711108400.4A 2017-11-09 2017-11-09 Verification method and device on a kind of line based on interface Pending CN109766228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711108400.4A CN109766228A (en) 2017-11-09 2017-11-09 Verification method and device on a kind of line based on interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711108400.4A CN109766228A (en) 2017-11-09 2017-11-09 Verification method and device on a kind of line based on interface

Publications (1)

Publication Number Publication Date
CN109766228A true CN109766228A (en) 2019-05-17

Family

ID=66450084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711108400.4A Pending CN109766228A (en) 2017-11-09 2017-11-09 Verification method and device on a kind of line based on interface

Country Status (1)

Country Link
CN (1) CN109766228A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290799A (en) * 2020-02-06 2020-06-16 北京字节跳动网络技术有限公司 Component loading method and device, electronic equipment and storage medium
CN115550216A (en) * 2022-09-26 2022-12-30 中国农业银行股份有限公司 Acquisition control module test method, apparatus, storage medium, and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011117528A1 (en) * 2010-03-26 2011-09-29 Bull Sas Method, computer program, and device for validating task execution in scaleable computer systems
CN105786705A (en) * 2016-02-26 2016-07-20 上海斐讯数据通信技术有限公司 Execution method and device of nested loop test scripts
CN106383786A (en) * 2016-09-27 2017-02-08 北京金山安全软件有限公司 Interface pressure performance testing method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011117528A1 (en) * 2010-03-26 2011-09-29 Bull Sas Method, computer program, and device for validating task execution in scaleable computer systems
CN105786705A (en) * 2016-02-26 2016-07-20 上海斐讯数据通信技术有限公司 Execution method and device of nested loop test scripts
CN106383786A (en) * 2016-09-27 2017-02-08 北京金山安全软件有限公司 Interface pressure performance testing method and device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290799A (en) * 2020-02-06 2020-06-16 北京字节跳动网络技术有限公司 Component loading method and device, electronic equipment and storage medium
CN111290799B (en) * 2020-02-06 2023-09-19 北京字节跳动网络技术有限公司 Component loading method and device, electronic equipment and storage medium
CN115550216A (en) * 2022-09-26 2022-12-30 中国农业银行股份有限公司 Acquisition control module test method, apparatus, storage medium, and program product

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN108459953A (en) test method and device
CN108958992A (en) test method and device
CN108614774A (en) Automated testing method and device
CN108932194A (en) Automated testing method, device, system, medium and electronic equipment
CN109739478A (en) Front end project automated construction method, device, storage medium and electronic equipment
CN109558134A (en) The method and apparatus of business datum verification
CN110109979A (en) A kind of allocation list radio button method and apparatus
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN109684188A (en) Test method and device
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN108958744A (en) Dispositions method, device, medium and the electronic equipment of big data distributed type assemblies
CN110278201A (en) Security strategy evaluation method and device, computer-readable medium and electronic equipment
CN109901987A (en) A kind of method and apparatus generating test data
CN109241722A (en) For obtaining method, electronic equipment and the computer-readable medium of information
CN108959087A (en) test method and device
CN111444077A (en) Method and device for generating flow node test data
CN109002385A (en) Method for testing pressure and device for data flow system
CN110019158A (en) A kind of method and apparatus of monitoring data quality
CN109656799A (en) Test method and device
CN110321252A (en) A kind of method and apparatus of craft services scheduling of resource
CN109582317A (en) Method and apparatus for debugging boarding application
CN109814957A (en) A kind of label addition method and device for IOS system
CN109960639A (en) A kind of method and apparatus generating test case
CN109002389A (en) The method and apparatus of page automatic test

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: 20190517

RJ01 Rejection of invention patent application after publication