CN108733560A - A kind of test method and device - Google Patents
A kind of test method and device Download PDFInfo
- Publication number
- CN108733560A CN108733560A CN201810354441.XA CN201810354441A CN108733560A CN 108733560 A CN108733560 A CN 108733560A CN 201810354441 A CN201810354441 A CN 201810354441A CN 108733560 A CN108733560 A CN 108733560A
- Authority
- CN
- China
- Prior art keywords
- test
- test post
- receiving
- post
- module
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of test method and devices, are related to field of computer technology.One specific implementation mode of this method includes:Transmitting terminal delivers test post by test object to receiving terminal, and the test post received is marked in receiving terminal;All test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, asynchronously determine whether the test post that transmitting terminal is sent out delivers success according to the label;Statistics transmitting terminal sends out all test posts for delivering successful test post/delivery failure, to obtain the message dilivery success rate performance indicator of test object.The embodiment test index can easily be accommodated and send out pressure it is efficient.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of test method and devices.
Background technology
In software test field, pressure test (performance test) is a kind of negative using automation tools simulation multiple systems
Method of the carrier strip part to be tested system property indices.For the pressure test object that multiterminal are collaborative, in pressure
We need whether the message that attention location system side is sent out, the other side are normally received when test, and whether message has loss, delay to be
It is no normal.
In realizing process of the present invention, inventor has found that at least there are the following problems in the prior art:Traditional pressure is surveyed
Method for testing needs originator to synchronize verification to request after originator sends out request to receiving end, using this kind of pressure test mode,
Test index is not easy to adjust, and it is less efficient to send out pressure.
Pressure test object by taking instant messaging IM systems as an example, the pressure tests of IM systems need to pay close attention to simultaneously session amount and
The two test indexs of size of message, session are the combinations of certain amount message, and a piece of news of a logical session is for establishing meeting
Words, often a piece of news is longer in server-side calling path, and therefore, in conjunction with session amount and size of message, the two indexs can have
The performance for reflecting IM systems of effect.It can not be simultaneously according to predetermined ratio using traditional pressure test mode for IM systems
The session amount and size of message for adjusting test, when adjusting size of message reaches expected, session amount may have been exceed upper limit value, or
Person's session amount, which may reach far away, is expected.
Also, when request amount reaches certain rank, relatively slow request can tie down the whole hair pressure efficiency of test, cause
Originator can not send out expected pressure, can not really be pressed onto the upper limit of system.
Therefore, it can easily be accommodated and send out there is an urgent need for a kind of test index and press efficient test method and device.
Invention content
In view of this, a kind of test method of offer of the embodiment of the present invention and device, test index can easily be accommodated and send out pressure effect
Rate is high.
To achieve the above object, one side according to the ... of the embodiment of the present invention provides a kind of test method, including:
Transmitting terminal delivers test post by test object to receiving terminal, and receiving terminal is to the test post that receives into rower
Note;
All test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, asynchronously according to
Label determines whether the test post that transmitting terminal is sent out delivers success;
Statistics transmitting terminal sends out all test posts for delivering successful test post/delivery failure, to obtain test pair
The message dilivery success rate performance indicator of elephant.
Test method provided in an embodiment of the present invention further includes:
Transmitting terminal generates the originator label information of test post, and the originator label information of the test post is recorded in guarantor
In storing module;
The receiving terminal to the test post received be marked including:
Receiving terminal generates the receiving end label information of test post, and receiving end label information is remembered after receiving test post
Record is in the preserving module;
Whether the test post sent out according to the determining transmitting terminal of the label, which is delivered, includes successfully:
All originator label informations recorded in the preserving module are traversed, determines to mark without corresponding receiving end and believe
Test post associated by the originator label information of breath delivers failure.
Optionally, the originator label information is that the sending time of the test post is stabbed, and the receiving end label information is
The receiving time of the test post is stabbed;
Whether the test post sent out according to the determining transmitting terminal of the label, which is delivered, further includes successfully:
The delivery duration that test post is calculated according to sending time stamp and receiving time stamp, if the delivery duration of test post
More than preset overtime duration, it is determined that test post delivers failure, otherwise determines that test post is delivered successfully.
Test method provided in an embodiment of the present invention further includes:
The delivery duration for all test posts that statistics receiving terminal receives, to obtain the message dilivery duration of test object
It can index.
Further, the message content of the test post includes:Originator label information;
The originator label information of the test post is recorded in the step in preserving module, is by the message of the test post
Content saves as the data of specified data type in the preserving module;
Receiving terminal parses the test post after receiving the test post, to obtain the message content of the test post;
The receiving end label information of the test post, which is recorded in the preserving module, includes:
The data of the corresponding specified data type are searched in the preserving module according to the message content, and will
Receiving end label information is stored in the data.
Optionally, the specified data type is hash data types;
The message content by test post saves as the data packet of specified data type in the preserving module
It includes:
The key that the characteristic information of session where test post is saved as to the data, the message content is saved as
The field of the data uses as default the value of the data;
The data for searching the corresponding specified data type in the preserving module according to message content, and will
Receiving end label information is stored in the data:
Using the characteristic information of session where the test post as key, using the message content as field, to look into
Data are looked for, and the value of the data found is set as receiving end label information.
Test method provided in an embodiment of the present invention further includes:
Start timing after sending out all test posts in transmitting terminal, when timing reaches default overtime duration, determination connects
Receiving end no longer receives test post.
To achieve the above object, other side according to the ... of the embodiment of the present invention additionally provides a kind of test device, packet
It includes:Sending module, receiving module and authentication module;
Sending module delivers test post by test object to receiving module, receiving module to the test post that receives into
Line flag;
Authentication module is for sending out all test posts in sending module, and receiving module no longer receives test post
Afterwards, asynchronously determine whether the test post that sending module is sent out delivers success according to the label;And statistics transmitting terminal hair
Go out all test posts for delivering successful test post/delivery failure, it is forthright with the message dilivery success for obtaining test object
It can index.
Further, sending module is further used for generating the originator label information of test post, and by the test post
Originator label information be recorded in preserving module;
Receiving module is further used for after receiving test post, generates the receiving end label information of test post, and will receive
End label information is recorded in the preserving module;
Authentication module is further used for traversing all originator label informations recorded in the preserving module, and determination does not have wherein
There is the test post associated by the originator label information of corresponding receiving end label information to deliver failure.
Optionally, the originator label information is that the sending time of the test post is stabbed, and the receiving end label information is
The receiving time of the test post is stabbed;
Authentication module is further used for calculating the delivery duration of test post according to sending time stamp and receiving time stamp, if
The delivery duration of test post is more than preset overtime duration, it is determined that test post delivers failure, otherwise determines test post
It delivers successfully;
Authentication module is further used for counting the delivery duration for all test posts that receiving terminal receives, to obtain test pair
The message dilivery duration performance indicator of elephant.
Further, the message content of the test post includes:Originator label information;
Sending module is further used for, by the message content of test post, specified data being saved as in the preserving module
The data of type;
Receiving module is further used for after receiving the test post, parses the test post, to obtain the test post
Message content;
The data of the corresponding specified data type are searched in the preserving module according to the message content, and will
Receiving end label information is stored in the data.
Optionally, the specified data type is hash data types;
Sending module is further used for saving as the characteristic information of session where test post into the key of the data, will
The message content saves as the field of the data, and the value of the data is used as default;
Authentication module is further used for using the characteristic information of session where the test post as key, by the message
Content is as field, with searching data, and the value of the data found is set as receiving end label information.
Further, authentication module is further used for starting timing after sending out all test posts in sending module, when
When timing reaches default overtime duration, determine that receiving module no longer receives test post.
To achieve the above object, other side according to the ... of the embodiment of the present invention additionally provides a kind of test electronic equipment,
Including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processing
Device realizes test method provided in an embodiment of the present invention.
To achieve the above object, other side according to the ... of the embodiment of the present invention additionally provides a kind of computer-readable Jie
Matter is stored thereon with computer program, which is characterized in that realizes that the embodiment of the present invention provides when described program is executed by processor
Test method.
In being different from the prior art, whether the message that message sending end needs synchronous verification to send out delivers success, the present invention
After method sends out all test posts in transmitting terminal, and receiving terminal no longer receives test post, the survey that transmitting terminal is sent out is determined
Message is tried, whether is properly received in receiving terminal, so that it is determined that whether test object is by message successful delivery.I.e. for test post
It is asynchronous progress, the transmission of a test post that successful determination process, which whether is delivered, relative to the transmission process of test post
No longer need to wait for the receive process of test post thereon and whether the verification process of successful delivery, therefore, test index is easy
It in adjusting, is debugged without taking a significant amount of time, test process is easily operated, and sends out and press efficient, flexibility height, easy
Reach the upper pressure limit of test.
And transmitting terminal of the present invention generates the originator label information of test post, and the originator of the test post is marked and is believed
Breath is recorded in preserving module, and receiving terminal generates the receiving end label information of test post after receiving test post, and by receiving end
Label information is recorded in the preserving module, and originator label information and receiving end label information can be determined according to testing requirement
System, to count to obtain a variety of related performance indicators of test object by the method for the invention.
When originator label information stabs for sending time, and receiving end label information is that receiving time is stabbed, by the method for the invention
It can count to obtain the message dilivery duration performance indicator of test object, such as message dilivery supermarket leads index.
Further effect possessed by above-mentioned non-usual optional mode adds hereinafter in conjunction with specific implementation mode
With explanation.
Description of the drawings
Attached drawing does not constitute inappropriate limitation of the present invention for more fully understanding the present invention.Wherein:
Fig. 1 is the schematic diagram for the main flow that the embodiment of the present invention provides test method;
Fig. 2 is the schematic diagram for the application flow that the embodiment of the present invention provides test method;
Fig. 3 is the schematic diagram of the main modular of square law device provided in an embodiment of the present invention;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural schematic diagram of the computer system of the electronic equipment for realizing the embodiment of the present invention.
Specific implementation mode
It explains to the exemplary embodiment of the present invention below in conjunction with attached drawing, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
It arrives, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
The description to known function and structure is omitted for clarity and conciseness in sample in following description.
The embodiment of the present invention provides a kind of test method, can be applied in the collaborative pressure test scene of multiterminal,
The normal delivery of a piece of news is considered as an affairs in the scene, and this affairs is related to message sending end and message sink
End, only message sink, which are rectified, often has received message, and whether affairs just can consider successfully, normal by paying close attention to message sink end
Receive whether test post, test post have loss and delay whether normal, to obtain the test for being responsible for delivering test post
The performance indicator of object, to embody the message dilivery performance of test object.
Test method provided in an embodiment of the present invention, as shown in Figure 1, this method includes:Step S101, step S102 and step
Rapid S103.
In step S101, transmitting terminal sends a certain number of test posts, receiving terminal by test object to receiving terminal
To in a certain number of test posts, the test post that receiving terminal receives is marked, i.e., the test that receiving terminal does not receive
Message does not mark then.
In step s 102, all test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, it is different
Step ground determines whether the test post that transmitting terminal is sent out delivers success according to label, i.e., the test post of correspondence markings is not to connect
The test post that receiving end does not receive, message dilivery failure.
In step s 103, statistics transmitting terminal sends out all test posts for delivering successful test post/delivery failure,
To obtain the message dilivery success rate performance indicator of test object.I.e. statistics delivers successful test post or delivers the survey of failure
Message ratio shared in all test posts sent out is tried, the message dilivery success rate index or message of test object are obtained
Loss Rate index.
In being different from the prior art, whether the message that message sending end needs synchronous verification to send out delivers success, the present invention
After method sends out all test posts in transmitting terminal, and receiving terminal no longer receives test post, the survey that transmitting terminal is sent out is determined
Message is tried, whether is properly received in receiving terminal, so that it is determined that whether test object is by message successful delivery.I.e. for test post
It is asynchronous progress, the transmission of a test post that successful determination process, which whether is delivered, relative to the transmission process of test post
No longer need to wait for the receive process of test post thereon and whether the verification process of successful delivery, therefore, test index is easy
It in adjusting, is debugged without taking a significant amount of time, test process is easily operated, and sends out and press efficient, flexibility height, easy
Reach the upper pressure limit of test.
Whether the present invention is provided in test method, for a certain number of test posts by the deterministic process of successful delivery
It all delivers in a certain number of message and executes after the completion.Due to the test post that transmitting terminal is sent out, there are information drop-outs
With the situation of message dilivery time-out, therefore it can not accurately determine that receiving terminal has received all test posts that can be received
Time.In this regard, present invention proposition starts timing after sending out all test posts in transmitting terminal, when timing reaches default time-out
When long, determine that receiving terminal no longer receives test post, that is to say, that counted since being sent out after the last item test post transmitting terminal
When, if receiving terminal receives the message before timing terminates, which is denoted as and is received, is marked.At the end of timing, connect
Receiving end no longer receives test post, if receiving terminal receives test post after timing, which is denoted as and is not received.
In a kind of embodiment of invention, test method provided by the invention further includes following step:Transmitting terminal generates
The originator label information of test post, and the originator label information of the test post is recorded in preserving module.
Opposite, in step S101, the process that the test post received is marked in receiving terminal is specially:Receiving terminal
After receiving test post, the receiving end label information of test post is generated, and receiving end label information is recorded in preserving module,
All test posts sent out for transmitting terminal, if receiving terminal has received the test post, preserving module record has this
The originator label information and receiving end label information of message, if receiving terminal does not receive the test post, preserving module is only remembered
Record has the originator label information of the message.
In step s 102, whether the test post sent out according to the determining transmitting terminal of label, which delivers successful process, is:Time
All originator label informations recorded in preserving module are gone through, determine that the originator without corresponding receiving end label information marks letter
The associated test post of breath delivers failure, and an even test post only has originator label information in preserving module, then really
Determine test object and is not delivered to message sink end successfully.
In embodiments of the present invention, intermediate storage end is used as to originator label information and receiving end label letter by preserving module
Breath is stored, and preserving module can be database, such as redis databases, can also use other data storage methods, such as
Installed System Memory, MQ (message queue) or local/remote file.In the present invention, preserving module has of overall importance, transmitting terminal
Can access with receiving terminal, disclosure satisfy that the storage performance of pressure test (magnanimity message), and be adapted to transmitting terminal and
The distributed deployment of receiving terminal.
In a kind of embodiment of invention, originator label information is that the sending time of test post is stabbed, receiving end label letter
Breath is that the receiving time of test post is stabbed.I.e. in a storage module, when same message just has sending time with receiving simultaneously
Between stab.In step s 102, whether the test post sent out according to the determining transmitting terminal of label delivers successful process can be specific
It is divided into the judgement of two steps:First, it is determined that whether any test post has receiving time stamp, if not having, you can determine receiving terminal
The test post, message dilivery failure are not received.If the test post is stabbed with receiving time, then executes following determined
Journey calculates the delivery duration of test post according to sending time stamp and receiving time stamp, judges that the delivery duration of test post is
It is no to be more than preset overtime duration, if the delivery duration of test post is more than preset overtime duration, it is determined that test post is thrown
It passs unsuccessfully, otherwise determines that test post is delivered successfully.That is, in actual application scenarios, although receiving terminal has received
Test post, but in the case that time of delivery of the message between transmitting terminal to receiving terminal is more than certain time length, be also determined as
Message dilivery fails.By counting the delivery duration for all test posts that receiving terminal receives, disappearing for test object can be obtained
Breath delivers duration performance indicator, such as the supermarket of message dilivery leads, and message dilivery TP999 (ensures that 99% request can be responded
Minimum take) etc. indexs.
In a kind of embodiment of invention, the message content of test post includes:Originator label information, i.e. transmitting terminal will
Test post with originator label information is sent to receiving terminal.And then in receiving terminal after receiving the test post, parsing should
Test post, then by the message content of the test post, is protected with obtaining the message content of the test post in preserving module
Save as the data of specified data type.For example, the data of specified data type can be the data of key-value pair type, wherein key
For message content (including originator label information), value is configurable to default value.
Opposite, it is specially in the step of receiving end label information of the test post is recorded in preserving module:According to disappearing
Breath content searches the data of corresponding specified data type in preserving module, and receiving end label information is stored in the data
In.Ibid example can search the data of corresponding key-value pair type according to message content (key) in preserving module, then, will
The value of the data is changed to receiving end label information by default value, to be hair in preserving module for the message that receiving terminal receives
The key-value pair for holding label information and receiving end label information is originator in preserving module for the message that receiving terminal does not receive
The key-value pair of label information and default value.To in subsequent steps, you can directly judge whether receiving terminal receives this
Whether the delivery duration of message and message is more than preset overtime duration.
Test method provided in an embodiment of the present invention is further described with reference to a concrete application scene, at this
In application scenarios, as shown in Fig. 2, pressure test object is IM (instant messaging) server of the system, in IM systems, including customer
(transmitting terminal of message) and two kinds of roles of customer service (receiving terminal of message).Transmitting terminal and receiving terminal are distributed deployments, are sent
Session established to receiving terminal by sending out pressure tool, deliver message in end.The message dilivery that server-side IM systems send out transmitting terminal is extremely
Receiving terminal, IM systems are then responsible for the work such as customer service distribution, session management, message forwarding.Receiving terminal function is realized by Java, is connect
Receiving end monitors transmission control protocol TCP, and beams back and hold to server-side after receiving message.In pressure test, we need to pay close attention to
Whether the message that side is sent out, the other side are normally received, and whether message have loss, delay normal.
The pressure test of IM systems needs while paying close attention to session amount and the two test indexs of size of message, and session is a fixed number
The combination of message is measured, a piece of news of a logical session is for establishing session, and often a piece of news calls path in server-side
It is longer, therefore, the performance of IM systems can be effectively reflected in conjunction with session amount and size of message the two indexs.
In this application scene, preserving module is configured with redis databases, and specified data type is redis databases
Hash data types.
Before every wheel pressure test starts, can delete it is data cached in all redis databases, to avoid upper one
The interference of wheel load measured data.After pressure test starts, transmitting terminal before the message, generates sending time and stabs information, sending out
In the message content sent, addition sending time stabs information.Transmitting terminal is after sending out message, in the redis databases of preserving module
Middle write-in message then proceedes to send subsequent request, test method compared with the existing technology, it is no longer necessary to synchronous verification message
Whether normally deliver.
Message is preserved in redis databases to be specifically as follows:The characteristic information of session where test post is saved as
Message content is saved as the field of data by the key of data, and the value of data is used as default.In this application scene
In, the characteristic information of session can be selected as the user account of transmitting terminal, and each user account can correspond to a session, Mei Gehui
Words can correspond to multiple message.
For example, for user account:Key, that is, imloadtest_01 of imloadtest_01, hash data.In message
Additional message sending time stamp is in appearance:SDK_uuid_14702434394739.It is current key after message is sent:
Imloadtest_01 increases an attribute, and attribute-name field is message content:SDK_uuid_14702434394739 belongs to
Property value value 1, the redis orders that use as default are:
hset imloadtest_01SDK_uuid_14702434394739 1
After receiving terminal receives above-mentioned message, parse the message content of the message, obtain currently receive the message when
Between stab Tr, redis then is written into time stamp T r, i.e., message content will be corresponded in the same key (user account):SDK_
The attribute value value updated value of uuid_14702434394739 is Tr, and redis orders are:
hsetnx imloadtest_01SDK_uuid_14702434394739Tr
All test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, the redis of memory module
In database, that is, all message for all user accounts that transmitting terminal is sent out are stored, statistics end can be scanned it system
Meter.By traversing all user accounts, so that it may to find the transmitting-receiving time of all message, if the attribute of certain data is corresponding
Value is 1, then illustrates that receiving terminal does not receive corresponding message, that is, information drop-out.For the message that do not lose, disappeared by parsing
The timestamp ceased in content is stabbed with destination time, so that it may to obtain message dilivery duration.All message are counted, then can be obtained
When secondary pressure surveys related performance indicators, such as message loss rate, overtime rate, message dilivery TP999 (ensure that 99% request can be rung
The minimum answered takes) etc. indexs.
By application of the test method of aforementioned present invention in IM system pressure test scenes, by being offseted at statistics end
It ceases and is verified into line asynchronous, message and the number of transactions per second of session (Transaction Per Second, TPS) can be made to reach simultaneously
The desired value arrived, without carrying out additional debugging.In addition, when request amount reaches certain rank, it will not be because of in an affairs
The originator efficiency of slow entirety is dragged in slow request, causes originator that can not send out expected pressure.
The embodiment of the present invention also provides a kind of test device, as shown in figure 3, the device 300 includes:It is deployed in transmitting terminal
Sending module 301, the receiving module 302 and authentication module 303 for being deployed in receiving terminal.
Sending module 301 sends test post by test object to receiving module 302, and receiving module 302 is to receiving
Test post is marked.
Authentication module 303 is for sending out all test posts in sending module 301, and receiving module 302 no longer receives
After test post, asynchronously determine whether the test post that sending module 301 is sent out delivers success, and statistics hair according to label
Sending end 301 sends out all test posts for delivering successful test post/delivery failure, to obtain the message dilivery of test object
Success rate performance indicator.
In the present invention, sending module is further used for generating the originator label information of test post, and the test is disappeared
The originator label information of breath is recorded in preserving module,
Receiving module is further used for after receiving test post, generates the receiving end label information of test post, and will receive
End label information is recorded in preserving module,
Authentication module is further used for traversing all originator label informations recorded in preserving module, determines without right
Test post associated by the originator label information for the receiving end label information answered delivers failure.
In the present invention, originator label information is that the sending time of test post is stabbed, and receiving end label information is test post
Receiving time stamp.
Authentication module is further used for calculating the delivery duration of test post according to sending time stamp and receiving time stamp, if
The delivery duration of test post is more than preset overtime duration, it is determined that test post delivers failure, otherwise determines test post
It delivers successfully.
Authentication module is further used for counting the delivery duration for all test posts that receiving terminal receives, to obtain test pair
The message dilivery duration performance indicator of elephant.
In the present invention, the message content of test post includes:Originator label information.
Sending module is further used for, by the message content of test post, specified data type being saved as in preserving module
Data.
Receiving module is further used for after receiving the test post, parses the test post, to obtain the test post
Message content.
Search the data of corresponding specified data type in preserving module according to message content, and by receiving end label information
It is stored in the data.
In the present invention, preserving module is configured with redis databases, and specified data type is hash data types.
Sending module is further used for saving as the characteristic information of session where test post into the key of data, by message
Content saves as the field of data, and the value of data is used as default.
Authentication module is further used for using the characteristic information of session where test post as key, using message content as
The value of the data found with searching data, and is set as receiving end label information by field.
In the present invention, authentication module is further used for starting timing after sending out all test posts in sending module,
When timing reaches default overtime duration, determine that receiving module no longer receives test post.
In being different from the prior art, whether the message that message sending end needs synchronous verification to send out delivers success, the present invention
After the test method and device of offer send out all test posts in transmitting terminal, and receiving terminal no longer receives test post, really
Determine the test post that transmitting terminal is sent out, whether be properly received in receiving terminal, so that it is determined that whether test object successfully throws message
It passs.It is asynchronous progress for whether test post delivers successful determination process relative to the transmission process of test post,
The transmission of one test post no longer need to wait for the receive process of test post thereon and whether successful delivery it is authenticated
Journey, therefore, test index can easily be accommodated, and be debugged without taking a significant amount of time, and test process is easily operated, and send out pressure effect
Rate is high, and flexibility is high, is easy to reach the upper pressure limit of test.
And transmitting terminal provided by the invention generates the originator label information of test post, and by the originator of the test post
Label information is recorded in preserving module, and receiving terminal generates the receiving end label information of test post after receiving test post, and
Receiving end label information is recorded in the preserving module, originator label information and receiving end label information can be according to testing requirements
It is customized, to count to obtain a variety of related performance indicators of test object by the method for the invention.
When originator label information stabs for sending time, and receiving end label information is that receiving time is stabbed, by the method for the invention
It can count to obtain the message dilivery duration performance indicator of test object, such as message dilivery supermarket leads index.
Fig. 4, which is shown, can apply the test method of the embodiment of the present invention or the exemplary system architecture 400 of test device.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405.
Network 404 between terminal device 401,402,403 and server 405 provide communication link medium.Network 404 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be interacted by network 404 with server 405 with using terminal equipment 401,402,403, to receive or send out
Send message etc..Various telecommunication customer end applications can be installed on terminal device 401,402,403, for example, to server 405 into
The application of row pressure test.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet
Include but be not limited to smart mobile phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as provide IM (instant messaging) the backstage pipes serviced
Manage server.
It should be understood that the number of the terminal device, network and server in Fig. 4 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 5, it illustrates the computer systems 500 suitable for the terminal device for realizing the embodiment of the present invention
Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, to the function of the embodiment of the present invention and should not use model
Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various actions appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
It is connected to I/O interfaces 505 with lower component:Importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also according to needing to be connected to I/O interfaces 505.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on driver 510, as needed in order to be read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, it according to embodiment disclosed by the invention, may be implemented as counting above with reference to the process of flow chart description
Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer
Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.?
In such embodiment, which can be downloaded and installed by communications portion 509 from network, and/or from can
Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed
The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two arbitrarily combines.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or arbitrary above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more conducting wires, just
It takes formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, can be any include computer readable storage medium or storage journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this
In invention, computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated,
Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By instruction execution system, device either device use or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned
Any appropriate combination.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part for a part for one module, program segment, or code of table, above-mentioned module, program segment, or code includes one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part is realized.Described module can also be arranged in the processor, for example, can be described as:A kind of processor packet
Include sending module, receiving module, authentication module.Wherein, the title of these modules is not constituted under certain conditions to the module
The restriction of itself, for example, sending module is also described as " the originator label information of test post being recorded in preserving module
In module ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which can be
Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes
Obtaining the equipment includes:
Transmitting terminal delivers test post by test object to receiving terminal, and receiving terminal is to the test post that receives into rower
Note;
All test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, asynchronously according to
Label determines whether the test post that transmitting terminal is sent out delivers success;
Statistics transmitting terminal sends out all test posts for delivering successful test post/delivery failure, to obtain test pair
The message dilivery success rate performance indicator of elephant.
Above-mentioned specific implementation mode, does not constitute limiting the scope of the invention.Those skilled in the art should be bright
It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and replacement can occur.It is any
Modifications, equivalent substitutions and improvements made by within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.
Claims (14)
1. a kind of test method, which is characterized in that including:
Transmitting terminal delivers test post by test object to receiving terminal, and the test post received is marked in receiving terminal;
All test posts are sent out in transmitting terminal, and after receiving terminal no longer receives test post, asynchronously according to the label
Determine whether the test post that transmitting terminal is sent out delivers success;
Statistics transmitting terminal sends out all test posts for delivering successful test post/delivery failure, to obtain test object
Message dilivery success rate performance indicator.
2. according to the method described in claim 1, it is characterized in that, further including:
Transmitting terminal generates the originator label information of test post, and the originator label information of the test post is recorded in preservation mould
In block;
The receiving terminal to the test post received be marked including:
Receiving terminal generates the receiving end label information of test post, and receiving end label information is recorded in after receiving test post
In the preserving module;
Whether the test post sent out according to the determining transmitting terminal of the label, which is delivered, includes successfully:
All originator label informations recorded in the preserving module are traversed, are determined without corresponding receiving end label information
The test post started associated by label information delivers failure.
3. according to the method described in claim 2, it is characterized in that, the originator label information is the transmission of the test post
Timestamp, the receiving end label information are that the receiving time of the test post is stabbed;
Whether the test post sent out according to the determining transmitting terminal of the label, which is delivered, further includes successfully:
The delivery duration that test post is calculated according to sending time stamp and receiving time stamp, if the delivery duration of test post is more than
Preset time-out duration, it is determined that test post delivers failure, otherwise determines that test post is delivered successfully;
The method further includes:
The delivery duration for all test posts that statistics receiving terminal receives, the message dilivery duration performance to obtain test object refer to
Mark.
4. according to the method described in claim 2, it is characterized in that, the message content of the test post includes:Originator label
Information;
The originator label information of the test post is recorded in the step in preserving module, is in the message by the test post
Hold, the data of specified data type are saved as in the preserving module;
Receiving terminal parses the test post after receiving the test post, to obtain the message content of the test post;
The receiving end label information of the test post, which is recorded in the preserving module, includes:
Search the data of the corresponding specified data type in the preserving module according to the message content, and by receiving end
Label information is stored in the data.
5. according to the method described in claim 4, it is characterized in that, the specified data type is hash data types;
The message content by test post, the data that specified data type is saved as in the preserving module include:
The key that the characteristic information of session where the test post is saved as to the data, the message content is saved as
The field of the data uses as default the value of the data;
The data for searching the corresponding specified data type in the preserving module according to message content, and by receiving end
Label information is stored in the data:
Using the characteristic information of session where the test post as key, using the message content as field, to search number
According to, and the value of the data found is set as receiving end label information.
6. according to the method described in claim 1, it is characterized in that, further including:
Start timing after sending out all test posts in transmitting terminal, when timing reaches default overtime duration, determines receiving terminal
No longer receive test post.
7. a kind of test device, which is characterized in that including:Sending module, receiving module and authentication module;
Sending module delivers test post by test object to receiving module, and receiving module is to the test post that receives into rower
Note;
It is different after authentication module is used to send out all test posts in sending module, and receiving module no longer receives test post
Step ground determines whether the test post that sending module is sent out delivers success according to the label;And statistics transmitting terminal send out it is all
The test post for delivering successful test post/delivery failure, to obtain the message dilivery success rate performance indicator of test object.
8. device according to claim 7, which is characterized in that
Sending module is further used for generating the originator label information of test post, and by the originator label information of the test post
It is recorded in preserving module;
Receiving module is further used for after receiving test post, generates the receiving end label information of test post, and by receiving end mark
Note information is recorded in the preserving module;
Authentication module is further used for traversing all originator label informations recorded in the preserving module, determines without right
Test post associated by the originator label information for the receiving end label information answered delivers failure.
9. device according to claim 8, which is characterized in that the originator label information is the transmission of the test post
Timestamp, the receiving end label information are that the receiving time of the test post is stabbed;
Authentication module is further used for calculating the delivery duration of test post according to sending time stamp and receiving time stamp, if test
The delivery duration of message is more than preset overtime duration, it is determined that test post delivers failure, otherwise determines that test post is delivered
Success;
Authentication module is further used for counting the delivery duration for all test posts that receiving terminal receives, to obtain test object
Message dilivery duration performance indicator.
10. device according to claim 8, which is characterized in that the message content of the test post includes:Originator label
Information;
Sending module is further used for, by the message content of test post, specified data type being saved as in the preserving module
Data;
Receiving module is further used for after receiving the test post, parses the test post, to obtain disappearing for the test post
Cease content;
Search the data of the corresponding specified data type in the preserving module according to the message content, and by receiving end
Label information is stored in the data.
11. device according to claim 10, which is characterized in that the specified data type is hash data types;
Sending module is further used for saving as the characteristic information of session where the test post into the key of the data, will
The message content saves as the field of the data, and the value of the data is used as default;
Authentication module is further used for using the characteristic information of session where the test post as key, by the message content
As field, with searching data, and the value of the data found is set as receiving end label information.
12. device according to claim 7, which is characterized in that authentication module is further used for sending out institute in sending module
Start timing after some test posts, when timing reaches default overtime duration, determines that receiving module no longer receives test post.
13. a kind of test electronic equipment, which is characterized in that including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processors are real
The now method as described in any in claim 1-6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor
The method as described in any in claim 1-6 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810354441.XA CN108733560A (en) | 2018-04-19 | 2018-04-19 | A kind of test method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810354441.XA CN108733560A (en) | 2018-04-19 | 2018-04-19 | A kind of test method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108733560A true CN108733560A (en) | 2018-11-02 |
Family
ID=63939093
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810354441.XA Pending CN108733560A (en) | 2018-04-19 | 2018-04-19 | A kind of test method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108733560A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111459834A (en) * | 2020-04-15 | 2020-07-28 | 中国银行股份有限公司 | Asynchronous transaction performance testing method and device |
CN113676372A (en) * | 2021-08-06 | 2021-11-19 | 中国农业银行股份有限公司 | Communication performance testing method, device and storage medium |
CN113676372B (en) * | 2021-08-06 | 2024-06-07 | 中国农业银行股份有限公司 | Communication performance testing method, device and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1159113A (en) * | 1995-11-29 | 1997-09-10 | 美国电报电话公司 | Out-of-band control for preforming loopback lest for asynchronous transfer mode (ATM) networks |
US20130185056A1 (en) * | 2012-01-12 | 2013-07-18 | Accenture Global Services Limited | System for generating test scenarios and test conditions and expected results |
CN103888306A (en) * | 2012-12-19 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Message forwarding system performance test method and performance test device |
EP2797262A1 (en) * | 2013-04-26 | 2014-10-29 | Siemens Aktiengesellschaft | Test method and test apparatus for testing a distributed system |
US20150227431A1 (en) * | 2014-02-07 | 2015-08-13 | International Business Machines Corporation | Server Based Disaster Recovery by Making Use of Dual Write Responses |
CN105897549A (en) * | 2015-12-14 | 2016-08-24 | 乐视云计算有限公司 | Message sending and receiving methods and message sending and receiving devices |
CN107360295A (en) * | 2017-07-20 | 2017-11-17 | 京信通信系统(中国)有限公司 | A kind of test main frame and method |
-
2018
- 2018-04-19 CN CN201810354441.XA patent/CN108733560A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1159113A (en) * | 1995-11-29 | 1997-09-10 | 美国电报电话公司 | Out-of-band control for preforming loopback lest for asynchronous transfer mode (ATM) networks |
US20130185056A1 (en) * | 2012-01-12 | 2013-07-18 | Accenture Global Services Limited | System for generating test scenarios and test conditions and expected results |
CN103888306A (en) * | 2012-12-19 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Message forwarding system performance test method and performance test device |
EP2797262A1 (en) * | 2013-04-26 | 2014-10-29 | Siemens Aktiengesellschaft | Test method and test apparatus for testing a distributed system |
US20150227431A1 (en) * | 2014-02-07 | 2015-08-13 | International Business Machines Corporation | Server Based Disaster Recovery by Making Use of Dual Write Responses |
CN105897549A (en) * | 2015-12-14 | 2016-08-24 | 乐视云计算有限公司 | Message sending and receiving methods and message sending and receiving devices |
CN107360295A (en) * | 2017-07-20 | 2017-11-17 | 京信通信系统(中国)有限公司 | A kind of test main frame and method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111459834A (en) * | 2020-04-15 | 2020-07-28 | 中国银行股份有限公司 | Asynchronous transaction performance testing method and device |
CN111459834B (en) * | 2020-04-15 | 2023-08-22 | 中国银行股份有限公司 | Asynchronous transaction performance testing method and device |
CN113676372A (en) * | 2021-08-06 | 2021-11-19 | 中国农业银行股份有限公司 | Communication performance testing method, device and storage medium |
CN113676372B (en) * | 2021-08-06 | 2024-06-07 | 中国农业银行股份有限公司 | Communication performance testing method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109040326A (en) | The method and apparatus of PUSH message | |
CN105139506B (en) | Number obtaining method, device, server-side and system based on positioning mobile terminal | |
CN108897854A (en) | A kind of monitoring method and device of overtime task | |
CN109426593A (en) | The method and apparatus of automatic evaluation system performance | |
CN110262807A (en) | Cluster creates Progress Log acquisition system, method and apparatus | |
CN108874513A (en) | Handle method, system, electronic equipment and the computer-readable medium of timed task | |
CN110427304A (en) | O&M method, apparatus, electronic equipment and medium for banking system | |
CN110198248A (en) | The method and apparatus for detecting IP address | |
CN109873863A (en) | The asynchronous invoking method and device of service | |
CN110110196A (en) | A kind of information push method and device | |
CN110046178A (en) | The method and apparatus of distributed data inquiry | |
CN110377440A (en) | Information processing method and device | |
CN110019437A (en) | A kind of method and system exporting data | |
CN109005208A (en) | Method and apparatus for pushed information | |
CN109033312A (en) | Method and apparatus for obtaining information | |
CN109218041A (en) | Request processing method and device for server system | |
CN109976919A (en) | A kind of transmission method and device of message request | |
CN109656799A (en) | Test method and device | |
CN109144992A (en) | A kind of method and apparatus of data storage | |
CN110083501A (en) | Interface calls method of counting and device | |
CN108733560A (en) | A kind of test method and device | |
CN110324384A (en) | The method and apparatus of data-pushing | |
CN110071952A (en) | The control method and device of service call amount | |
CN109218125A (en) | A kind of method and system of heartbeat data interaction | |
CN109522202A (en) | A kind of method and apparatus of software test |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181102 |
|
RJ01 | Rejection of invention patent application after publication |