The interface Behavior modeling test macro and method of Business Management Platform
Technical field
The present invention relates to network communication testing field, the interface Behavior modeling more particularly to a kind of Business Management Platform is surveyed
Test system and method.
Background technique
With the broad development of the communication technology, the range of communication service covering is also increasingly wider.And for each communication
The interface testing tool of operation system be all it is each self-developed according to interface document, lack the tool of preparatory integrated debugging;And
And since the network node of two different communication service systems is all the external interface of Web Service, non-final user
Node or router device node are difficult defining interface at the beginning and user are needed while how many online being supported concurrently to ask
Advertisement configuration of summing request, can not also measure the processing capacity of individual system.Therefore, two independent communication service systems it
Between interface testing when need the environment of both sides to exist simultaneously, this just to link up and technology requirement it is also very high;Also, it also needs pair
The interface processing function of both sides carries out certain pre-authentication, and interface processing energy is searched out under certain software and hardware and network environment
The index value of power.
Current interface testing largely in such a way that both sides write simulation tool, also useful httpClient or
Soapui carries out the technical solution of interface verifying, but has certain limitation in the authenticated encryption mode for solving both sides, so more
The verifying applied to individual interface message added, without (being seen extensively for example, user connects hot spot login according to business scenario
Accuse) the case where, simplation verification is carried out to a complete Business Stream.
As shown in Figure 1, platform 1 is positioned at Business Management Platform, the interface realization pair with network management platform can be passed through
The management of routing device and the release management of user advertising.Platform 2 is also used to other than being positioned at Business Management Platform to routing
The management of equipment has had a set of perfect user's online client software, can be straight with Automatic-searching router by software
Net is connected, and is had through the interface with platform 1, the router below platform 1 can also be managed.
Due to being all made of encryption or the authentication mode of certain way between platform 1 and the interface of platform 2, and to message
Inside have certain processing requirement, so needing common user identifier and data between platform 1 and platform 2, just can guarantee stream
The entire run of journey.But the data of this different platform interdepend and logical relation, to the simulation of scene, message
Parsing and continuously transmitting for message bring certain difficulty.
Summary of the invention
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of interfaces of Business Management Platform
Behavior modeling test macro and method, for solving message between the interface of two independent communication service systems in the prior art
Parsing and continuously transmit difficulty;And it is needed in interface testing using certain processing method, to guarantee different communication industry
The problem of common user identifier and data is used between the interface of business system.
In order to achieve the above objects and other related objects, the present invention provides a kind of interface Behavior modeling of Business Management Platform
Test macro, for the interface performance testing between the first Business Management Platform interconnected and the second Business Management Platform,
Wherein, the first Business Management Platform and the second Business Management Platform are independent from each other communication service system, the service management
The interface Behavior modeling test macro of platform includes message sending/receiving module, message dissection process module, simulation testing module
And configuration module;The configuration module is used to configure IP address and the port of first service management module;The message hair
Receiving module is sent to be used for IP address and port according to first service management module, Xiang Suoshu the first Business Management Platform mould
It sends out and send message or reception message;And before the message, message is reduced to HTTP message;The message dissection process module
For being generated, being parsed and being handled to message;The simulation testing module is used to utilize script, controls the message transmission and connects
To described first when receiving the second Business Management Platform described in module and the message dissection process module simulation in abnormal scene
The message of Business Management Platform is sent, and receives and check replying message for first Business Management Platform.
Optionally, the message dissection process module to the parsing of message and processing include complex message formats parsing and
Character conversion.
Optionally, the message dissection process module further includes encrypted authentication processing submodule;The encrypted authentication processing
Submodule is for authenticating and binding first Business Management Platform and second Business Management Platform.
Optionally, the encrypted authentication processing submodule by verifying code authentication and binds first Business Management Platform
With second Business Management Platform.
The invention also discloses a kind of interface Behavior modeling test method of Business Management Platform, for interconnected the
Interface performance testing between one Business Management Platform and the second Business Management Platform;And first Business Management Platform and institute
It states the second Business Management Platform and is independent from each other communication service system, the interface performance testing method of the Business Management Platform
Include: step S10, configures IP address and the port of first Business Management Platform;Step S20, by sending requests verification
First Business Management Platform and second Business Management Platform described in code message authentication, obtain identifying code message;Step S30,
Parse the identifying code message and obtain identifying code, and by send bind-request message bind first Business Management Platform and
Second Business Management Platform;Step S40, using script, when simulating second Business Management Platform in abnormal scene
It is sent to the message of first Business Management Platform, and receives and check replying message for first Business Management Platform.
Optionally, the step S20 pass through send the first Business Management Platform of requests verification code message authentication and second
Business Management Platform, obtaining identifying code message includes: that message sending/receiving module simulates asking for second Business Management Platform
Identifying code message is sought, and is sent to first Business Management Platform;First Business Management Platform receives the request and tests
After demonstrate,proving code message, and identifying code message is returned;The message sending/receiving module receives the identifying code message, and to described
Identifying code message is saved.
Optionally, the parsing of the step S30 identifying code message obtains identifying code, and is disappeared by sending bind request
Breath binds first Business Management Platform and second Business Management Platform includes: described in the parsing of message dissection process module
Identifying code message obtains identifying code;The message sending/receiving module simulates the bind request of second Business Management Platform
Message, and sent to first Business Management Platform;After first Business Management Platform receives the bind-request message,
By processing, binding message is returned;The message sending/receiving module receives the binding message, binds first business
Manage platform and second Business Management Platform.
Optionally, in the step S40, using the identifying code as global variable when analog interface performance testing, with
Message is sent together.
As described above, the interface Behavior modeling test macro and method of a kind of Business Management Platform of the invention, Ke Yigen
The customized change message format of packet capturing is carried out on the first Business Management Platform and the second Business Management Platform according to practical application, spirit
It is living convenient, the application simulation environment of complete set can be built, the transmitting and parsing of multiple message between different systems are simulated;Phase
Compared with such as loadrunner, the recording and simulation of the common simulation tool of selenium or QTP etc. biased toward to user interface,
More complicated art of programming is needed to the support of Message Simulation, the present invention can be very good due to open source using java language
Different modules is write with Groovy language, it may be convenient to which the message of customized each not homologous ray simulated, message solution
Analysis and transmission and secondary development.Also, the certification message between the method simulation different communication operation system of present invention simplicity,
And sending and receiving for multiple and different message can be very easily supported by way of parametrization, it in this way can be very convenient
The each communication service system of progress between and independent communication service system performance indicator verifying and simulated pressure survey
Examination.
Detailed description of the invention
Fig. 1 is shown as web results schematic diagram.
Fig. 2 is shown as a kind of knot of the interface Behavior modeling test macro of Business Management Platform disclosed by the embodiments of the present invention
Structure schematic diagram.
Fig. 3 is shown as a kind of stream of the interface Behavior modeling test method of Business Management Platform disclosed by the embodiments of the present invention
Journey schematic diagram.
Component label instructions
The interface performance testing system of 200 Business Management Platform
210 message sending/receiving modules
220 message dissection process modules
221 encrypted authentications handle submodule
230 simulation testing modules
240 configuration modules
S10~S40 step
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification
Other advantages and efficacy of the present invention can be easily understood for disclosed content.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also based on different viewpoints and application, without departing from
Various modifications or alterations are carried out under spirit of the invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
Please refer to attached drawing.It should be noted that diagram provided in following embodiment only illustrates this hair in a schematic way
Bright basic conception, only shown in schema then with related component in the present invention rather than component count when according to actual implementation,
Shape and size are drawn, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its component
Being laid out kenel may also be increasingly complex.
Embodiment 1
Present embodiment discloses a kind of interface Behavior modeling test macros of Business Management Platform for interconnected the
Interface performance testing between one Business Management Platform and the second Business Management Platform.Wherein, the first Business Management Platform and
Two Business Management Platform are for handling communication service system, and the first Business Management Platform and the second Business Management Platform are phases
Mutual independent communication service system.All it can encrypt or authenticate using certain way between the interface of different Business Management Platform,
Therefore the message between different Business Management Platform parses, continuously transmits just relatively difficult, different business interconnected
The interface performance testing managed between platform is also just more difficult.
The interface Behavior modeling test macro of the Business Management Platform of the present embodiment carry out the first Business Management Platform and
When interface performance testing between the second Business Management Platform, wherein the first Business Management Platform is to provide meter as server
The equipment for calculating service, i.e., server needs to respond service request, and is handled, and therefore, server should have the service of undertaking simultaneously
And ensure the ability of service.Second Business Management Platform is client, corresponding with server, provides local service for user
Program, be typically mounted in terminal, need operation of working in coordination with server-side.Client include but is not limited to intelligent terminal or
Terminal.
As shown in Fig. 2, the interface performance testing system 200 of the Business Management Platform of the present embodiment is transmitted and received including message
Module 210, message dissection process module 220, simulation testing module 230 and configuration module 240.
Configuration module 240 is used to configure IP address and the port of the first service management module.
Message sending/receiving module 210 is used for IP address and port according to the first service management module, to the first business
Platform simulation is managed to send message or receive message.The message sended over to the first Business Management Platform receives, by it
It is saved.The second Business Management Platform is simulated to be sent to the message of external (the first Business Management Platform) and carry out simplifying place
Reason, after being converted to HTTP message, then is sent, and record transmission result.By the way that the message of transmission is reduced to HTTP message,
User, which only needs to define the address URL comprising IP address and port, can easily send and receive message.
Message dissection process module 220 is for generating message, being parsed and being handled.Message dissection process module 220
The message for the first Business Management Platform of preservation received is parsed and handled, suitable format is converted into and sends to again
Other modules.In the present embodiment, message dissection process module 220 supports the parsing and character conversion of complex message formats, example
The content in message can such as be parsed according to XPATH mode.
In order to guarantee the safety of communication, certain encryption or certification generally can be all used between the interface of Business Management Platform
Mode.It therefore, further include for authenticating and binding between different Business Management Platform in message dissection process module 220
Encrypted authentication handles submodule 221.
In the present embodiment, encrypted authentication processing submodule 221 is that the first service management is carried out by way of identifying code
Certification and binding between platform and the second Business Management Platform.Encrypted authentication handles submodule 221 can be by the verifying of encryption
Code takes out, and is converted according to certain encryption rule, the second Business Management Platform of message sending side is returned to, to complete
Certification and binding between first Business Management Platform and the second Business Management Platform, ensure that the safety of message.Certainly, originally
The encrypted authentication processing submodule 221 of invention is not limited in being authenticated and being bound by identifying code, can also be according to need
The encrypting and decrypting of other modes is carried out, guarantees the safety of message, such as IP address identification, uniqueness filtering etc..
Further, message dissection process module 220 works as message field in the content for the structure and message for defining message body
When change, it can flexibly increase change message content, without will affect original message content.
Simulation testing module 230 is used to utilize script, control message sending/receiving module and message dissection process module mould
Disappearing to the first Business Management Platform when quasi- second Business Management Platform is in abnormal scene (such as multiple messages concurrent etc.)
Breath is sent, and receives and check replying message for the first Business Management Platform.
It should be noted that in order to protrude innovative part of the invention, it will not be with the solution present invention in the present embodiment
The technical issues of proposed, the less close module of relationship introduced, but this does not indicate that there is no other moulds in the present embodiment
Block.
Embodiment 2
Present embodiment discloses a kind of interface Behavior modeling test method of Business Management Platform, for interconnected the
Interface performance testing between one Business Management Platform and the second Business Management Platform, wherein the first Business Management Platform conduct
Server is to provide the equipment of the service of calculating, i.e., server needs to respond service request, and is handled, and therefore, server is answered
Have the service of undertaking and ensures the ability of service.Second Business Management Platform is client, corresponding with server, for
Family provides the program of local service, is typically mounted in terminal, needs operation of working in coordination with server-side.Client includes but not
It is limited to intelligent terminal or terminal.
The interface Behavior modeling test method of the Business Management Platform of the present embodiment carries out interface behavior using simulation tool
Test, simulation tool use more typical soapui.Simulation tool can directly analog service management platform interface connection first
Business Management Platform, and shield other systems (such as router to network management system, network management system to the first Business Management Platform)
Interface message.For example, as shown in Figure 1, platform 1 is regard as the first Business Management Platform (server), by platform 2 as the second industry
Business management platform (client) needs to shield the network management platform being connected with platform 1 when carrying out simulation test.Due to
Using the Web Service interface based on restful;Simulation tool need to only input the URL and message format for sending address, so that it may
Easily to start to carry out the interface performance testing of message.
Also, the method that simulation tool analog service manages the interface message of platform obtains in the case where being utilized in registration
Replying message for the message on the first Business Management Platform and the first Business Management Platform is taken, and the encryption interface of both sides is carried out
Parametrization is write, the message encryption rule defined completely using both sides.
Further, the interface Behavior modeling test method of the Business Management Platform of the present embodiment is carried out using simulation tool
Interface performance testing, by the way of remembeing encrypted authentication code (TOKEN) in simulation tool, guarantee that TOKEN can be from conduct
After first Business Management Platform end of server is sent to client (i.e. the second Business Management Platform), is remembered and given birth to by client
Server-side is returned message at different with transmitting.The present invention is also while support is infused according to different application scenarios such as mobile phone user
The process that advertisement is seen after volume, carries out the verifying for simulating the large capacity of the concurrent linked server of multiple mobile phones.
As shown in figure 3, the interface Behavior modeling test method of the Business Management Platform of the present embodiment includes:
Step S10 configures IP address and the port of the first Business Management Platform.
IP address and the port of the first Business Management Platform as server are confirmed, to facilitate the hair of subsequent message
It send.
Step S20, by sending the first Business Management Platform of requests verification code message authentication and the second Business Management Platform,
Obtain identifying code message:
Message sending/receiving module simulates the requests verification code message of the second Business Management Platform, and according to the first business pipe
The IP address of platform and port are sent;
First Business Management Platform receives requests verification code message, and identifying code message is returned;
Message sending/receiving module receives identifying code message, and is saved to identifying code message.
Step S30, parsing identifying code message obtain identifying code, bind first business by sending bind-request message
Manage platform and the second Business Management Platform:
Message dissection process module parses identifying code message, obtains identifying code, and save as test variable.
Message sending/receiving module simulates the bind-request message of the second Business Management Platform, and flat to the first service management
Platform is sent;
First Business Management Platform receives bind-request message, and by processing, binding message is returned;
Message sending/receiving module receives binding message, binds the first Business Management Platform and the second service management is flat
Platform.
Step S40 utilizes Script controlling message sending/receiving module and message dissection process module simulation the second business pipe
Message when platform is in abnormal scene (such as multiple messages concurrent etc.) sends situation, and receives and check the first business
Management platform replies message:
The simulation that abnormal scene is carried out by script is the prior art, is repeated no more here.Also, in the present embodiment
In, script can constantly be extended according to the actual situation.
When the message for simulating abnormal scene is sent, message dissection process module needs to test message when message generates
Card code is handled;And it is further desired that being carried out filling in operation according to the sequence number taking-up value of message, then identifying code is disappeared with other
Breath merges, and is sent finally by message sending/receiving module.
Further, message dissection process module can also define some customized user-variables, example in message body
Such as: the equipment Serial Number of router, MAC Address, commercial user's name etc..Furthermore, it is possible to first the structure of message body is defined,
As user name inputs parameter as message;Global variable of the identifying code as entire test case, carries out between different messages
Transmission.
When the simulation message of the present embodiment is sent, using message processing module automatically generate different equipment Serial Number and
Then user name issues cloud by message sending/receiving module and spreads system;And it receives to reply using message sending/receiving module and disappear
Breath.The message for writing function by assert discriminant function when being in abnormal scene to check sends situation and the first service management
Platform replies message.
The step of above method, divides, and is intended merely to describe clear, and when realization can be merged into a step or to certain
A little steps are split, and multiple steps are decomposed into, as long as comprising identical logical relation, within the protection scope of the present patent;
To adding inessential modification in algorithm or in process or introducing inessential design, but its algorithm and stream are not changed
The core design of journey is all in the protection scope of the patent.
Also, the present embodiment is embodiment of the method corresponding to those in the first embodiment, and the present embodiment can be with first embodiment
It works in coordination implementation.The relevant technical details mentioned in first embodiment are still effective in the present embodiment, in order to reduce repetition,
Which is not described herein again.Correspondingly, the relevant technical details mentioned in the present embodiment are also applicable in first embodiment.
In conclusion the interface Behavior modeling test macro and method of a kind of Business Management Platform of the invention, Ke Yigen
The customized change message format of packet capturing is carried out on the first Business Management Platform and the second Business Management Platform according to practical application, spirit
It is living convenient, the application simulation environment of complete set can be built, the transmitting and parsing of multiple message between different systems are simulated;Phase
Compared with such as loadrunner, the recording and simulation of the common simulation tool of selenium or QTP etc. biased toward to user interface,
More complicated art of programming is needed to the support of Message Simulation, the present invention can be very good due to open source using java language
Different modules is write with Groovy language, it may be convenient to which the message of customized each not homologous ray simulated, message solution
Analysis and transmission and secondary development.Also, the certification message between the method simulation different communication operation system of present invention simplicity,
And sending and receiving for multiple and different message can be very easily supported by way of parametrization, it in this way can be very convenient
The each communication service system of progress between and independent communication service system performance indicator verifying and simulated pressure survey
Examination.So the present invention effectively overcomes various shortcoming in the prior art and has high industrial utilization value.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all without departing from the spirit and scope of the present invention, carries out modifications and changes to above-described embodiment.Cause
This, institute is complete without departing from the spirit and technical ideas disclosed in the present invention by those of ordinary skill in the art such as
At all equivalent modifications or change, should be covered by the claims of the present invention.