Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of automatic test, it can be according to tested interfaceThe agreement belonged to obtains the interface resolution logic for being suitable for total interface under the agreement, is connect using interface resolution logic realizationMouth automatically parses, so that when testing newly-increased interface or upgrade interface, it is not necessary to carry out interface by testerThe conversion for defining source data, need not also carry out the hard coded of interface calling logic, so that the maintenance workload of testing tool is reduced,Improve testing efficiency.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method of automatic test.
The method of the automatic test of the embodiment of the present invention includes: to belong to target protocol using the determination of interface resolution logicInterface to be measured data template;Wherein, the interface resolution logic is individually determined according to the target protocol;In the dataTest input data is added in template, the survey for meeting the target protocol is generated based on the data template for including test input dataExamination request, the server-side where the test request to the interface to be measured is sent;Receive the sound for being directed to the test requestIt should be to realize the test of the interface to be measured.
Optionally, the data template is JSON format or XML format, enters to join structure and out ginseng including interface to be measuredStructure.
Optionally, described that the data template packet for belonging to the interface to be measured of target protocol is determined using interface resolution logicIt includes: receiving the definition source data of the interface to be measured, the definition source data is converted into the number using interface resolution logicAccording to template.
Optionally, the test for meeting the target protocol based on the data template generation for including test input data is askedAsking includes: the available number that the realization language for the target protocol will be converted to including the data template of test input dataAccording to;The data available is encoded using agreement calling logic, generates the test request;Wherein, the agreement calling logicIt is individually determined according to the target protocol.
Optionally, the response received for the test request with the test for realizing the interface to be measured includes: to connectReceive the response;The response is decoded using agreement calling logic, obtains test output data;By the test output dataCompared with expected data, test result is obtained.
Optionally, the interface resolution logic and the agreement calling logic are stored in plug-in unit.
Optionally, the plug-in unit are as follows: C dynamic base, C++ dynamic base, Java Jar packet, Java Class file, PHP source documentPart, Shell script or Python script.
Optionally, the target protocol is nonstandard protocol.
To achieve the above object, according to another aspect of the invention, a kind of device of automatic test is provided.
The device of the automatic test of the embodiment of the present invention can include: preparatory unit can be used for utilizing interface resolution logicDetermine the data template for belonging to the interface to be measured of target protocol;Wherein, the interface resolution logic is according to the target protocolIt is individually determined;Execution unit can be used for that test input data is added in the data template, based on including test input dataData template generate and meet the test request of the target protocol, by the clothes where the test request to the interface to be measuredBusiness end is sent;Test cell can be used for receiving the response for the test request to realize the test of the interface to be measured.
Optionally, the data template is JSON format or XML format, enters to join structure and out ginseng including interface to be measuredStructure.
Optionally, preparatory unit can be further used for: receiving the definition source data of the interface to be measured, parsed using interfaceThe definition source data is converted to the data template by logic.
Optionally, execution unit can be further used for: the data template including test input data is converted to for instituteState the data available of the realization language of target protocol;The data available is encoded using agreement calling logic, generates the surveyExamination request;Wherein, the agreement calling logic is individually determined according to the target protocol.
Optionally, test cell can be further used for: receive the response;The response is solved using agreement calling logicCode obtains test output data;By the test output data compared with expected data, test result is obtained.
Optionally, the interface resolution logic and the agreement calling logic are stored in plug-in unit.
Optionally, the plug-in unit are as follows: C dynamic base, C++ dynamic base, Java Jar packet, Java Class file, PHP source documentPart, Shell script or Python script.
Optionally, the target protocol is nonstandard protocol.
To achieve the above object, according to another aspect of the invention, a kind of electronic equipment is provided.
A kind of electronic equipment of the invention includes: one or more processors;Storage device, for storing one or moreProgram, when one or more of programs are executed by one or more of processors, so that one or more of processorsThe method for realizing automatic test provided by the present invention.
To achieve the above object, in accordance with a further aspect of the present invention, a kind of computer readable storage medium is provided.
A kind of computer readable storage medium of the invention, is stored thereon with computer program, described program is by processorThe method of automatic test provided by the present invention is realized when execution.
According to the technique and scheme of the present invention, one embodiment in foregoing invention has the following advantages that or the utility model has the advantages that leads toIt crosses the agreement that tested interface is belonged to and obtains the interface resolution logic for being suitable for total interface under the agreement, parsed using the interfaceLogic realizes that interface defines source data automatically parsing to data template, and then realizes the automatic of interface to be measured based on data templateChange test, so that when testing newly-increased interface or upgrade interface, it is not necessary to interface be carried out by tester and define source dataConversion, need not also carry out the hard coded of interface calling logic, only need to upload interface and define source data, to realize dockingThe support that mouth dynamic updates, improves testing efficiency, while making tester that need not understand agreement calling logic, can be absorbed inIn the production of test case;Memory interface resolution logic and agreement calling logic by way of plug-in unit, to newly-increased agreement orWhen the interface of updating protocol is tested, inserting for memory interface resolution logic and agreement calling logic need to be only provided to testing toolPart, subsequent when needing newly-increased or upgrade interface, testing tool and plug-in unit are without change, it is thus achieved that the hot plug-in unit of agreementCharacteristic improves the scalability of testing tool, reduces the maintenance workload of testing tool.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodimentWith explanation.
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 inventionDetails should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognizeIt 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.TogetherSample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The technical solution of the embodiment of the present invention is suitable for owning under the agreement by being tested the agreement that interface is belonged to and obtainingThe interface resolution logic of interface realizes that interface defines source data automatically parsing to data template using the interface resolution logic,And then the automatic test of interface to be measured is realized based on data template, so that being tested to newly-increased interface or upgrade interfaceWhen, it is not necessary to the conversion that interface defines source data is carried out by tester, need not also carry out the hard coded of interface calling logic, is only neededIt uploads interface and defines source data, to realize the support updated to interface dynamic, improve testing efficiency, while making testerMember is not required to understand agreement calling logic, can be absorbed in the production of test case;The memory interface solution by way of plug-in unitLogical AND agreement calling logic is analysed, when the interface to newly-increased agreement or updating protocol is tested, need to only be mentioned to testing toolIt is subsequent when needing newly-increased or upgrade interface for the plug-in unit of memory interface resolution logic and agreement calling logic, testing toolWith plug-in unit without change, it is thus achieved that the hot plug-in unit characteristic of agreement, improves the scalability of testing tool, reduces testThe maintenance workload of tool.
It should be pointed out that in the absence of conflict, the technical characteristic in the embodiment of the present invention and embodiment canTo be combined with each other.
Fig. 1 is the key step schematic diagram of the method for automatic test according to an embodiment of the present invention.
As shown in Figure 1, the method for the automatic test of the embodiment of the present invention can be executed according to following steps:
Step S101: testing tool determines the data mould for belonging to the interface to be measured of target protocol using interface resolution logicPlate.
In this step, interface to be measured refers to application programming interfaces API (Application to be measuredProgramming Interface), which is located at server-side, belongs to target protocol.Wherein, server-side refers toService routine or software systems where interface to be measured.It should be pointed out that in embodiments of the present invention, server-side is not limited toIn providing the service routine or software systems of service for client, as long as in fact, containing API, can externally provide serviceComputer program all can serve as the server-side in the present invention.
Realize that the larger problem of difficulty, the present invention are implemented for the automatic test in the prior art based on nonstandard protocolThe method of the automatic test of example can solve, i.e. the target protocol of the embodiment of the present invention can be nonstandard protocol.ItsIn, nonstandard protocol refers to that enterprise or individual voluntarily formulate, and is applied to small range of communication protocol.It is understood thatThe present invention also can be realized based on hypertext transfer protocol HTTP (HyperText Transfer Protocol), transmission controlAgreement/Internet Protocol TCP/IP (Transmission Control Protocol/Internet Protocol) etc.The automatic test of standard agreement.
In embodiments of the present invention, interface resolution logic refers to parsing for the definition source data to interface to be measuredCode, data template refer to comprising interface to be measured enter to join structure with go out ginseng structure, can be loaded into test input data it is specificData.Wherein, enter to join structure and refer to the specific setting rule of connection inlet parameter, such as which field is set, each fieldSpecific requirement, join structure out and refer to that the specific setting of interface egress parameter is regular.
In practical application, interface resolution logic is individually determined by target protocol, and described be individually determined refers to: by meshMark agreement uniquely determines, unrelated with any interface under target protocol.That is, after determining target protocol, according to meshThe coding criterion of mark agreement is the interface resolution logic that can determine suitable for total interface under target protocol.
In embodiments of the present invention, when testing tool for the first time tests interface to be measured, it is necessary first to receive testThe definition source data for the interface to be measured that personnel upload.Wherein, it defines source data and refers to that interface defines source code.Later, it utilizesInterface analysis protocol parses the definition source data of interface to be measured, obtains JSON format or expandable mark language XMLThe data template of (eXtensible Markup Language) format, below will be mainly by taking the data template of JSON format as an exampleIt is illustrated.
The following are the examples of the data template of JS object tag JSON (JavaScript Object Notation) format.It should be noted that following example is only used for illustrating, not data used in practical application.
It include mark (id), interface name (name), homing protocols in the data template of the upper JSON format for illustrating meaning(protocol), enter to join structure (reqParam) and go out ginseng structure (rspExpected), enter to join structure and go out in ginseng structure" type ", " name ", " value ", " needCheck ", " isExpected " are the specific field of parameter.It is understood thatIt is to enter to join value field in structure for sky, thus, it is possible to will test input data addition data template.
Step S102: test input data is added in testing tool in data template, based on including test input dataData template generates the test request for meeting target protocol, and the server-side where the test request to the interface to be measured is sent outIt send.
As a preferred embodiment, testing tool adds the test input data in the test case made for interface to be measuredThe data template for entering JSON format obtains meeting interface requirement and the JSON data including testing input data, by what is obtainedJSON data are converted to the data available of the realization language for target protocol, to realize the JSON data based on target protocolCoding.
Wherein, the realization language of target protocol refers to realizing programming used in target protocol in testing toolLanguage.In practical application, the definition source data of interface to be measured, the agreement calling logic of target protocol are all made of the reality of target protocolExisting language is write.
Specifically, agreement calling logic refers to increasing test input to data template according to target protocol in testing toolThe data that data obtain are encoded and then are sent test request, and according to target protocol to server-side where interface to be measuredThe response of return is decoded and then obtains the execution code of test output data.In embodiments of the present invention, agreement calling is patrolledIt collects and is individually determined by target protocol.That is, agreement calling logic is uniquely determined by target protocol, connect with any under the target protocolMouth is unrelated.That is, can determine suitable for the target after determining target protocol according to the coding criterion of target protocolThe agreement calling logic of total interface under agreement.It is understood that agreement calling logic also may include adding data templateEnter to test the conversion logic for the data available for realizing language that the data that input data obtains are converted to for target protocol.
Preferably, agreement calling logic can be multiplexed the protocol realization logic at interface service end to be measured, mesh in practical applicationThe realization language for marking agreement can also be identical as the programming language that server-side where interface to be measured realizes that target protocol uses.
Such as: if the server-side where interface to be measured realizes target protocol, mesh in testing tool using Java languageThe realization language of mark agreement can use Java language.At this time, it may be necessary to which tester uploads the interface to be measured that Java language is writeDefinition source data, while the agreement calling logic of testing tool also needs to write using Java language.Testing tool is metInterface requirement and including test input data JSON data after, need to be converted to JSON data for Java language canUse data.Specifically, the value of value field can be converted to by Java language according to the description information of type field in JSON dataSay identifiable data.
In this step, after testing tool obtains the data available of the realization language for target protocol, using associationView calling logic encodes the data available, generates the test request for meeting target protocol, the service to where interface to be measuredEnd is sent.It is understood that needing to meet data pack receiving and transmitting requirement as defined in target protocol when sending test request.
Step S103: testing tool receives the response for test request to realize the test of interface to be measured.
In this step, after the response that the server-side where testing tool receives interface to be measured returns, using agreementCalling logic decodes the response, obtains the test output data carried in the response.Preferably, test output data is JSONData.Testing tool will test output data compared with the expected data in test case, obtain test result.
In this way, in an embodiment of the present invention, is obtained according to target protocol and be suitable for connecing for total interface under target protocolMouthful resolution logic and agreement calling logic, using interface resolution logic realize interface define source data to data template automatic solutionAnalysis encodes parsing data using agreement calling logic and sends the test request for meeting target protocol, and then to returnResponse be decoded the automatic test to realize interface to be measured.In concrete application, if target protocol does not change, newWhen increasing or upgrading interface to be measured, the logic being not required in changed test tool need to only upload the definition source data of interface to be measured, simultaneouslyTesting tool is not required to recompilate the automatic test that interface to be measured can be realized, to realize the branch updated to interface dynamicIt holds, improves testing efficiency, while making tester that need not understand agreement calling logic, the system of test case can be absorbed inMake.
Particularly, in practical applications, interface resolution logic can be deployed in agreement calling logic in the form of plug-in unitTesting tool, to realize that interface parsing and agreement are called.Wherein, plug-in unit refers to realizing according to specific extensible framework specificationFunctional module.In embodiments of the present invention, it can be directed to each agreement, by interface resolution logic and agreement calling logic pointIt is not stored in two plug-in units.Meanwhile preferably, the present invention can support plug-in unit as follows based on multilingual: C dynamic base, C++ are dynamicState library, Java Jar packet, Java Class file, PHP source file, Shell script and Python script, to reduce plug-in unitDevelopment cost.Wherein, C, C++, Java, PHP, Shell, Python are programming language, and Java Class file isJava class file, jar packet be finish writing in advance realization certain function Java code.
In this way, memory interface resolution logic and agreement calling logic by way of plug-in unit, to newly-increased agreement or upgradingWhen the interface of agreement is tested, only memory interface resolution logic need to be provided to testing tool and the plug-in unit of agreement calling logic isCan, it is subsequent when needing newly-increased or upgrade interface, testing tool and plug-in unit without change, it is thus achieved that the Dynamic Recognition of interface andIndifference is called, and is improved the scalability of testing tool, is reduced the maintenance workload of testing tool.
It is understood that, if executing test before interface to be measured, directly acquiring corresponding number in practical applicationIt is tested according to template.If executing test before the target protocol of interface ownership to be measured, and interface to be measured is newly-increasedInterface or upgrade interface, then the definition source data for uploading the interface can be tested.If the target association of interface ownership to be measuredView is newly-increased agreement or updating protocol, then needs the interface of sealed storage interface resolution logic to parse plug-in unit and call with storage agreementThe agreement of logic calls plug-in unit, and two plug-in units are uploaded.
Fig. 2 is the specific implementation schematic diagram of the method for automatic test according to a first embodiment of the present invention.
In Fig. 2, expansible plug-in management module calls plug-in unit for package interface parsing plug-in unit and agreement, and establishes and insertPart management framework is managed according to plug-in unit of the framework specification to different agreement in expansible mode.
Specifically, plug-in unit is parsed for the interface of any agreement, the definition source data of interface to be measured can be resolved toThe data template of JSON format, later, assignment test input data obtains JSON data in data template.Such as: certain agreementInterface parsing plug-in unit can realize following API:
JSON parseInterfaces(File protocolDefFile)
Wherein, File protocolDefFile is the definition source data of interface to be measured, and the return value of the API is JSON latticeThe data template of formula.
Plug-in unit is called for the agreement of any agreement, is encoded using JSON data as ginseng is entered, then to server-sideInitiate test request;The response returned is received, response is decoded, JSON is converted into and goes out to join.Such as: the agreement of certain agreement, which is called, insertsFollowing API can be achieved in part:
int invoke(JSON req,JSON resp);
Wherein, req is the JSON data of input, and resp is the test output data of the JSON format of output, and return value is smallIt indicates to call exception in zero, return value, which is more than or equal to zero, to be indicated to call successfully.
In testing process management module:
Test data management module for will test input data assignment to data template, and compare test output data andExpected data obtains test result.
Test case management module for make, management of test cases.
Test assignment management module can support the multidimensional of timing regression test, agreement and interface for managing test processStatistic and monitoring are spent, can support the diversification applied fields such as online verifying, publication verifying, dilatation verifying, environmental transport and transfer verifyingScape.
Test report management module test result for rendering.
In the technical solution of the embodiment of the present invention, it is suitable under the agreement by being tested the agreement that interface is belonged to and obtainingThe interface resolution logic of total interface, using the interface resolution logic realize interface define source data to data template automatic solutionIt analyses, and then realizes the automatic test of interface to be measured based on data template, so that being surveyed to newly-increased interface or upgrade interfaceWhen examination, it is not necessary to carry out the conversion that interface defines source data by tester, need not also carry out the hard coded of interface calling logic, onlyInterface need to be uploaded and define source data, to realize the support updated to interface dynamic, improve testing efficiency, while making to testPersonnel are not required to understand agreement calling logic, can be absorbed in the production of test case;The memory interface by way of plug-in unitResolution logic and agreement calling logic only need to be to testing tools when the interface to newly-increased agreement or updating protocol is testedThere is provided the plug-in unit of memory interface resolution logic and agreement calling logic, subsequent when needing newly-increased or upgrade interface, test workTool is not necessarily to change with plug-in unit, it is thus achieved that the hot plug-in unit characteristic of agreement, improves the scalability of testing tool, reduce surveyThe maintenance workload of trial work tool.
Fig. 3 is the major part schematic diagram of the device of the automatic test of the embodiment of the present invention.
As shown in figure 3, the device 300 of the automatic test of the embodiment of the present invention can include: preparatory unit 301 executes listMember 302 and test cell 303.Wherein:
Preparatory unit 301 can be used for determining the data mould for belonging to the interface to be measured of target protocol using interface resolution logicPlate;Wherein, the interface resolution logic is individually determined according to the target protocol;
Execution unit 302 can be used for that test input data is added in the data template, based on including test input numberAccording to data template generate and meet the test request of the target protocol, will be where the test request to the interface to be measuredServer-side is sent;
Test cell 303 can be used for receiving the response for the test request to realize the test of the interface to be measured.
In embodiments of the present invention, the data template is JSON format or XML format, enters ginseng knot including interface to be measuredStructure and out ginseng structure.
Preferably, preparatory unit 301 can be further used for: receiving the definition source data of the interface to be measured, utilize interfaceThe definition source data is converted to the data template by resolution logic.
As a preferred embodiment, execution unit 302 can be further used for: will include the data template of test input dataBe converted to the data available of the realization language for the target protocol;The data available is compiled using agreement calling logicCode, generates the test request;Wherein, the agreement calling logic is individually determined according to the target protocol.
In practical application, test cell 303 can be further used for: receive the response;Using agreement calling logic to instituteResponse decoding is stated, test output data is obtained;By the test output data compared with expected data, test result is obtained.
In concrete application, the interface resolution logic and the agreement calling logic are stored in plug-in unit.
Particularly, the plug-in unit can be with are as follows: C dynamic base, C++ dynamic base, Java Jar packet, Java Class file, PHPSource file, Shell script or Python script.
In addition, in embodiments of the present invention, the target protocol is nonstandard protocol.
Technical solution according to an embodiment of the present invention is suitable under the agreement by being tested the agreement that interface is belonged to and obtainingThe interface resolution logic of total interface, using the interface resolution logic realize interface define source data to data template automatic solutionIt analyses, and then realizes the automatic test of interface to be measured based on data template, so that being surveyed to newly-increased interface or upgrade interfaceWhen examination, it is not necessary to carry out the conversion that interface defines source data by tester, need not also carry out the hard coded of interface calling logic, onlyInterface need to be uploaded and define source data, to realize the support updated to interface dynamic, improve testing efficiency, while making to testPersonnel are not required to understand agreement calling logic, can be absorbed in the production of test case;The memory interface by way of plug-in unitResolution logic and agreement calling logic only need to be to testing tools when the interface to newly-increased agreement or updating protocol is testedThere is provided the plug-in unit of memory interface resolution logic and agreement calling logic, subsequent when needing newly-increased or upgrade interface, test workTool is not necessarily to change with plug-in unit, it is thus achieved that the hot plug-in unit characteristic of agreement, improves the scalability of testing tool, reduce surveyThe maintenance workload of trial work tool.
Fig. 4 is shown can showing using the device of the method or automatic test of the automatic test of the embodiment of the present inventionExample property system architecture 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405(this framework is only example, and the component for including in specific framework can be according to the adjustment of application concrete condition).Network 404 toThe medium of communication link is provided between terminal device 401,402,403 and server 405.Network 404 may include various connectionsType, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send outSend message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403(merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packetInclude but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to userThe shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to receptionTo the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letterBreath -- merely illustrative) feed back to terminal device.
It should be noted that the method for automatic test provided by the embodiment of the present invention is generally executed by server 405,Correspondingly, the device of automatic test is generally positioned in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization needIt wants, can have any number of terminal device, network and server.
The present invention also provides a kind of electronic equipment.
The electronic equipment of the embodiment of the present invention includes: one or more processors;Storage device, for storing one or moreA program, when one or more of programs are executed by one or more of processors, so that one or more of processingThe method that device realizes automatic test provided by the present invention.
Below with reference to Fig. 5, it illustrates the electronics of the method for the automatic test for being suitable for being used to realize the embodiment of the present inventionThe structural schematic diagram of the computer system 500 of equipment.Electronic equipment shown in Fig. 5 is only an example, should not be to the present inventionThe function and use scope of embodiment 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 inProgram in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 andExecute various movements appropriate and processing.In RAM503, be also stored with computer system 500 operate required various programs andData.CPU501, ROM 502 and RAM 503 is connected with each other by bus 504.Input/output (I/O) interface 505 also connectsTo bus 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathodeThe 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 becauseThe network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such asDisk, CD, magneto-optic disk, semiconductor memory etc. be mounted on as needed on driver 510, so as to from reading thereonComputer program is mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as according to the present inventionComputer software programs.For example, the embodiment of the present invention includes a kind of computer program products comprising be carried on computer-readableComputer program on medium, the computer program include the program code for executing method shown in key step figure.?In above-described embodiment, which can be downloaded and installed from network by communications portion 509, and/or from removableMedium 511 is unloaded to be mounted.When the computer program is executed by central processing unit 501, executes and limited in system of the inventionAbove-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meterCalculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but notBe limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.MeterThe 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 wiresTaking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storageDevice (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 journeyThe tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.In this hairIn bright, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, whereinCarry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to electricMagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable storage mediumAny computer-readable medium other than matter, the computer-readable medium can be sent, propagated or transmitted for being held by instructionRow system, device or device use or program in connection.The program code for including on computer-readable mediumIt can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. or above-mentioned any conjunctionSuitable combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journeyThe architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generationA part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or moreExecutable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in boxThe function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practicalOn can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.?It should be noted that the combination of block diagram or each box in flow chart and the box in block diagram or flow chart, can use executionThe dedicated hardware based systems of defined functions or operations realizes, or can use specialized hardware and computer instructionCombination is 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 hardThe mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packetInclude preparatory unit, execution unit and test cell.Wherein, the title of these units is not constituted under certain conditions to the listThe restriction of member itself, for example, preparatory unit is also described as " sending the unit of data template to execution unit ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can beIncluded in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned meterCalculation machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, so thatThe step of equipment executes includes: that the data template for belonging to the interface to be measured of target protocol is determined using interface resolution logic;Wherein, the interface resolution logic is individually determined according to the target protocol;Test input number is added in the data templateAccording to being generated based on the data template for including test input data and meet the test request of the target protocol, the test is askedIt asks and is sent to the server-side where the interface to be measured;The response for the test request is received to realize the interface to be measuredTest.
Technical solution according to an embodiment of the present invention is suitable under the agreement by being tested the agreement that interface is belonged to and obtainingThe interface resolution logic of total interface, using the interface resolution logic realize interface define source data to data template automatic solutionIt analyses, and then realizes the automatic test of interface to be measured based on data template, so that being surveyed to newly-increased interface or upgrade interfaceWhen examination, it is not necessary to carry out the conversion that interface defines source data by tester, need not also carry out the hard coded of interface calling logic, onlyInterface need to be uploaded and define source data, to realize the support updated to interface dynamic, improve testing efficiency, while making to testPersonnel are not required to understand agreement calling logic, can be absorbed in the production of test case;The memory interface by way of plug-in unitResolution logic and agreement calling logic only need to be to testing tools when the interface to newly-increased agreement or updating protocol is testedThere is provided the plug-in unit of memory interface resolution logic and agreement calling logic, subsequent when needing newly-increased or upgrade interface, test workTool is not necessarily to change with plug-in unit, it is thus achieved that the hot plug-in unit characteristic of agreement, improves the scalability of testing tool, reduce surveyThe maintenance workload of trial work tool.
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 brightIt is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is anyMade modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present inventionWithin.