CN106201808A - The automation interface method of testing of a kind of server end and system - Google Patents

The automation interface method of testing of a kind of server end and system Download PDF

Info

Publication number
CN106201808A
CN106201808A CN201510220617.9A CN201510220617A CN106201808A CN 106201808 A CN106201808 A CN 106201808A CN 201510220617 A CN201510220617 A CN 201510220617A CN 106201808 A CN106201808 A CN 106201808A
Authority
CN
China
Prior art keywords
test
result
game server
module
socket
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
CN201510220617.9A
Other languages
Chinese (zh)
Inventor
张丙鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Changyou Tianxia Network Technologies Co Ltd
Original Assignee
Beijing Changyou Tianxia Network Technologies 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 Changyou Tianxia Network Technologies Co Ltd filed Critical Beijing Changyou Tianxia Network Technologies Co Ltd
Priority to CN201510220617.9A priority Critical patent/CN106201808A/en
Publication of CN106201808A publication Critical patent/CN106201808A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This application discloses the automation interface test system of a kind of server end, network engine module is used for realizing connecting game server, logs in game server, test data or behavioral test are converted to data stream, and the functions such as data flow to game server and reception game server is passed back data stream parsing that use socket to send;Test case performs module for calling the test script that network engine module implementation of test cases is corresponding;Test result processing module is used for calling network engine module, socket is used to receive the information that server end returns, it is attribute data by the attribute type of message bag by binary data stream, test case expected results is compared with the result received from server, generates and preserve test result.Disclosed herein as well is the automation interface method of testing of server end.The application scheme can reduce the impact on test of the dependence of intermodule.

Description

The automation interface method of testing of a kind of server end and system
Technical field
The application relates to computer techno-stress technical field, particularly relates to the automation interface test side of a kind of server end Method and system.
Background technology
Interface testing is a kind of test of test system components interface.Interface testing mainly for detection of external system with Interaction point between native system and between internal subsystems.That test it is important that the exchange of data to be checked, pass Pass and control management process, and the mutual logic dependencies etc. between system.
Interface testing is to ensure that under the driving effect of the economic interests of the inherently required of high complexity mass of system and low cost Best solution.First, interface testing can effectively save total testing cost, calculates according to data model, One bug of bottom can cause about 8 bug on upper strata, and the bug of bottom is easy to cause delaying of the whole network Machine.On the contrary, the solution of the low-cost high-efficiency in the case of interface testing can provide system complexity to rise;Its Secondary, interface testing is different from the unit testing of tradition exploitation, and interface testing is that system interface is entered by the angle standing in user The detection that row is the most high-efficiency continuous.
Owing to the interface of server end is numerous, relation is complicated, if server internal is carried out interface testing, needs By the test environment of current tested module Yu other Depending module partition structure independences, ignore the dependence object of measurand, Implement and need to use the technology such as Mock, and use Mock technical difficulty relatively big, relatively costly.
Summary of the invention
This application provides automation interface method of testing and the system of a kind of server end, it is possible to reduce depending on of intermodule The relation of the relying impact on test.
The automation interface test system of a kind of server end that the embodiment of the present application provides, this system includes: network draws Holding up module, test case performs module and test result processing module;
Network engine module, is used for realizing connecting game server, logging in game server, by test data or survey Try as being converted to data stream, and use socket transmission data flow to game server and receive game server biography The functions such as the data stream returned parsing;
Test case performs module, for calling the test script that network engine module implementation of test cases is corresponding;
Test result processing module is used for calling network engine module, uses socket to receive the information that server end returns, Be attribute data by the attribute type of message bag by binary data stream, by test case expected results with from clothes The result that business device receives is compared, and passes through if it is expected that result is then tested equal to actual result, generates what detection was passed through Result;If actual result does not meets expected results requirement, test crash, generate the result of test crash;And protect Deposit test result.
It is preferred that this system farther includes: plan target trigger module, for triggering this test by plan target System is run the most automatically.
It is preferred that this system farther includes: script management module, it is used for being managed collectively each test script, it is provided that Amendment interface and interface to test script.
It is preferred that described test case performs module includes following submodule:
Preposition implementation sub-module, is attached for creating a socket and game server, creates a game angle Color also logs in scene of game, sends authentication data flow to server end by this socket for subsequent operation and prepares;
Test submodule, for turning the internet message bag property value bag corresponding to game server end interface to be tested It is changed to binary data stream, binary data stream is sent to game server by socket.
It is preferred that described test result processing module farther includes:
Result display unit, for being sent to technical staff by test result daily record with the form of mail or test being tied Really daily record is converted into html file and shows on website.
The embodiment of the present application additionally provides the automation interface method of testing of a kind of server end, and the method is by as previously mentioned Server end automation interface test system realize, comprise the steps:
A, call network engine module connect game server, log in game server, will test data or test Behavior is converted to data stream, and uses socket transmission data to flow to game server;
B, use socket receive the information that server end returns, by the attribute type of message bag by binary data Circulation is changed to attribute data, is compared with the result received from server by test case expected results, if it is expected that Result is then tested equal to actual result and is passed through, and generates the result that detection is passed through;If actual result does not meets expected results Require then test crash, generate the result of test crash;And preservation test result.
It is preferred that the method farther includes: triggered by plan target and perform described step A and step B.
It is preferred that the method farther includes: be managed collectively each test script, it is provided that the amendment to test script connects Mouth and interface.
It is preferred that step A farther includes:
Create a socket and game server be attached, create a game role and log in scene of game, Send authentication data flow to server end by this socket for subsequent operation to prepare;
Internet message bag property value bag corresponding to game server end interface to be tested is converted to binary data Stream, is sent to game server by binary data stream by socket.
It is preferred that farther include after step B: test result daily record is sent to technical staff with the form of mail Or test result daily record is converted into html file show on website.
As can be seen from the above technical solutions, interface testing function is stripped out from server, uses socket Special test system is coupled together by word with game server end, and test system sends data and flows to test game The interface that server comes out, to realize test process, is provided even by the most packaged network engine module Connect the functions such as server, game server, transmission reception message, have only to clothes during carrying out practically test case Business device inputs the binary data stream constructed, it is simple to technical staff's follow-up maintenance.
In the preferred embodiment of the application, by plan target trigger module, realization that can be the most stable is regularly Start, automatic test, save manpower;The script will used in test process, unification is managed module by script It is managed, convenient amendment, conveniently seeks unity of action so that it is the most convenient to revise;Use the most general automatic Change test frame NUnit, can directly use, it is simple to safeguard, allow technical staff pay close attention to the volume of test case Writing, as use-case execution sequence, result log file generated is realized by the framework increased income, and improves development efficiency.
Accompanying drawing explanation
The automation interface test system block diagram of the server end that Fig. 1 provides for the embodiment of the present application;
Fig. 2 provides automation interface method of testing flow chart for the embodiment of the present application.
Detailed description of the invention
For making the know-why of technical scheme, feature and technique effect clearer, below in conjunction with concrete real Execute example technical scheme is described in detail.Embodiment is carried out with the server end to a kind of network game system As a example by test, the application scheme is illustrated.
The automation interface test system of the server end that Fig. 1 provides for the embodiment of the present application, including network engine Module 101, plan target trigger module 102, script management module 103, test case execution module 104, Test result processing module 105.
Plan target trigger module 102 is transported the most automatically for triggering this test system by plan target OK.This module is optional module, it is possible to as required, by manually starting this test system at control station.
Network engine module 101, is used for realizing connecting game server, logs in game server, will test data Or behavioral test is converted to data stream, and transmission data flow to game server and receive game server biography The functions such as the data stream returned parsing.Network engine module can be used to provide so that test case performs module Function connects game server, logs in scene of game, and the data transmission in testing.
Script management module 103, is used for being managed collectively each test script, it is provided that the amendment interface to test script And interface.
Test case performs module 104, as the term suggests, this module is used for calling network engine module and performs test use The various test scripts that example is corresponding.Including following submodule:
Preposition implementation sub-module, is attached for creating a socket (socket) and game server, wound Build a game role and log in scene of game, being tested by this socket transmission to server end for subsequent operation Card data stream is prepared.In field of play, game client is communicated with game server end by Socket, Socket is the communication bridge between client and service area.
Test submodule, for by the internet message bag property value corresponding to game server end interface to be tested Bag is converted to binary data stream, and by socket, binary data stream is sent to game server,
Test result processing module is used for calling network engine module, uses socket Socket.receive to receive clothes The information that business device end returns, is attribute data by the attribute type of message bag by binary data stream, will survey Example expected results on probation is compared with the result received from server, if it is expected that result is equal to actual result then Test is passed through, and generates the result that detection is passed through;If actual result does not meets expected results requirement, test crash, Generate the result of test crash, preserve test result, and test result daily record is sent to skill with the form of mail Art personnel or test result daily record is converted into html file shows on website.
The embodiment of the present application additionally provides the automation interface method of testing of a kind of server end, by described server end Automation interface test system realizes, as in figure 2 it is shown, comprise the steps:
Step 201: call network engine module connect game server, log in game server, will test data or Person's behavioral test is converted to data stream, and uses socket transmission data to flow to game server;
Step 202: use socket to receive the information that server end returns, entered two by the attribute type of message bag Stream compression processed is changed to attribute data, is compared with the result received from server by test case expected results, as Really expected results is then tested equal to actual result and is passed through, and generates the result that detection is passed through;If actual result does not meets pre- Phase result requires then test crash, generates the result of test crash;And preservation test result.
According to another embodiment of the application, triggered by plan target and perform described step 201 and step 202.
According to another embodiment of the application, the method farther includes: be managed collectively each test script, it is provided that right The amendment interface of test script and interface.
According to another embodiment of the application, step 201 farther includes:
Create a socket and game server be attached, create a game role and log in scene of game, Send authentication data flow to server end by this socket for subsequent operation to prepare;
Internet message bag property value bag corresponding to game server end interface to be tested is converted to binary data Stream, is sent to game server by binary data stream by socket.
Farther include according to after another embodiment of the application, step 202: by test result daily record with mail Form is sent to technical staff or test result daily record is converted into html file shows on website.
As a example by a concrete test case (test game server end removes device interface), say The operation of this test system bright.
Game server end provides RemoveItem interface to call for game client, and request message parameter is as follows
Parameter name Parameter describes Character types Character value
ItemGuid Article GUID UInt64
uiSrcSlotKey Article groove coordinate UInt32
iCount Remove quantity Int32
Generate request message code as follows:
Arranging a windows timing task in plan target trigger module, this plan target is in every day The appointment time runs " automatic Run Script (RunRegressTest.cmd) " automatically.
Safeguarding an automatic Run Script (RunRegressTest.cmd) in script management module, this script calls Follow-up several script: run detected rule script (Run.cmd), show testing result script. RunRegressTest.cmd code logic false code is expressed as follows:
Test case performs module and is realized by running detected rule script, is expressed as follows by false code:
. Nunit nunit-console.exe%EXE_DIR%RegressTest.dll
Wherein nunit-console.exe is the control station method of operation of NUnit test frame.RegressTest.dll It is the test case script write based on NUnit framework, uses C# language to write, will checking game server end Interface test process script realizes.As a example by checking the RemoveItemHandler interface that server end is open, Substantially detection logic is as follows:
Operation result is saved in journal file.
Test result processing module is by showing that testing result script realizes, by testing result journal file with mail Form is sent to technical staff or testing result log is converted into html file shows on website.
Assume as a example by sending mail, substantially logic:
Interface testing function is stripped out from server by technical scheme, uses socket (Socket) Special test system being coupled together with game server end, test system sends data and flows to test game garment The interface that business device comes out, to realize test process, is provided by the most packaged network engine module and connects Server, game server, transmission receive the functions such as message, have only to service during carrying out practically test case Device inputs the binary data stream constructed, it is simple to technical staff's follow-up maintenance;Trigger by plan target Module, can be the most stable realize start by set date, automatic test, save manpower;Test process will be used Script, unified be managed by script management module, convenient amendment, conveniently seek unity of action so that amendment is more For convenient;Use the most general automated test frame NUnit, can directly use, it is simple to safeguard, allow skill Art personnel pay close attention to writing of test case, and as use-case execution sequence, result log file generated is by opening The framework in source realizes, and improves development efficiency.
The foregoing is only the preferred embodiment of the application, not in order to limit the protection domain of the application, Within all spirit in technical scheme and principle, any modification, equivalent substitution and improvement etc. done, Should be included within the scope of the application protection.

Claims (10)

1. the automation interface test system of a server end, it is characterised in that this system includes: network draws Holding up module, test case performs module and test result processing module;
Network engine module, is used for realizing connecting game server, logging in game server, by test data or survey Try as being converted to data stream, and use socket transmission data flow to game server and receive game server biography The functions such as the data stream returned parsing;
Test case performs module, for calling the test script that network engine module implementation of test cases is corresponding;
Test result processing module is used for calling network engine module, uses socket to receive the information that server end returns, Be attribute data by the attribute type of message bag by binary data stream, by test case expected results with from clothes The result that business device receives is compared, and passes through if it is expected that result is then tested equal to actual result, generates what detection was passed through Result;If actual result does not meets expected results requirement, test crash, generate the result of test crash;And protect Deposit test result.
System the most according to claim 1, it is characterised in that this system farther includes: plan target triggers Module, runs the most automatically for triggering this test system by plan target.
System the most according to claim 1, it is characterised in that this system farther includes: script management module, For being managed collectively each test script, it is provided that amendment interface and the interface to test script.
System the most according to claim 1, it is characterised in that described test case performs module and includes following son Module:
Preposition implementation sub-module, is attached for creating a socket and game server, creates a game angle Color also logs in scene of game, sends authentication data flow to server end by this socket for subsequent operation and prepares;
Test submodule, for turning the internet message bag property value bag corresponding to game server end interface to be tested It is changed to binary data stream, binary data stream is sent to game server by socket.
System the most according to claim 1, it is characterised in that described test result processing module farther includes:
Result display unit, for being sent to technical staff by test result daily record with the form of mail or test being tied Really daily record is converted into html file and shows on website.
6. the automation interface method of testing of a server end, it is characterised in that the method is by such as claim 1 institute The automation interface test system of the server end stated realizes, and comprises the steps:
A, call network engine module connect game server, log in game server, will test data or test Behavior is converted to data stream, and uses socket transmission data to flow to game server;
B, use socket receive the information that server end returns, by the attribute type of message bag by binary data Circulation is changed to attribute data, is compared with the result received from server by test case expected results, if it is expected that Result is then tested equal to actual result and is passed through, and generates the result that detection is passed through;If actual result does not meets expected results Require then test crash, generate the result of test crash;And preservation test result.
Method the most according to claim 6, it is characterised in that the method farther includes: pass through plan target Trigger and perform described step A and step B.
Method the most according to claim 6, it is characterised in that the method farther includes: be managed collectively each Test script, it is provided that amendment interface and the interface to test script.
Method the most according to claim 6, it is characterised in that step A farther includes:
Create a socket and game server be attached, create a game role and log in scene of game, Send authentication data flow to server end by this socket for subsequent operation to prepare;
Internet message bag property value bag corresponding to game server end interface to be tested is converted to binary data Stream, is sent to game server by binary data stream by socket.
Method the most according to claim 6, it is characterised in that farther include after step B: will test Result log is sent to technical staff with the form of mail or test result daily record is converted into html file at net Stand upper display.
CN201510220617.9A 2015-05-04 2015-05-04 The automation interface method of testing of a kind of server end and system Pending CN106201808A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510220617.9A CN106201808A (en) 2015-05-04 2015-05-04 The automation interface method of testing of a kind of server end and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510220617.9A CN106201808A (en) 2015-05-04 2015-05-04 The automation interface method of testing of a kind of server end and system

Publications (1)

Publication Number Publication Date
CN106201808A true CN106201808A (en) 2016-12-07

Family

ID=57458771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510220617.9A Pending CN106201808A (en) 2015-05-04 2015-05-04 The automation interface method of testing of a kind of server end and system

Country Status (1)

Country Link
CN (1) CN106201808A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168883A (en) * 2017-07-26 2017-09-15 成都科来软件有限公司 A kind of API data automated testing method
CN107634879A (en) * 2017-09-15 2018-01-26 深圳易嘉恩科技有限公司 XBRL platform interface automated testing methods based on PyUnit
CN108694104A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 A kind of interface function contrast test method, apparatus, electronic equipment and storage medium
CN108874658A (en) * 2017-12-25 2018-11-23 北京安天网络安全技术有限公司 A kind of sandbox analysis method, device, electronic equipment and storage medium
CN109254916A (en) * 2018-08-30 2019-01-22 郑州云海信息技术有限公司 A kind of method and server of the visualization RestFul interface testing relying on injection based on Spring
CN109818825A (en) * 2019-01-07 2019-05-28 郑州云海信息技术有限公司 A kind of Rack server intelligent testing method and system
CN111382069A (en) * 2020-03-02 2020-07-07 北京九州云动科技有限公司 Data flow testing method and system
CN111400162A (en) * 2019-01-02 2020-07-10 阿里巴巴集团控股有限公司 Test method and test system
CN111737065A (en) * 2020-05-27 2020-10-02 苏州浪潮智能科技有限公司 Demand model based on server interface test and interface test method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609819A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Test method for computer external equipment interface
CN101576843A (en) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 Method and device for testing application program interface
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
US20130065694A1 (en) * 2011-09-13 2013-03-14 Electronics And Telecommunications Research Institute Method for performance test of online game server
CN103593294A (en) * 2013-11-21 2014-02-19 福建天晴数码有限公司 Method and system for testing network game performance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609819A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Test method for computer external equipment interface
CN101576843A (en) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 Method and device for testing application program interface
US20130065694A1 (en) * 2011-09-13 2013-03-14 Electronics And Telecommunications Research Institute Method for performance test of online game server
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
CN103593294A (en) * 2013-11-21 2014-02-19 福建天晴数码有限公司 Method and system for testing network game performance

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694104A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 A kind of interface function contrast test method, apparatus, electronic equipment and storage medium
CN107168883A (en) * 2017-07-26 2017-09-15 成都科来软件有限公司 A kind of API data automated testing method
CN107168883B (en) * 2017-07-26 2020-07-14 成都科来软件有限公司 API data automatic testing method
CN107634879A (en) * 2017-09-15 2018-01-26 深圳易嘉恩科技有限公司 XBRL platform interface automated testing methods based on PyUnit
CN108874658A (en) * 2017-12-25 2018-11-23 北京安天网络安全技术有限公司 A kind of sandbox analysis method, device, electronic equipment and storage medium
CN109254916A (en) * 2018-08-30 2019-01-22 郑州云海信息技术有限公司 A kind of method and server of the visualization RestFul interface testing relying on injection based on Spring
CN111400162A (en) * 2019-01-02 2020-07-10 阿里巴巴集团控股有限公司 Test method and test system
CN111400162B (en) * 2019-01-02 2023-04-25 阿里巴巴集团控股有限公司 Test method and test system
CN109818825B (en) * 2019-01-07 2022-02-18 郑州云海信息技术有限公司 Rack server intelligent test method and system
CN109818825A (en) * 2019-01-07 2019-05-28 郑州云海信息技术有限公司 A kind of Rack server intelligent testing method and system
CN111382069A (en) * 2020-03-02 2020-07-07 北京九州云动科技有限公司 Data flow testing method and system
CN111737065B (en) * 2020-05-27 2023-01-06 苏州浪潮智能科技有限公司 Interface test method and system of demand model based on server interface test
CN111737065A (en) * 2020-05-27 2020-10-02 苏州浪潮智能科技有限公司 Demand model based on server interface test and interface test method and system

Similar Documents

Publication Publication Date Title
CN106201808A (en) The automation interface method of testing of a kind of server end and system
CN106875156B (en) Universal intelligent auditing platform and auditing method thereof
US10642913B2 (en) Intent and bot based query guidance
US8108834B2 (en) Defining and executing processes using declarative programming language constructs
US9122804B2 (en) Logic validation and deployment
CN108334449A (en) A kind of method and apparatus of interface automatic test
WO2012037511A1 (en) Support for a parameterized query/view in complex event processing
CN107103064B (en) Data statistical method and device
US6895575B2 (en) Generic Java rule engine framework
CN113032244B (en) Interface test method, device, computer system and computer readable storage medium
Shukla et al. Smart contracts for multiagent plan execution in untrusted cyber-physical systems
CN104168250B (en) Business Process Control method and device based on CGI frames
US10248532B1 (en) Sensitive data usage detection using static analysis
CN110968437A (en) Method, device, equipment and medium for parallel execution of single contract based on Java intelligent contract
CN103049367A (en) Automatic testing method for software
CN107635001A (en) Web scripts abnormality eliminating method and device
WO2023065746A1 (en) Algorithm application element generation method and apparatus, electronic device, computer program product and computer readable storage medium
CN110298000A (en) Acquisition methods, terminal device and the medium of page parameter
CN109447384A (en) Verification method, device, equipment and the storage medium of air control system
CN105516337B (en) Web site based on dynamic load mechanism docks analytic method
CN104423932B (en) The method that Binary Element is called in Javascript
CN112559344A (en) Remote mock testing method and system
CN107493299A (en) A kind of user behavior source tracing method based on three-tier architecture
CN103455476A (en) Processing method and device for network information and establishing method and device for abstract syntax tree
WO2016048294A1 (en) Infrastructure rule generation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161207