CN105975396A - Generating method and system for automated testing case - Google Patents
Generating method and system for automated testing case Download PDFInfo
- Publication number
- CN105975396A CN105975396A CN201610485727.2A CN201610485727A CN105975396A CN 105975396 A CN105975396 A CN 105975396A CN 201610485727 A CN201610485727 A CN 201610485727A CN 105975396 A CN105975396 A CN 105975396A
- Authority
- CN
- China
- Prior art keywords
- packet
- automatic test
- case
- data
- test cases
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to a generating method and system for an automated testing case as well as a testing method and system adopting the automated testing case. A data packet related to the testing case is automatically analyzed, and the automated testing case is generated according to an analyzed result, accordingly, rapid generation of the automated testing case is realized with the method; further, rapid testing and automated testing are realized through automatic execution of the automated testing case. According to the generating method and system, automatic grabbing and generation of the automated testing case, automatic maintenance of tested data and automatic execution of the automated testing case are realized, and the generating efficiency of the automated testing case and the testing efficiency are remarkably improved. The automated testing case can be shared between developers and testers, so that the testers can improve the testing efficiency and quality by referring to self-testing experience of the developers.
Description
Technical field
The present invention relates to software test field, be specifically related to a kind of automatic test cases generate method with
System.
Background technology
Generally, in software test procedure, tester test according to test case, right
In the test of software function, it is often necessary to use automatic test cases.Automatic test cases
Refer to rerun and need not manually participate in, and perform the test case of certain step.
At present, for software New function or improve function test time, automatic test cases
Have a disadvantage in that
(1) making of automatic test cases has hysteresis quality mostly:
Tester is generally after functional test completes, and redaction just carries out automatic test before issuing
The making of use-case, even just supplementing after redaction is issued of having makes automatic test cases, from
And cause automatic test cases be only used for the recurrence checking of version next time or monitor for outer net,
Can not use in the test of this version;Additionally, delayed making automatic test cases result in
Automatic test cases needs to reconfigure application scenarios when making, and wastes time and energy;
(2) automatic test cases is made by tester, and developer is very few to be participated in, thus causes
Automatic test cases is of low quality.
Summary of the invention
In order to solve above-mentioned technical problem, the present invention proposes automatic test cases and generates method and be
System and use the method for testing of automatic test cases and system, is resolved by automatization and uses with test
The packet that example is relevant, and achieve automatically according to the method for analysis result generation automatic test cases
Quickly generating of change test case, achieves quickly test with automatic by performing automatic test cases
Changing test, the automatic test cases that the present invention generates can enter between developer and tester
Row is shared, so that tester can use for reference the experience that developer tests oneself, and then promotes test
Efficiency and quality.
The present invention realizes with following technical scheme, and a kind of automatic test cases generates method, bag
Include:
Testing results use-case, it is thus achieved that data stream;
Choosing the packet relevant with test case in described data stream, described packet includes test
The packet asked and the response data packet corresponding to described test request;
Described packet is resolved;
Validity Test data are selected according to the result resolved,
According to described Validity Test data genaration automatic test cases.
Preferably, the packet produced during described acquisition testing results use-case includes:
Testing results use-case, it is thus achieved that data stream, described data stream packets is containing the packet of test request and right
The response data packet of test request described in Ying Yu;
The packet produced during capturing testing results use-case according to the first default filtercondition.
Preferably, also include:
Obtain the communications protocol storage address in the main frame of testing results use-case;
Storing address acquisition communications protocol according to described communications protocol, described communications protocol is for described
Packet resolves.
Preferably, the storage of the communications protocol in the main frame of described acquisition testing results use-case address includes:
Obtaining configuration information, described configuration information includes that the network parameter of log equipment sets with described networking
The standby corresponding relation between communications protocol storage address;
Obtain the IP address of described main frame;
According to described configuration information and described IP address, obtain the port for test in described main frame
Port numbers;
According to described configuration information, described IP address and described port numbers, obtain communications protocol storage ground
Location.
Preferably, described communications protocol carries out record, a described document of agreement with document of agreement form
Record one or more communications protocol.
Preferably, described described packet carried out parsing include:
Resolve the Ethernet protocol head of described packet;
Resolve the IP protocol header of described packet;
Resolve the Transmission Control Protocol head of described packet;
According to described communications protocol, the application layer data of described packet is resolved.
Preferably, also include:
Preserve the step of the analysis result for described IP protocol header, Transmission Control Protocol head and application layer data.
Preferably, the described result according to described parsing selects Validity Test data to include:
According to the second default filtercondition, the result of described parsing is filtered, and by described filtration
Result as Validity Test data.
Preferably, described include according to described Validity Test data genaration automatic test cases:
For described Validity Test data, use-case title is set;
For described Validity Test data Checkpointing;
Automatic test cases is generated according to described Validity Test data, use-case title and checkpoint.
A kind of method of testing, it is raw that described method includes using above-mentioned automatic test cases to generate method
Become automatic test cases, including:
Perform described automatic test cases;
The execution result of described automatic test cases is processed.
The execution of described automatic test cases can be automatic, it is also possible to is artificial.
Preferably, the described execution result to described automatic test cases carries out process and includes:
Notification message is generated according to described execution result, and by the transmission of described notification message to described test
The relevant personnel.
Preferably, also include:
Preserve the step of described execution result.
A kind of automatic test cases generates system, including:
Packet acquisition module, for testing results use-case, it is thus achieved that data stream;
Packet chooses module, for choosing the packet relevant with test case in described data stream,
Described packet includes the packet of test request and corresponds to the response data packet of described test request;
Parsing module, for resolving described packet;
Select module, for selecting Validity Test data according to the result resolved;
Use-case builds module, for according to described Validity Test data genaration automatic test cases.
Preferably, also include:
Communications protocol memory module, for memory communicating agreement;
Communications protocol acquisition module, the communications protocol storage in the main frame obtaining testing results use-case
Address, and store address acquisition communications protocol according to described communications protocol.
Preferably, also include:
Configuration Manager, is used for managing configuration file, and described configuration file is used for recording log equipment
Network parameter and described log equipment communications protocol storage address between corresponding relation.
Preferably, described Configuration Manager realizes communication configuration management by disposing zookeeper service
Function.
Preferably, described parsing module also includes:
Ethernet protocol header parsing submodule, for resolving the Ethernet protocol head of described packet;
IP protocol header analyzing sub-module, for resolving the IP protocol header of described packet;
Transmission Control Protocol header parsing submodule, for resolving the Transmission Control Protocol head of described packet;
Application layer data analyzing sub-module, for according to the application to described packet of the described communications protocol
Layer data resolves.
Preferably, described selection module also includes:
Second arranges submodule, is used for arranging the second filtercondition;
Validity Test data acquisition submodule, is used for according to the second filtercondition preset described parsing
Result filter, and using the result of described filtration as Validity Test data.
Preferably, described use-case structure module also includes:
Use-case title arranges submodule, for arranging use-case title for described Validity Test data;
Checkpointing submodule, is used for as described Validity Test data Checkpointing;
Use-case generates submodule, for raw according to described Validity Test data, use-case title and checkpoint
Become automatic test cases.
Preferably, also include:
Data memory module, for storing the data relevant with generating automatic test cases;
Case management module, for management automation test case.
Preferably, described data memory module includes:
First data sub module stored, ties the parsing of the packet relevant with test case for storage
Really;
Second data sub module stored, is used for storing automatic test cases.
A kind of test system, described system includes that above-mentioned automatic test cases generates system, also wraps
Include:
Use-case implementation sub-module, is used for performing automatic test cases;
Perform result treatment submodule, to the execution result of described automatic test cases
Reason.
Preferably, also include:
Measured data management module, enters for automatic test cases is tested the related data of object
Line pipe is managed.Further, described related data can be managed by measured data management module automatically.
The invention has the beneficial effects as follows:
The present invention proposes automatic test cases and generates method and system and use automatic test to use
The method of testing of example and system, New function or improvement function for software are tested, and have as follows
Advantage:
(1) achieve automatic packet capturing and automatically generate automatization during generating automatic test cases
Test case, thus simplify automatic test cases Making programme, it is obviously improved automatic test and uses
Example make efficiency;
(2) complexity of making automatic test cases is reduced, no matter developer or tester
All can make test case, so that developer can participate in test, promote test matter
Amount;
(3) making of automatic test cases is not limited by development process, completes merit developer
Automatic test cases can be made so that the hysteresis quality of automatic test cases drops significantly after exploitation
Low;
(4) use the test of automatic test cases can manually carry out or automatically run, use automatically
The automatic test approach of change test case also achieves automatically to be safeguarded measured data and automatically performs automatization
Test case, improves testing efficiency and quality further.
Accompanying drawing explanation
Fig. 1 is the flow chart that a kind of automatic test cases provided in embodiment 1 generates method;
Fig. 2 is the flow chart that the another kind of automatic test cases provided in embodiment 2 generates method;
Fig. 3 is the communications protocol storage address acquiring method flow chart provided in embodiment 2;
Fig. 4 is the packet analytic method flow chart provided in embodiment 2;
Fig. 5 is that the automatic test cases provided in embodiment 2 generates method flow diagram;
Fig. 6 is a kind of method of testing flow chart provided in embodiment 3;
Fig. 7 is the schematic diagram generating automatic test cases method provided in embodiment 3;
Fig. 8 is that a kind of automatic test cases provided in embodiment 4 generates system schematic;
Fig. 9 is a kind of test system schematic provided in embodiment 5;
Figure 10 is the another kind of test system schematic provided in embodiment 6.
Specific implementation method
In order to make those skilled in the art be more fully understood that the present invention program, below in conjunction with the present invention
Accompanying drawing in embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is only the embodiment of a present invention part rather than whole enforcement
Example.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creative work
The every other embodiment obtained under premise, all should belong to the scope of protection of the invention.
It should be noted that the term " in description and claims of this specification and above-mentioned accompanying drawing
One ", " second " etc. be for distinguishing similar object, without being used for describing specific order or successively
Order.Should be appreciated that the data of so use can be exchanged in the appropriate case, in order to described herein
Embodiments of the invention can be implemented with the order in addition to those here illustrating or describing.This
Outward, term " includes " and " having " and their any deformation, it is intended that cover non-exclusive comprising,
Such as, contain series of steps or the process of unit, method, system, product or equipment need not limit
In those steps clearly listed or unit, but can include the most clearly listing or for this
Other step that a little processes, method, product or equipment are intrinsic or unit.
Embodiment 1:
Embodiments provide a kind of automatic test cases and generate method, it should be noted that
Can be in the department of computer science of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing
System performs, and, although show logical order in flow charts, but in some cases,
Can be to be different from the step shown or described by order execution herein.
A kind of automatic test cases generates method, as it is shown in figure 1, include:
S101. testing results use-case, it is thus achieved that data stream.
S102. choosing the packet relevant with test case in described data stream, described packet includes
The packet of test request and the response data packet corresponding to described test request.
As a example by the computer system including server and application terminal, application terminal is carried out with server
The port of communication is output stream after testing results use-case.In communication process, data stream comprises
There are the packet relevant with test case and the packet unrelated with test case, it is therefore desirable to data
Bag screens.The test request kimonos of certain function in testing service device that application terminal sends
Business device responds as the packet relevant with test case, other packet example for described test request
If heartbeat data packets and handshake data bag are the packet unrelated with test case.
S103. described packet is resolved.
Described application terminal and described server all carry out communication according to the communications protocol of regulation, therefore,
Packet can be resolved according to communications protocol.
S104. selecting Validity Test data according to the result of described parsing, described Validity Test data include
Test request and the response corresponding to described test request.
Analysis result might not all meet the needs making automatic test cases, makes certainly
The staff of dynamicization test case can be according to making the actual demand of automatic test cases to parsing
Result screen, therefrom select all or part of test request and corresponding to the sound of test request
Should be used as Validity Test data.
S105. according to described Validity Test data genaration automatic test cases.
Present embodiments provide a kind of generation method of automatic test cases, survey by generating automatization
Example on probation, has been obviously improved the make efficiency of automatic test cases.
Embodiment 2:
Embodiments provide another kind of automatic test cases and generate method.It should be noted that
Can be in the department of computer science of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing
System performs, and, although show logical order in flow charts, but in some cases,
Can be to be different from the step shown or described by order execution herein.
A kind of automatic test cases generates method, as in figure 2 it is shown, include:
S201. the communications protocol storage address in the main frame of testing results use-case is obtained.As it is shown on figure 3,
Comprise the following steps:
S2011. according to the IP address of main frame described in the network interface card name acquiring of the main frame of testing results use-case.
S2012. the configuration information in configuration file is obtained.Described configuration information includes the net of log equipment
Corresponding relation between the communications protocol storage address of network parameter and described log equipment.Described network is joined
Number includes IP and port numbers.
In a distributed manner as a example by system, described distributed system includes at least one server and multiple main frame,
Wherein be configured with the server of zookeeper as management end, zookeeper provide one distributed,
The distributed application program coordination service of open source code, is mono-reality increased income of Chubby of Google
Existing.
Described zookeeper is for realizing the configuration management for described distributed system, and described configuration is believed
Breath is by configuration file record, and described zookeeper manages described configuration file.By accessing zookeeper
Configuration information can be obtained, and communications protocol is stored in the described communication of use with the form of document of agreement and assists
View carries out on the main frame of communication, and each described main frame storage has one or more document of agreement, each
Document of agreement storage has one or more communications protocol.Therefore, the communication of record in described configuration file
Agreement storage address includes the communications protocol mark in document of agreement mark and told document of agreement, specifically
Ground, all uses name to be referred to as mark in the present embodiment, the most described communications protocol storage address includes agreement
File name and communications protocol title.The content of described configuration information is as shown in table 1.
Table 1 configuration information record table
Log equipment IP | Log equipment port numbers | Communications protocol storage address |
220.186.1.7 | 3386 | The Get_Person_Info communications protocol of A.proto |
220.186.1.7 | 3387 | The Get_Pic_Info communications protocol of A.proto |
220.186.1.7 | 3388 | The Get_Zone_Info communications protocol of B.protod |
S2013. according to described configuration information and described IP address, obtain in described main frame for test
The port numbers of port.
The staff making automatic test cases can obtain in Table 1 according to test content and IP
The port numbers of log equipment.
S2014. according to described configuration information, described IP address and described port numbers, communications protocol is obtained
Storage address.
The staff making automatic test cases can obtain phase in Table 1 according to IP and port numbers
The communications protocol storage address answered.
S202. address acquisition communications protocol is stored according to described communications protocol.
On the basis obtaining communications protocol, also include:
S203. the packet produced during obtaining testing results use-case.
The present embodiment is all deployed with on every machine packet catcher A, in the present embodiment, packet catcher A
It is controlled by zookeeper, by zookeeper, packet catcher A can be configured.
Specifically, the staff making automatic test cases can input first in zookeeper
Filtercondition, such as IP address and/or port numbers, the most described packet catcher A is according to the first mistake preset
Filter condition captures packet, and described packet includes the packet of test request and corresponding to described test
The response data packet of request.
Packet catcher A in the present embodiment can carry out packet capturing and parsing to multiple packet, described many
Planting packet can use different application layer protocols, described application layer protocol to include but not limited to http,
Further comprises wup agreement and/or pb agreement.Wup agreement is the agreement that Google increases income, and pb agreement is also
It is widely used in enterprises.
S204. the packet got is resolved.
Described packet includes Ethernet protocol head, IP protocol header, Transmission Control Protocol head and application layer data
Four partial contents.As shown in Figure 4, comprise the following steps:
S2041. the Ethernet protocol head of described packet is resolved.
S2042. resolve the IP protocol header of described packet, and preserve the parsing to described IP protocol header
Result.The analysis result of described IP protocol header includes the IP information of communication two party.
S2043. resolve the Transmission Control Protocol head of described packet, and preserve described Transmission Control Protocol head
Analysis result.The analysis result of described Transmission Control Protocol head includes the port number information of communication two party.
S2044. according to described communications protocol, the application layer data of described packet is resolved, and protect
Deposit the analysis result to described application layer data.
Each communications protocol is made up of one or more message structures, assists with Get_Person_Info communication
As a example by view, including two message structures of s_Person_Data and s_person_Portrait.According to comprising
Request content in the packet of test request can judge to use which concrete message structure pair
Described packet resolves, and accordingly, the response data packet corresponding to described test request also uses
Identical message structure resolves.Additionally, can sentence according to the application layer data content in packet
The disconnected packet unrelated with test case, such as heartbeat data packets and handshake data bag, for this kind of nothing
Packet, directly abandon, resolve not in use by communications protocol.
As a example by being resolved by s_Person_Data message structure, s_Person_Data message structure
For searching this function of personal information by No. qq, including herein below:
Struct PersonDataReq{……};
Struct PersonDataRsp{……};
By PersonDataReq structure, the packet of test request is resolved, pass through
Corresponding response data packet is resolved by PersonDataRsp structure.
S2045. by the IP of communication two party preserved in resolving, the port numbers of communication two party and application
The analysis result transmission of layer data stores to data center kafka.Kafka is a kind of high-throughput
Distributed post subscribe to message system, it can process the everything in the website of consumer's scale
Flow data.In the present embodiment for storing the analysis result of packet.
S205. selecting Validity Test data according to the result of described parsing, described Validity Test data include
Test request and the response for described test request.
Make the staff of automatic test cases according to experience and test purpose selectively from
The result resolved selects Validity Test data.
Further, it is possible to by presetting the second filtercondition, Automatic sieve selects Validity Test data.
S206. according to described Validity Test data genaration automatic test cases.
The analysis result of test request and the analysis result composition one corresponding to the response of test request have
Effect test data.Each Validity Test data all generate an automatic test cases, and one effectively
The method of Test data generation automatic test cases, as it is shown in figure 5, comprise the following steps:
S2061. use-case title is set for described Validity Test data.
Use-case title contains function and the title of tested object place module of tested object, with
As a example by the test by No. qq lookup this function of personal information, the entitled QQ of use-case passes through QQ
Number querying individual data.
S2062. it is described Validity Test data Checkpointing.
Checkpoint be test case need check content, with to by No. qq search personal information this
As a example by the test of individual function, checkpoint could be arranged to check whether return value is PersonDataRsp number
According to structure.
S2063. generate an automatization according to described Validity Test data, use-case title and checkpoint to survey
Example on probation.
As a example by the test by No. qq lookup this function of personal information, request content is
QQ occurrence in PersonDataReq, whether checkpoint is to be PersonDataRsp data knots
Structure, PersonDataRsp data structure includes name Person_Name and sex Person_Sex,
For each automatic test cases, checkpoint is Person_Name field and Person_Sex
Field.Use-case response is the response in Validity Test data for test request.Repair when carrying out function
After changing, if the relation again run between real response and the intended response after automatic test cases
Meet Rule of judgment, i.e. think that test is passed through, otherwise test and do not pass through.The automatic test generated is used
Such as shown in table 2.
Table 2 automatic test cases list
Present embodiments provide the concrete grammar generating automatic test cases, it is achieved that automatically packet capturing and
Automatically generate automatic test cases, be obviously improved automatic test cases make efficiency, and dropped
The low complexity making automatic test cases, no matter developer or tester all can make
Automatic test cases, so that developer can participate in test, promotes test quality.
Embodiment 3:
Embodiments provide a kind of method of testing.It should be noted that at the flow chart of accompanying drawing
The step illustrated can perform in the computer system of such as one group of computer executable instructions, and,
Although showing logical order in flow charts, but in some cases, can be to be different from herein
Order perform shown or described by step.
A kind of method of testing, as shown in Figure 6, including:
S301. automatic test cases is generated.
As it is shown in fig. 7, be all deployed with packet catcher on each business module of distributed system.
Packet catcher is configured by the staff making automatic test cases, and is sent out by use instrument
Send the mode of request or perform test function by the way of simulation actual services scene.Specifically, logical
Crossing configuration center, described configuration center is deployed with zookeeper, it is possible to the packet capturing work on modules
Tool configures.At configuration center it can also be seen that the concrete condition of packet capturing and the situation of parsing.Such as,
It can be seen that to which module, which IP and port carry out packet capturing, request bag wraps respectively with assorted with returning
Structure goes to resolve.Additionally, described distributed system also includes data center C and database D.
Packet catcher 1 automatically according to the first default filtercondition to numbered 1 tested module enter
Row packet capturing and parsing, and the result resolved is transmitted to data center C.In resolving, only
Analysis result by the request relevant with test with corresponding to the response of described request is stored in data center
In C.
The staff making automatic test cases selects Validity Test data from data center C,
And after adding use-case title and checkpoint, conversion use-case server automatically generate automatic test cases,
Described automatic test cases is transferred in database D carry out storage and management, and automatic test is used
Example comprises use-case title, packet, checkpoint and execution environmental information.
Further, need to ensure that measured data is in upstate after generating automatic test cases,
I.e. need measured data is safeguarded.Therefore maintenance module can be invoked automatically, thus ensures tested
Data keep upstate.As a example by test data are as advertisement, described maintenance module can automatically prolong
The line duration of advertisement to 10 years, fully ensures that resource can be used.
Additionally, maintenance module is additionally operable to the maintenance of measured data, described measured data is stored in data base B
In, described data base B is realized by mysql.
S302. automatic test cases is performed.
Specifically, performing server and be used for performing automatic test cases, user can be by performing
The mode clicking on automatic test cases on server drives execution server to perform automatic test use
Example, or a scheduler task is set, scheduler task configure an implement plan, call and perform clothes
Business device performs automatic test cases in particular moment according to certain order automatically.Further, perform
The scene of automatic test cases can be that the recurrence for current version is verified, bug is repaired in such as exploitation
After return or can be used for later release recurrence checking.
S303. the execution result of described automatic test cases is processed.
Specifically, perform result will be performed server automatically transmit carry out to data base B storage and
Management.
Further, perform server and can also automatically generate notification message also automatically according to performing result
Executor and relevant director is notified automatically by mail or instant messaging.
Present embodiments provide a kind of method of testing, by using the automatization provided in the present embodiment to survey
Examination case generation method so that the making of automatic test cases is not limited by development process, is opening
The personnel of sending out can make after completing functional development and use automatic test cases so that automatic test
The hysteresis quality of use-case is substantially reduced, and promotes the quality of test;The present embodiment also achieves measured data
Automatically safeguard and automatically perform automatic test cases, improving the intelligent of test and efficiency.
Embodiment 4:
Embodiments provide a kind of automatic test cases and generate system, as shown in Figure 8, bag
Include:
Packet acquisition module 401, for testing results use-case, it is thus achieved that data stream.
The present embodiment also provides for one preferred embodiment: packet acquisition module 401 also includes:
First arranges submodule 4011, is used for arranging the first filtercondition.Packet acquisition module 401 can
Data stream is obtained according to the first default filtercondition.
Packet chooses module 402, for choosing the data relevant with test case in described data stream
Bag, described packet includes the packet of test request and corresponds to the response data of described test request
Bag.
Parsing module 403, for resolving described packet.
Specifically, including:
Ethernet protocol header parsing submodule 4031, for resolving the Ethernet protocol head of described packet;
IP protocol header analyzing sub-module 4032, for resolving the IP protocol header of described packet;
Transmission Control Protocol header parsing submodule 4033, for resolving the Transmission Control Protocol head of described packet;
Application layer data analyzing sub-module 4034, is used for according to described communications protocol described packet
Application layer data resolves.
Select module 404, for selecting Validity Test data according to the result of described parsing, described effectively
Test data include test request and the response corresponding to described test request.
The present embodiment also provides for one preferred embodiment: select module 404 to specifically include:
Second arranges submodule 4041, is used for arranging the second filtercondition;
Validity Test data acquisition submodule 4042, is used for according to the second filtercondition preset described
The result resolved filters, and using the result of described filtration as Validity Test data.
Use-case builds module 405, for according to described Validity Test data genaration automatic test cases.
Specifically, including:
Use-case title arranges submodule 4051, for arranging use-case title for described Validity Test data;
Checkpointing submodule 4052, is used for as described Validity Test data Checkpointing;
Use-case generates submodule 4053, for according to described Validity Test data, use-case title and inspection
Point generates automatic test cases.
As one preferred embodiment: described automatic test cases generates system and also includes:
Communications protocol memory module 406, for memory communicating agreement;
Communications protocol acquisition module 407, the communications protocol in the main frame obtaining testing results use-case is deposited
Storage address, and store address acquisition communications protocol according to described communications protocol.
Configuration Manager 408, is used for managing configuration file, and described configuration file is used for recording networking and sets
Corresponding relation between the communications protocol storage address of standby network parameter and described log equipment.
As one preferred embodiment: described automatic test cases generates system and also includes:
Data memory module 409, for storing the data relevant with generating automatic test cases.
The present embodiment also provides for one preferred embodiment: select data memory module 409 specifically to wrap
Include:
First data sub module stored 4091, for the storage solution to the packet relevant with test case
Analysis result.
Second data sub module stored 4092, is used for storing automatic test cases.
As one preferred embodiment: described automatic test cases generates system and also includes:
Case management module 410, for management automation test case.
Further, in a distributed manner as a example by application system, described distributed system includes multiple main frame,
One of them main frame, as server, is configured with zookeeper, and other main frame is all deployed with packet capturing work
Tool, described packet catcher is controlled by zookeeper.On other main frame, storage has the association of record communications protocol
View file.Additionally, also include that data center and storage automatic test for storing and resolving result are used
The database D of example.
Described Configuration Manager 408 realizes communication configuration management function, institute by disposing zookeeper
State parsing module 403 and packet acquisition module 401 is all realized by the packet catcher disposed.
Described first data sub module stored 4091 and selection module 404 are all real by calling data center
Existing, described second data sub module stored 4092 and case management module 410 are all by calling data base
D realizes.Described use-case builds module 405 and realizes by calling conversion use-case server, described conversion
Use-case server is used for according to Validity Test data genaration automatic test cases, and by automatic test
Use-case transmits to database D.
Present embodiments providing a kind of automatic test cases and generate system, described system is capable of certainly
Dynamic packet capturing and the instruction according to automatic test cases producer automatically generate automatic test cases,
Speed and intelligent level that automatic test cases makes can be obviously improved.
Embodiment 5:
The embodiment of the present invention additionally provides a kind of test system, as it is shown in figure 9, include automatic test
Use-case generates system 501, and it can be to carry in embodiment 4 that described automatic test cases generates system 501
The automatic test cases of confession generates system, additionally, also include:
Use-case implementation sub-module 502, is used for performing automatic test cases;
Perform result treatment submodule 503, for the execution result of described automatic test cases is carried out
Process.
As one preferred embodiment: the present embodiment also includes:
Measured data management module 504, for testing the related data of object to automatic test cases
It is managed.Need to ensure that measured data is in upstate after generating automatic test cases, i.e. need
Measured data is safeguarded.Therefore measured data management module 504 can be invoked automatically, thus
Ensure that measured data keeps upstate.
As a example by the distribution application system mentioned in embodiment 4, described distributed system includes multiple
Main frame, one of them main frame, as server, is configured with zookeeper, and other main frame is all deployed with
Packet catcher, described packet catcher is controlled by zookeeper.Additionally, also include data center, storage
And the database D of management automation test case and storage manage the data base B of other data, institute
State data base B to be realized by mysql, additionally, also include changing use-case server and performing server.
Use-case implementation sub-module 502 calls described execution server and performs automatic test cases.
Perform result treatment submodule 503 and call described execution server execution automatic test cases,
And generate test result, the transmission of described test result is carried out storage and management to data base B.Additionally,
Notification message can also be generated according to performing result and notify executor automatically by mail or instant messaging
With relevant director.
Measured data management module 504 is called data base B and is realized the storage and management to measured data,
And can ensure that measured data is in upstate according to the implementation status of automatic test cases.
Present embodiments provide a kind of test system, described test system not only achieve automatic packet capturing and
Instruction according to automatic test cases producer automatically generates automatic test cases, also achieves
Automatically measured data and test automatically are safeguarded.Can not only be obviously improved what automatic test cases made
Speed, also promotes efficiency and the quality of automatic test.
Embodiment 6:
The embodiment of the present invention additionally provides another kind of test system, and described test system is arranged at distributed
In system, as shown in Figure 10, including configuration center 601 and sniffer 602, distributed system bag
Including multiple main frame, one of them main frame, as configuration center 601, is configured with zookeeper, and other is main
All being deployed with sniffer 602 on machine, described sniffer 602 is controlled by configuration center 601.
After testing results use-case, described sniffer 602 obtains data stream, and selects in described data stream
Take the packet relevant with test case to resolve, and analysis result is transmitted to data center 603.
Specifically, in configuration center 601, storage has configuration information, described configuration information to be used for obtaining solution
Communications protocol required for analysis packet.The analysis result of data center 603 storage can be demonstrated flat
Platform 604 calls, and the producer of automatic test cases checks described parsing in display platform 604
Result.
Additionally, also include that automatic test cases makes entrance 605, automatic test cases editor foreground
606, data base 607, execution server 608 and instant communicator 609.
Wherein, automatic test cases makes entrance 605 for sending system to described display platform 604
Making automatic test cases instruction, described display platform 604 shows storage in described data center 603
Data, automatic test cases editor foreground 606 is for choosing Validity Test number in described data
According to, and after checking rule for described Validity Test data genaration, generate automatic test cases, described
Automatic test cases is transferred to data base 607 and stores.
Data base 607 can also store automatic test cases group, each automatic test cases group bag
Include one or more automatic test cases, described automatic test cases group conduct in test process
One entirety performs.
Perform server 608 to hold for the automatic test cases called in described data base 607
OK, and by execution result transmit to instant communicator 609, the knot that described instant communicator 609 will perform
Fruit transmission is to responsible person concerned.
Further, the present embodiment also includes that data Layer has an X-rayed modified module 610, for measured data
Safeguard.
Present embodiments provide another implementation of test system, automatic packet capturing can not only be realized
Automatic test cases is automatically generated with according to the instruction of automatic test cases producer, additionally it is possible to
Automatically test and measured data is managed.
The modules in technical scheme in the present invention all can be real by terminal or miscellaneous equipment
Existing.Described terminal includes processor and memorizer.Described memorizer is used for storing in the present invention
Programmed instruction/module in the system provided, the journey that described processor is stored in memorizer by operation
Sequence instruction/module, it is achieved the corresponding function of the system provided in the present invention.
Part that prior art is contributed by technical scheme in the present invention the most in other words or should
Completely or partially can embodying with the form of software product of technical scheme, this computer software produces
Product are stored in storage medium, including some instructions with so that one or more computer equipment (can
For personal computer, server or the network equipment etc.) perform method described in each embodiment of the present invention
All or part of step.
System in the present invention is only schematically, and the division of the most described module/unit is only only
A kind of logic function divides, and actual can have other dividing mode when realizing, the most multiple unit or
Assembly can in conjunction with or be desirably integrated into another system, or some features can be ignored, or does not holds
OK.Some or all of module/unit therein can be selected according to the actual needs to reach to realize this
The purpose of scheme of the invention.
It addition, each module/unit in each embodiment of the present invention can be integrated in a processing unit
In, it is also possible to it is that unit is individually physically present, it is also possible to two or more unit are integrated in
In one unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ soft
The form of part functional unit realizes.
The above is only the preferred embodiment of the present invention, it is noted that for the art
For those of ordinary skill, under the premise without departing from the principles of the invention, it is also possible to make some improvement
And retouching, these improvements and modifications also should be regarded as protection scope of the present invention.
Claims (10)
1. an automatic test cases generates method, it is characterised in that including:
Testing results use-case, it is thus achieved that data stream;
Choosing the packet relevant with test case in described data stream, described packet includes test
The packet asked and the response data packet corresponding to described test request;
Described packet is resolved;
Validity Test data are selected according to the result resolved,
According to described Validity Test data genaration automatic test cases.
A kind of automatic test cases the most according to claim 1 generates method, it is characterised in that
Also include:
Obtain the communications protocol storage address in the main frame of testing results use-case;
Storing address acquisition communications protocol according to described communications protocol, described communications protocol is for described
Packet resolves.
A kind of automatic test cases the most according to claim 2 generates method, it is characterised in that
Communications protocol storage address in the main frame of described acquisition testing results use-case includes:
Obtaining configuration information, described configuration information includes that the network parameter of log equipment sets with described networking
The standby corresponding relation between communications protocol storage address;
Obtain the IP address of described main frame;
According to described configuration information and described IP address, obtain the port for test in described main frame
Port numbers;
According to described configuration information, described IP address and described port numbers, obtain communications protocol storage ground
Location.
A kind of automatic test cases the most according to claim 2 generates method, it is characterised in that
Described described packet carried out parsing include:
Resolve the Ethernet protocol head of described packet;
Resolve the IP protocol header of described packet;
Resolve the Transmission Control Protocol head of described packet;
According to described communications protocol, the application layer data of described packet is resolved.
A kind of automatic test cases the most according to claim 1 generates method, it is characterised in that
The described result according to described parsing selects Validity Test data to include:
According to the second default filtercondition, the result of described parsing is filtered, and by described filtration
Result as Validity Test data.
A kind of automatic test cases the most according to claim 1 generates method, it is characterised in that
Described include according to described Validity Test data genaration automatic test cases:
For described Validity Test data, use-case title is set;
For described Validity Test data Checkpointing;
Automatic test cases is generated according to described Validity Test data, use-case title and checkpoint.
7. a method of testing, described method includes using as described in any one in claim 1-6
Automatic test cases generate method generate automatic test cases, it is characterised in that also include:
Perform described automatic test cases;
The execution result of described automatic test cases is processed.
8. an automatic test cases generates system, it is characterised in that including:
Packet acquisition module, for testing results use-case, it is thus achieved that data stream;
Packet chooses module, for choosing the packet relevant with test case in described data stream,
Described packet includes the packet of test request and corresponds to the response data packet of described test request;
Parsing module, for resolving described packet;
Select module, for selecting Validity Test data according to the result resolved;
Use-case builds module, for according to described Validity Test data genaration automatic test cases.
A kind of automatic test cases the most according to claim 8 generates system, it is characterised in that
Described use-case builds module and also includes:
Use-case title arranges submodule, for arranging use-case title for described Validity Test data;
Checkpointing submodule, is used for as described Validity Test data Checkpointing;
Use-case generates submodule, for raw according to described Validity Test data, use-case title and checkpoint
Become automatic test cases.
10. a test system, described system includes the automatic test described in claim 8 or 9
Use-case generates system, it is characterised in that also include:
Use-case implementation sub-module, is used for performing automatic test cases;
Perform result treatment submodule, to the execution result of described automatic test cases
Reason.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610485727.2A CN105975396A (en) | 2016-06-28 | 2016-06-28 | Generating method and system for automated testing case |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610485727.2A CN105975396A (en) | 2016-06-28 | 2016-06-28 | Generating method and system for automated testing case |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105975396A true CN105975396A (en) | 2016-09-28 |
Family
ID=57020760
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610485727.2A Pending CN105975396A (en) | 2016-06-28 | 2016-06-28 | Generating method and system for automated testing case |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105975396A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108241573A (en) * | 2016-12-23 | 2018-07-03 | 北京国双科技有限公司 | A kind of integration testing code generating method and device |
CN108490922A (en) * | 2018-04-27 | 2018-09-04 | 北京新能源汽车股份有限公司 | Generation method and device of unified diagnostic service test case |
CN108932193A (en) * | 2018-06-01 | 2018-12-04 | 四川斐讯全智信息技术有限公司 | A kind of MQTT server interface test method and system |
CN109062178A (en) * | 2018-07-20 | 2018-12-21 | 深圳市雷赛控制技术有限公司 | A kind of automated testing method, device, test equipment and storage medium |
CN109308266A (en) * | 2018-11-30 | 2019-02-05 | 北京微播视界科技有限公司 | Construction method, test method, device, equipment and the medium of test case |
CN110287093A (en) * | 2019-05-20 | 2019-09-27 | 平安普惠企业管理有限公司 | Mobile terminal, data-interface test method and storage medium |
CN112181836A (en) * | 2020-09-30 | 2021-01-05 | 中国平安财产保险股份有限公司 | Test case generation method, system, device and storage medium |
CN113709003A (en) * | 2021-09-02 | 2021-11-26 | 上海天旦网络科技发展有限公司 | System, method and medium for automatically generating test case through network flow data |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101482815A (en) * | 2008-01-10 | 2009-07-15 | 国际商业机器公司 | Method and equipment for generating test case of software system |
CN101860460A (en) * | 2010-05-14 | 2010-10-13 | 东南大学 | Web composite service test method of extension-based hierarchical colored Petri net |
CN103312551A (en) * | 2012-03-12 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Test method and test device of common gateway interface |
EP2778929A1 (en) * | 2013-03-14 | 2014-09-17 | Accenture Global Services Limited | Test script generation system |
CN105279086A (en) * | 2015-10-16 | 2016-01-27 | 山东大学 | Flow chart-based method for automatically detecting logic loopholes of electronic commerce websites |
-
2016
- 2016-06-28 CN CN201610485727.2A patent/CN105975396A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101482815A (en) * | 2008-01-10 | 2009-07-15 | 国际商业机器公司 | Method and equipment for generating test case of software system |
CN101860460A (en) * | 2010-05-14 | 2010-10-13 | 东南大学 | Web composite service test method of extension-based hierarchical colored Petri net |
CN103312551A (en) * | 2012-03-12 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Test method and test device of common gateway interface |
EP2778929A1 (en) * | 2013-03-14 | 2014-09-17 | Accenture Global Services Limited | Test script generation system |
CN105279086A (en) * | 2015-10-16 | 2016-01-27 | 山东大学 | Flow chart-based method for automatically detecting logic loopholes of electronic commerce websites |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108241573A (en) * | 2016-12-23 | 2018-07-03 | 北京国双科技有限公司 | A kind of integration testing code generating method and device |
CN108490922A (en) * | 2018-04-27 | 2018-09-04 | 北京新能源汽车股份有限公司 | Generation method and device of unified diagnostic service test case |
CN108490922B (en) * | 2018-04-27 | 2020-03-24 | 北京新能源汽车股份有限公司 | Generation method and device of unified diagnostic service test case |
CN108932193A (en) * | 2018-06-01 | 2018-12-04 | 四川斐讯全智信息技术有限公司 | A kind of MQTT server interface test method and system |
CN109062178A (en) * | 2018-07-20 | 2018-12-21 | 深圳市雷赛控制技术有限公司 | A kind of automated testing method, device, test equipment and storage medium |
CN109308266A (en) * | 2018-11-30 | 2019-02-05 | 北京微播视界科技有限公司 | Construction method, test method, device, equipment and the medium of test case |
CN110287093A (en) * | 2019-05-20 | 2019-09-27 | 平安普惠企业管理有限公司 | Mobile terminal, data-interface test method and storage medium |
CN112181836A (en) * | 2020-09-30 | 2021-01-05 | 中国平安财产保险股份有限公司 | Test case generation method, system, device and storage medium |
CN113709003A (en) * | 2021-09-02 | 2021-11-26 | 上海天旦网络科技发展有限公司 | System, method and medium for automatically generating test case through network flow data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105975396A (en) | Generating method and system for automated testing case | |
CN109617759A (en) | Block catenary system stability test method, apparatus, equipment and storage medium | |
CN111988199B (en) | IMS (IP multimedia subsystem) signaling analysis system and method for power switching network | |
CN107508722B (en) | Service monitoring method and device | |
CN107908541A (en) | Interface test method, device, computer equipment and storage medium | |
US11509704B1 (en) | Product validation based on simulated enhanced calling or messaging communications services in telecommunications network | |
CN108399114A (en) | A kind of system performance testing method, apparatus and storage medium | |
US11405302B1 (en) | Methods, systems, and computer readable media for network testing using configurable test infrastructure | |
CN106095673A (en) | Automated testing method based on WEB interface and system | |
CN107294808A (en) | The methods, devices and systems of interface testing | |
CN105141441B (en) | A kind of method that IP network graphically configures | |
CN106325988A (en) | Task scheduling method and device | |
US11770323B2 (en) | Unified interface and tracing tool for network function virtualization architecture | |
CN106411637A (en) | Internet-of-things device scenario testing method | |
CN103678124B (en) | Video surveillance platform auto-test method and device based on continuous integrated environment | |
CN107733710A (en) | Construction method, device, computer equipment and the storage medium of link call relation | |
CN103246606A (en) | Method and system for testing performances of ESB (enterprises service bus) platform | |
CN105099801B (en) | The test system of information management system and test environment analogy method | |
CN111314137A (en) | Information communication network automation operation and maintenance method, device, storage medium and processor | |
WO2023131343A1 (en) | Stress test method and system, and device and storage medium | |
CN111400127A (en) | Service log monitoring method and device, storage medium and computer equipment | |
CN109165165A (en) | Interface test method, device, computer equipment and storage medium | |
CN111190875A (en) | Log aggregation method and device based on container platform | |
CN109800081A (en) | A kind of management method and relevant device of big data task | |
CN111767215B (en) | Block chain continuous integration test method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160928 |