CN105446867A - Method and apparatus for generating test data - Google Patents

Method and apparatus for generating test data Download PDF

Info

Publication number
CN105446867A
CN105446867A CN201410419779.0A CN201410419779A CN105446867A CN 105446867 A CN105446867 A CN 105446867A CN 201410419779 A CN201410419779 A CN 201410419779A CN 105446867 A CN105446867 A CN 105446867A
Authority
CN
China
Prior art keywords
request message
service side
data
record
called
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.)
Granted
Application number
CN201410419779.0A
Other languages
Chinese (zh)
Other versions
CN105446867B (en
Inventor
方磊
陈成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410419779.0A priority Critical patent/CN105446867B/en
Publication of CN105446867A publication Critical patent/CN105446867A/en
Application granted granted Critical
Publication of CN105446867B publication Critical patent/CN105446867B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The present application discloses a computer technology, and particularly relates to a method and apparatus for generating test data so as to improve validity of a test result. The method comprises: performing binary data recording on transmitted data in a process of data transmission; then performing deserialization operation on the recorded binary data to obtain code element information; and generating required test codes based on the code element information. Therefore, the corresponding test codes can be generated based on a real interface application environment, so that the generation efficiency of the test codes is effectively improved, the validity and accuracy of the test result are improved, and meanwhile, the development and maintenance cost of the test codes is also greatly saved. Further, the method and the apparatus which are disclosed by the embodiment of the present application are extremely high in universality, are applicable to various protocol interfaces, are simple to operate, and do not need a developer to have years of development experiences, thereby further reducing expansion cost of the method and the apparatus.

Description

A kind of generation method of test data and device
Technical field
The application relates to computer technology, particularly a kind of generation method of test data and device.
Background technology
In computer program exploitation and maintenance process, developer usually needs to write a large amount of test case docking ports and calls and detect.And in the process of writing test case, developer often needs the required test data of oneself structure.The experience depending on developer that this kind of method is too much, usually there will be error in data (e.g., lacking call parameter), thus causes interface interchange to test interruption, needs repeatedly to debug ability success, causes the time to spend huge.
And in practical application, even if test process completes smoothly, whether the test data of developer's structure is consistent with the data in true invoked procedure is also a unknown number, the validity of test result is reduced.
Above situation is under interface enters to join complicated situation, and drawback is particularly outstanding.
Summary of the invention
The embodiment of the present application provides a kind of generation method and device of test data, in order to improve the validity of test result.
The concrete technical scheme that the embodiment of the present application provides is as follows:
A generation method for test data, comprising:
Receive the request message that called side sends, after carrying out data record, mail to service side, and the response message that reception server returns, mail to called side after carrying out data record;
Unserializing process is carried out to the data of record, obtains code elements information;
Corresponding test code is generated based on the code elements information obtained.
Like this, based on the corresponding test code of real Application of Interface environment generation, thus can effectively improve the formation efficiency of test code, improve validity and the accuracy of test result, also greatly save the development and maintenance cost of test code simultaneously.Further, the versatility of the embodiment of the present application is high, is applicable to various protocol interface, and simple to operate, does not need developer to have development Experience for many years, thus enters one and reduce its expansion cost.
Optionally, receive the request message that called side sends, after carrying out data record, mail to service side, and the response message that reception server returns, mail to called side after carrying out data record, comprising:
When receiving the request message that called side sends, reading the specific field in described request message, according to the type of the analysis result decision request message of described specific field, and obtaining the system domain name of service side;
If described request message is for obtaining get request message, then start to record the binary data in get request message, after record, the local connection to service side is opened according to the system domain name of service side, and get request message is sent to service side by described connection, and when receiving the response message of service side, the binary data of recording responses message, and be back to called side;
If described request message is for issuing post request message, then open the local connection to service side according to the system domain name of service side, start to record the binary data in post request message, and circulation reading is carried out to post request message, service side is sent to successively by described connection by recording complete data division, and when receiving the response message that service side returns, the binary data of recording responses message, and circulation reading is carried out to response message, send to called side successively by recording complete data division.
Optionally, unserializing process is carried out to the data of record, obtains code elements information, comprising:
The binary data including request message and response message of record is converted to character string, and therefrom parses the calling interface and call method that adopt when called side is called service side;
Unserializing process is carried out to the string data obtained, obtains java applet exercisable tested object, and therefrom parse use when called side is called service side enter to join list, and service side return call result;
By the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
Optionally, generate corresponding test code based on the code elements information obtained, comprising:
According to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and according to the call method that called side uses, the call method title used in configuration testing code, call method type and call parameters;
Enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
Optionally, comprise further:
Entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then directly call; If tested object to be obtained is complex object, then reads file corresponding to described complex object and preserve address to obtain the preservation file generated based on described complex object, and be call again after described complex object by described preservation file transform.
A generating apparatus for test data, comprising:
Communication unit, for receiving the request message that called side sends, mails to service side after carrying out data record, and the response message that reception server returns, and mails to called side after carrying out data record;
Processing unit, for carrying out unserializing process to the data of record, obtains code elements information;
Generation unit, for generating corresponding test code based on the code elements information obtained.
Like this, based on the corresponding test code of real Application of Interface environment generation, thus can effectively improve the formation efficiency of test code, improve validity and the accuracy of test result, also greatly save the development and maintenance cost of test code simultaneously.Further, the versatility of the embodiment of the present application is high, is applicable to various protocol interface, and simple to operate, does not need developer to have development Experience for many years, thus enters one and reduce its expansion cost.
Optionally, receive the request message that called side sends, mail to service side after carrying out data record, and the response message that reception server returns, when mailing to called side after carrying out data record, described communication unit specifically for:
When receiving the request message that called side sends, reading the specific field in described request message, according to the type of the analysis result decision request message of described specific field, and obtaining the system domain name of service side;
If described request message is for obtaining get request message, then start to record the binary data in get request message, after record, the local connection to service side is opened according to the system domain name of service side, and get request message is sent to service side by described connection, and when receiving the response message of service side, the binary data of recording responses message, and be back to called side;
If described request message is for issuing post request message, then open the local connection to service side according to the system domain name of service side, start to record the binary data in post request message, and circulation reading is carried out to post request message, service side is sent to successively by described connection by recording complete data division, and when receiving the response message that service side returns, the binary data of recording responses message, and circulation reading is carried out to response message, send to called side successively by recording complete data division.
Optionally, to record data carry out unserializing process, obtain code elements information time, described record cell specifically for:
The binary data including request message and response message of record is converted to character string, and therefrom parses the calling interface and calling device that adopt when called side is called service side;
Unserializing process is carried out to the string data obtained, obtains java applet exercisable tested object, and therefrom parse use when called side is called service side enter to join list, and service side return call result;
By the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
Optionally, based on obtain code elements information generate corresponding test code time, described generation unit specifically for:
According to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and according to the calling device that called side uses, the calling device title used in configuration testing code, calling device type and call parameters;
Enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
Optionally, described generation unit is further used for:
Entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then directly call; If tested object to be obtained is complex object, then reads file corresponding to described complex object and preserve address to obtain the preservation file generated based on described complex object, and be call again after described complex object by described preservation file transform.
Accompanying drawing explanation
Fig. 1 is TCP agent System Working Principle schematic diagram in the embodiment of the present application;
Fig. 2 is that in the embodiment of the present application, TCP agent system generates test data general introduction process flow diagram;
Fig. 3 is TCP agent system architecture schematic diagram in the embodiment of the present application.
Embodiment
In order to improve the test result validity of interface testing, in the embodiment of the present application, redesign the generating mode of test data, namely by monitoring transmission control protocol (TransmissionControlProtocol, TCP) data then unserializing, thus the test data needed for generating based on True Data, do not need manual construction data completely, namely save the test duration, again because the authenticity of test data, effectively improve the validity of test result.
Below in conjunction with accompanying drawing, the application is preferred embodiment described in detail.
Consult shown in Fig. 1, in the embodiment of the present application, the agency plant being positioned at TCP layer is provided with between called side and service side, be called for short, TCP agent system, any request that call direction service side sends all can be forwarded to service side by TCP agent system acceptance, and accordingly, any response that service side returns also all can be forwarded to called side by TCP agent system work.
When specific implementation, as long as be switched to TCP agent system by the destination service of called side, e.g., the service domain name of called side is pointed to TCP agent system etc., and this is no longer going to repeat them.In addition, tester can send call request by any mode by call direction service side, also can be returned by service orientation called side by any mode and call response, and all operating process all can by TCP agent system forwards and record.
Consult shown in Fig. 2, in the embodiment of the present application, the general introduction flow process that TCP agent system generates test data is as follows:
Step 200: receive the request message that called side sends, mail to service side after carrying out data record, and the response message that reception server returns, mail to called side after carrying out data record.
As shown in Figure 1, in the embodiment of the present application, TCP agent system forwards interaction message between the two between called side and service side, in the process forwarded, optionally, TCP agent system, at TCP layer record interaction message between the two, comprise the request message that called side mails to service side, and service side mails to the response message of called side.Owing to having carried out data decryptor at TCP layer, therefore, the embodiment of the present application is a kind of general scheme, can be adapted to the system and the equipment that adopt any protocol stack, as long as carry out corresponding exploitation based on TCP layer, just can carry out the monitoring of any style interface service agreement.
On the other hand, the application supports the network service (Webservice of xfire at present, and some self-defining far call agreements wb), according to practical application request, also can the agreement that technical scheme pays suitably be expanded, in the present embodiment, only do function presentation in the ws protocol processes mode of xfire.
Concrete, when performing step 200, TCP agent system is mainly used in request message called side sent, be forwarded to the service side specified, and response message service side to be returned returns to called side, and in this invoked procedure, the binary data of record request message and response message.
In practical application, request message is divided into acquisition (get) request message and issue (post) request message, the former is for service side's request service descriptive language (WebServicesDescriptionLanguag, wsdl) document (i.e. service side enter to join list), the latter is used for calling service side and performs various operation.For dissimilar request message, TCP agent system will perform different process.Wherein, Web service describes and is defined as one group of service access point by wsdl document, and client can conduct interviews (similar remote procedure call) by these service access points to comprising the service that Oriented Documents information or procedure-oriented call.
Concrete executive mode is as follows:
After TCP agent system starts, monitoring designated port (as, be configured to 8080 ports), when receiving called side request message, specific field (such as, front 256 bytes or front 1024 bytes etc.) in TCP agent system read requests message, according to the type of the analysis result decision request message of this part data, and obtain the system domain name of service side, also claim main frame (host) information;
If request message is get request message, then its objective is the wsdl document (i.e. service side enter to join list) obtaining service side, namely what is called enters to join list is the parameter list needing when calling service side to use, and called side fills corresponding parameter according to the prompting entering to join list and can call service side in post request.So, TCP agent system starts to record the binary data in get request message, and after record, opens the local TCP to service side connect according to the system domain name of service side, is connected by get request message be sent to service side by the TCP set up; Accordingly, TCP agent system when receiving the response message of service side (carrying wsdl file), the binary data of recording responses message, and be back to called side.
Why like this process is because the data volume of carrying in get request message is less, therefore, after record, all data can be sent to service side together.
If post request message, then its objective is that calling service side completes various operation, so, TCP agent system is opened the local TCP to service side according to the system domain name of service side and is connected, (all data all will import service side into the specific field that early stage reads to be write this TCPL connection, first first send obtaining the data received) herein, and the binary data starting to record in post request message is (optional, request array can be used, namely byte [] request records), then, TCP agent system can be carried out circulation to post request message and be read, service side is sent to successively by the TCP connection of having set up by recording complete data division, accordingly, time response message (carry and call result) that TCP agent system acceptance returns to service side, the binary data of recording responses message is (optional, response array can be used, namely byte [] response records), and circulation reading is carried out to response message, send to called side successively by recording complete data division.
Wherein, when returning response message to service side, in order to avoid reading empty data, optionally, TCP agent system can circulate sleep (sleep) 25 milliseconds, to end up identifier until the data recorded in byte [] response contain wsdl.
Why like this process is that in order to avoid causing data jamming, post request message is sent to service side by TCP disposal system several times because the data volume of carrying in post request message is more.
Step 210: carry out unserializing process to the data of record, obtains code elements information.
When performing step 210, TCP disposal system specifically performs following steps:
First, TCP agent system obtains the binary data recorded and (comprising: get request message and response message thereof, post request message and response message thereof), binary data is converted to character string, and therefrom parses the calling interface and call method that adopt when called side is called service side.
In practical application, all data record all in binary form, TCP agent system is before carrying out unserializing operation, need first binary data is converted to character string (as, soap version of an agreement), after being converted to character string, the calling interface that called side adopts and call method directly can resolve acquisition, and enter to join the parameter configuration that list relates to complexity, call result and also comprise mass data, acquisition cannot be resolved under character string state, must unserializing operation be carried out, be converted to the exercisable object of java applet.
Secondly, unserializing process is carried out to the string data obtained, obtain the exercisable tested object of java applet, and therefrom parse use when called side is called service side enter to join list, the calling that list and service side return that enter to join of use obtains the exercisable tested object of java applet.
Finally, by the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
In the embodiment of the present application, it is that xFire is of new generation based on what realize the transformation of xfire that TCP agent system performs unserializing operation javaweb service engine, step and the process of Web service is converted into for simplifying Java application, in the present embodiment, transform the function of xfire processor, only remain its Data Analysis function, do not provide other to serve, therefore, TCP agent system only need call the unserializing operation that improved xfire can realize data.After unserializing operation, what what TCP agent system can parse that called side uses enter to join list and service side returned calls result, both is all converted into the exercisable tested object of java applet, wherein, owing to entering to join list and calling the data all including large amount of complex in result, therefore, the object of generation comprises plain objects and complex object.
Above-mentioned calling interface, call method, to enter to join list and call result be all important code elements information, using these information as dimension, can generate the test code accurately of realistic applied environment; Certainly, if managerial personnel know the calling interface that called side adopts and call method in advance, then TCP agent system also can not be resolved and be obtained this information from character string, and only carries out unserializing operation to character string and obtain of paramount importancely enter to join list and call result.Do not repeat them here.
Step 220: generate corresponding test code based on the code elements information obtained.
Concrete, when performing step 220, TCP code system performs following operation:
First, according to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and the call method title, call method type and the call parameters that use in the call method configuration testing code used according to called side.
Such as, the calling interface used according to called side and call method, the interface name used in configuration testing code, bean (a kind of java class) type, bean title, call parameters method etc.; Wherein, simple parameter variable and parameter enumerated value are needed to carry out initial assignment.
Secondly, enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
Such as, to enter to join list, can resolve entering to join list, configuring into ginseng type in test code, entering ginseng statement, import type, initialization assignment etc.
On the other hand, to entering to join list and calling after result carries out unserializing operation, because the tested object generated may be plain objects and complex object, therefore, its preserving type may be different, as, plain objects is directly preserved with the form of Java object, and complex object due to data volume huge, need to carry out preserving more safe safety with document form, therefore, TCP agent system need complex object to be converted to document form (as, Javascript Object Notation (JavascriptObjectNotation, Json) file is preserved) preserve, and address preserved by log file.) store, and address preserved by log file.
Like this, entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then TCP agent system is directly called, namely corresponding Java object of preserving directly is read, if and tested object to be obtained is complex object, then TCP agent system reads file corresponding to this complex object and preserves address to obtain the preservation file generated based on this complex object, and is that corresponding complex object calls again by this preservation file transform.
Adopt said method, can from the initial part of test code (namely from package part) progressively generate the interface testing code of a standard.
Consult shown in Fig. 3, in the embodiment of the present application, a kind of generating apparatus (i.e. TCP agent system) of test data, comprises communication unit 30, processing unit 31 and generation unit 32, wherein,
Communication unit 30, for receiving the request message that called side sends, mails to service side after carrying out data record, and the response message that reception server returns, and mails to called side after carrying out data record;
Processing unit 31, for carrying out unserializing process to the data of record, obtains code elements information;
Generation unit 32, for generating corresponding test code based on the code elements information obtained.
Optionally, communication unit specifically for:
When receiving the request message that called side sends, the specific field in read requests message, according to the type of the analysis result decision request message of specific field, and obtains the system domain name of service side;
If request message is for obtaining get request message, then start to record the binary data in get request message, after record, the local connection to service side is opened according to the system domain name of service side, and get request message is sent to service side by connection, and when receiving the response message of service side, the binary data of recording responses message, and be back to called side;
If request message is for issuing post request message, then open the local connection to service side according to the system domain name of service side, start to record the binary data in post request message, and circulation reading is carried out to post request message, service side is sent to successively by connecting by recording complete data division, and when receiving the response message that service side returns, the binary data of recording responses message, and circulation reading is carried out to response message, send to called side successively by recording complete data division.
Optionally, record cell specifically for:
The binary data including request message and response message of record is converted to character string, and therefrom parses the calling interface and calling device that adopt when called side is called service side;
Unserializing process is carried out to the string data obtained, obtains java applet exercisable tested object, and therefrom parse use when called side is called service side enter to join list, and service side return call result;
By the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
Optionally, generation unit specifically for:
According to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and according to the calling device that called side uses, the calling device title used in configuration testing code, calling device type and call parameters;
Enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
Optionally, generation unit is further used for:
Entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then directly call; If tested object to be obtained is complex object, then reads file corresponding to complex object and preserve address to obtain the preservation file generated based on complex object, and be call again after complex object by preservation file transform.
In sum, in the embodiment of the present application, TCP agent system carries out binary data record to transmission data in data transmission procedure, again unserializing operation is carried out to the binary data of record, obtain code elements information, and based on the test code needed for the generation of code elements information, like this, can based on the corresponding test code of real Application of Interface environment generation, thus effectively improve the formation efficiency of test code, improve validity and the accuracy of test result, also greatly save the development and maintenance cost of test code simultaneously.Further, the versatility of the embodiment of the present application is high, is applicable to various protocol interface, and simple to operate, does not need developer to have development Experience for many years, thus enters one and reduce its expansion cost.
Those skilled in the art should understand, the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.
Obviously, those skilled in the art can carry out various change and modification to the embodiment of the present application and not depart from the spirit and scope of the embodiment of the present application.Like this, if these amendments of the embodiment of the present application and modification belong within the scope of the application's claim and equivalent technologies thereof, then the application is also intended to comprise these change and modification.

Claims (10)

1. a generation method for test data, is characterized in that, comprising:
Receive the request message that called side sends, after carrying out data record, mail to service side, and the response message that reception server returns, mail to called side after carrying out data record;
Unserializing process is carried out to the data of record, obtains code elements information;
Corresponding test code is generated based on the code elements information obtained.
2. method as claimed in claim 2, is characterized in that, receives the request message that called side sends, mails to service side after carrying out data record, and the response message that reception server returns, and mails to called side, comprising after carrying out data record:
When receiving the request message that called side sends, reading the specific field in described request message, according to the type of the analysis result decision request message of described specific field, and obtaining the system domain name of service side;
If described request message is for obtaining get request message, then start to record the binary data in get request message, after record, the local connection to service side is opened according to the system domain name of service side, and get request message is sent to service side by described connection, and when receiving the response message of service side, the binary data of recording responses message, and be back to called side;
If described request message is for issuing post request message, then open the local connection to service side according to the system domain name of service side, start to record the binary data in post request message, and circulation reading is carried out to post request message, service side is sent to successively by described connection by recording complete data division, and when receiving the response message that service side returns, the binary data of recording responses message, and circulation reading is carried out to response message, send to called side successively by recording complete data division.
3. method as claimed in claim 1 or 2, is characterized in that, carries out unserializing process to the data of record, obtains code elements information, comprising:
The binary data including request message and response message of record is converted to character string, and therefrom parses the calling interface and call method that adopt when called side is called service side;
Unserializing process is carried out to the string data obtained, obtains java applet exercisable tested object, and therefrom parse use when called side is called service side enter to join list, and service side return call result;
By the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
4. method as claimed in claim 3, is characterized in that, generates corresponding test code, comprising based on the code elements information obtained:
According to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and according to the call method that called side uses, the call method title used in configuration testing code, call method type and call parameters;
Enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
5. method as claimed in claim 4, is characterized in that, comprise further:
Entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then directly call; If tested object to be obtained is complex object, then reads file corresponding to described complex object and preserve address to obtain the preservation file generated based on described complex object, and be call again after described complex object by described preservation file transform.
6. a generating apparatus for test data, is characterized in that, comprising:
Communication unit, for receiving the request message that called side sends, mails to service side after carrying out data record, and the response message that reception server returns, and mails to called side after carrying out data record;
Processing unit, for carrying out unserializing process to the data of record, obtains code elements information;
Generation unit, for generating corresponding test code based on the code elements information obtained.
7. device as claimed in claim 6, receives the request message that called side sends, mails to service side after carrying out data record, and the response message that reception server returns, when mailing to called side after carrying out data record, described communication unit specifically for:
When receiving the request message that called side sends, reading the specific field in described request message, according to the type of the analysis result decision request message of described specific field, and obtaining the system domain name of service side;
If described request message is for obtaining get request message, then start to record the binary data in get request message, after record, the local connection to service side is opened according to the system domain name of service side, and get request message is sent to service side by described connection, and when receiving the response message of service side, the binary data of recording responses message, and be back to called side;
If described request message is for issuing post request message, then open the local connection to service side according to the system domain name of service side, start to record the binary data in post request message, and circulation reading is carried out to post request message, service side is sent to successively by described connection by recording complete data division, and when receiving the response message that service side returns, the binary data of recording responses message, and circulation reading is carried out to response message, send to called side successively by recording complete data division.
8. device as claimed in claims 6 or 7, is characterized in that, carries out unserializing process to the data of record, when obtaining code elements information, described record cell specifically for:
The binary data including request message and response message of record is converted to character string, and therefrom parses the calling interface and calling device that adopt when called side is called service side;
Unserializing process is carried out to the string data obtained, obtains java applet exercisable tested object, and therefrom parse use when called side is called service side enter to join list, and service side return call result;
By the calling interface of acquisition, call method, enter to join list and call result to be defined as code elements information.
9. device as claimed in claim 8, is characterized in that, when generating corresponding test code based on the code elements information obtained, described generation unit specifically for:
According to the calling interface that the called side obtained uses, the calling interface title used in configuration testing code and calling interface type, and according to the calling device that called side uses, the calling device title used in configuration testing code, calling device type and call parameters;
Enter to join that list and service side return calls the tested object that result generates and resolve respectively to what use based on called side, acquisition enters to join title accordingly, enters to join type, enters to join assignment and result parameter title, result parameter type, result parameter assignment, and generates corresponding test code according to the information of acquisition.
10. device as claimed in claim 9, it is characterized in that, described generation unit is further used for:
Entering to join that list and service side return calls the tested object that result generates and carry out in the process of Parameter analysis of electrochemical to what use based on called side, if tested object to be obtained is plain objects, then directly call; If tested object to be obtained is complex object, then reads file corresponding to described complex object and preserve address to obtain the preservation file generated based on described complex object, and be call again after described complex object by described preservation file transform.
CN201410419779.0A 2014-08-22 2014-08-22 A kind of generation method and device of test data Active CN105446867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410419779.0A CN105446867B (en) 2014-08-22 2014-08-22 A kind of generation method and device of test data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410419779.0A CN105446867B (en) 2014-08-22 2014-08-22 A kind of generation method and device of test data

Publications (2)

Publication Number Publication Date
CN105446867A true CN105446867A (en) 2016-03-30
CN105446867B CN105446867B (en) 2019-05-28

Family

ID=55557098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410419779.0A Active CN105446867B (en) 2014-08-22 2014-08-22 A kind of generation method and device of test data

Country Status (1)

Country Link
CN (1) CN105446867B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095688A (en) * 2016-06-23 2016-11-09 微梦创科网络科技(中国)有限公司 A kind of software performance testing method and device
CN107918737A (en) * 2016-10-10 2018-04-17 北京奇虎科技有限公司 Transmission method, the apparatus and system of pressure testing data
CN109460219A (en) * 2018-09-28 2019-03-12 西南电子技术研究所(中国电子科技集团公司第十研究所) The method of rapid serial Interface Control File

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080127097A1 (en) * 2006-11-28 2008-05-29 International Business Machines Corporation Method and devices for url command testing and for scenario testing
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN101771701A (en) * 2010-01-04 2010-07-07 北京航空航天大学 Web service client automation generation method and device
CN102810069A (en) * 2012-07-16 2012-12-05 深圳市融创天下科技股份有限公司 JAVA object requesting and responding methods, devices and systems and terminal
WO2013130069A1 (en) * 2012-02-29 2013-09-06 Hewlett-Packard Development Company, L.P. Network service interface analysis
CN103312551A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Test method and test device of common gateway interface
CN103428019A (en) * 2012-05-24 2013-12-04 中兴通讯股份有限公司 Network service message management method and system
CN103580937A (en) * 2012-07-24 2014-02-12 阿里巴巴集团控股有限公司 Web service simulating method and system and service agent system thereof
CN103905258A (en) * 2012-12-24 2014-07-02 百度国际科技(深圳)有限公司 Method and apparatus for testing data uploading function of client

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080127097A1 (en) * 2006-11-28 2008-05-29 International Business Machines Corporation Method and devices for url command testing and for scenario testing
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN101771701A (en) * 2010-01-04 2010-07-07 北京航空航天大学 Web service client automation generation method and device
WO2013130069A1 (en) * 2012-02-29 2013-09-06 Hewlett-Packard Development Company, L.P. Network service interface analysis
CN103312551A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Test method and test device of common gateway interface
CN103428019A (en) * 2012-05-24 2013-12-04 中兴通讯股份有限公司 Network service message management method and system
CN102810069A (en) * 2012-07-16 2012-12-05 深圳市融创天下科技股份有限公司 JAVA object requesting and responding methods, devices and systems and terminal
CN103580937A (en) * 2012-07-24 2014-02-12 阿里巴巴集团控股有限公司 Web service simulating method and system and service agent system thereof
CN103905258A (en) * 2012-12-24 2014-07-02 百度国际科技(深圳)有限公司 Method and apparatus for testing data uploading function of client

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095688A (en) * 2016-06-23 2016-11-09 微梦创科网络科技(中国)有限公司 A kind of software performance testing method and device
CN107918737A (en) * 2016-10-10 2018-04-17 北京奇虎科技有限公司 Transmission method, the apparatus and system of pressure testing data
CN107918737B (en) * 2016-10-10 2021-09-07 北京奇虎科技有限公司 Pressure test data transmission method, device and system
CN109460219A (en) * 2018-09-28 2019-03-12 西南电子技术研究所(中国电子科技集团公司第十研究所) The method of rapid serial Interface Control File
CN109460219B (en) * 2018-09-28 2021-09-03 西南电子技术研究所(中国电子科技集团公司第十研究所) Method for quickly serializing interface control file

Also Published As

Publication number Publication date
CN105446867B (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN111159049B (en) Automatic interface testing method and system
CN107122297B (en) Method and equipment for generating request message of test interface
CN110427331B (en) Method for automatically generating performance test script based on interface test tool
CN105450476B (en) A kind of regression test system and test method
CN108650149A (en) Server testing method, device, equipment and computer readable storage medium
US20100115496A1 (en) Filter generation for load testing managed environments
CN105099811A (en) Interface testing method and device
CN103729294B (en) Method and device for testing performance script of application software
US10250721B2 (en) System and method for testing applications with a load tester and testing translator
CN107659455B (en) Method, storage medium, device and system for Mock data of iOS (internet operating system) end
CN108228444B (en) Test method and device
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN108459850B (en) Method, device and system for generating test script
CN102866944A (en) Pressure testing system and method
CN106776318A (en) A kind of test script method for recording and system
CN109783357A (en) The method and device of test application program, computer equipment, storage medium
CN114003451B (en) Interface testing method, device, system and medium
CN103246606A (en) Method and system for testing performances of ESB (enterprises service bus) platform
CN114205274A (en) Network equipment testing method and device
CN113127108A (en) Service request processing method and device, storage medium and electronic equipment
CN105446867A (en) Method and apparatus for generating test data
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN116466930A (en) Construction method, message processing method and device of intelligent customer service model and electronic equipment
CN115987821A (en) Gateway routing test method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right