CN109684188A - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN109684188A
CN109684188A CN201710975922.8A CN201710975922A CN109684188A CN 109684188 A CN109684188 A CN 109684188A CN 201710975922 A CN201710975922 A CN 201710975922A CN 109684188 A CN109684188 A CN 109684188A
Authority
CN
China
Prior art keywords
testing
measured
parameter
class identifier
information
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
CN201710975922.8A
Other languages
Chinese (zh)
Other versions
CN109684188B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710975922.8A priority Critical patent/CN109684188B/en
Publication of CN109684188A publication Critical patent/CN109684188A/en
Application granted granted Critical
Publication of CN109684188B publication Critical patent/CN109684188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Abstract

This application discloses test methods and device.One specific embodiment of this method includes: to receive the method for testing to be measured that user sends to choose information;The method name and parameter type that information determines method for testing to be measured are chosen according to the method for testing to be measured, wherein method defined in the corresponding class of class identifier that the method for testing to be measured pre-enters for the user;The parameter of the method for testing to be measured is generated according to the parameter type of the method for testing to be measured;Test request is sent to server, so that the server executes the method for testing to be measured according to the test request, wherein the test request includes the method name and parameter of the class identifier, the method for testing to be measured;The test result information that the server is sent is received, the test result information is shown.The embodiment simplifies testing procedure, improves testing efficiency.

Description

Test method and device
Technical field
This application involves field of computer technology, and in particular to the field of test technology more particularly to test method and device.
Background technique
Interface is the statement of serial of methods, when tester is connected to the row of finding the problem in a new interface or test process After finding an interface, need to test the connectivity of interface, verify this interface to correct format parameter Afterwards, simultaneously returned data can be handled.When test interface connectivity, tester is firstly the need of acquisition interface document, setup test Data build interface testing environment later, finally call interface to be tested with the test data prepared, and check to return the result and test Demonstrate,prove the connectivity of interface.Due to setup test data, builds the test processes such as environment and needs to consume the plenty of time, seriously Affect testing efficiency.
Summary of the invention
The purpose of the application is to propose a kind of improved test method and device, mentions to solve background section above To the technical issues of.
In a first aspect, the embodiment of the present application provides a kind of test method, this method comprises: receiving the to be measured of user's transmission Method for testing chooses information;The method name and parameter type that information determines method for testing to be measured are chosen according to above-mentioned method for testing to be measured, Wherein, method defined in the corresponding class of class identifier that above-mentioned method for testing to be measured pre-enters for above-mentioned user;According to above-mentioned The parameter type of method for testing to be measured generates the parameter of above-mentioned method for testing to be measured;Test request is sent to server, for above-mentioned clothes Device of being engaged according to above-mentioned test request executes above-mentioned method for testing to be measured, wherein above-mentioned test request includes above-mentioned class identifier, above-mentioned The method name and parameter of method for testing to be measured;The test result information that above-mentioned server is sent is received, above-mentioned test result is believed Breath is shown.
In some embodiments, before the method for testing to be measured of above-mentioned reception user input chooses information, the above method is also It include: to send above-mentioned server for above-mentioned class identifier in response to detecting that user inputs above-mentioned class identifier;It receives above-mentioned The method information list that server is sent, wherein above method information list is above-mentioned server generation, above-mentioned class identifier The list of the method information of method defined in corresponding class, wherein above method information includes the method name and ginseng of method Several classes of types;It shows above method information list, inputs method for testing choosing to be measured so that above-mentioned user is based on above method information list It wins the confidence breath.
In some embodiments, the above-mentioned parameter type according to above-mentioned method for testing to be measured generates the ginseng of above-mentioned method for testing to be measured Number, comprising: got parms from pre-set set of parameter values value according to the parameter type of above-mentioned method for testing to be measured, wherein Above-mentioned parameter value set includes basic data type, and data acquisition system corresponding with basic data type;Use the ginseng of acquisition The parameter of the above-mentioned method for testing to be measured of numerical generation.
Second aspect, the embodiment of the present application provide a kind of test method, this method comprises: receiving the test that terminal is sent Request, wherein above-mentioned test request includes the method name and parameter of class identifier, method for testing to be measured;It is asked according to above-mentioned test The corresponding method for testing to be measured of method name for executing above-mentioned method for testing to be measured is sought, obtains implementing result, wherein above-mentioned side to be tested Method is method defined in the corresponding class of above-mentioned class identifier;Test result letter is sent to above-mentioned terminal according to above-mentioned implementing result Breath, so that above-mentioned terminal is shown.
In some embodiments, before receiving the test request that terminal is sent, the above method further include: receive terminal hair The class identifier sent;According to above-mentioned class identifier generation method information list, wherein above method information list includes above-mentioned class The list of the method information of method defined in the corresponding class of identifier, wherein above method information includes the method name of method Title and parameter type;Above-mentioned terminal is sent by above method information list.
In some embodiments, above-mentioned according to above-mentioned class identifier generation method information list, comprising: according to above-mentioned category Know method name and the first parameter type that symbol determines each method defined in the corresponding class of above-mentioned class identifier;For above-mentioned First parameter type of each method defined in the corresponding class of class identifier, if first parameter type of this method is basic Data type, then using first parameter type of this method as the parameter type of this method;If the first parameter class of this method Type is object type, then obtains parameter type of the corresponding basic data type of object as this method;It is identified using above-mentioned class Accord with the method name and parameter type generation method information list of method defined in corresponding class.
The third aspect, the embodiment of the present application provide a kind of test device, which includes: receiving unit, for receiving The method for testing to be measured that user sends chooses information;Determination unit, it is to be measured for being determined according to above-mentioned method for testing selection information to be measured The method name and parameter type of method for testing, wherein above-mentioned method for testing to be measured is the class identifier pair that above-mentioned user pre-enters Method defined in the class answered;Generation unit, for generating above-mentioned side to be tested according to the parameter type of above-mentioned method for testing to be measured The parameter of method;Transmission unit, for sending test request to server, so that above-mentioned server is executed according to above-mentioned test request Above-mentioned method for testing to be measured, wherein above-mentioned test request includes the method name and ginseng of above-mentioned class identifier, above-mentioned method for testing to be measured Number;Display unit, the test result information sent for receiving above-mentioned server, above-mentioned test result information is shown.
In some embodiments, above-mentioned apparatus further includes display unit, and above-mentioned display unit is used for: in response to detecting use Family inputs above-mentioned class identifier, sends above-mentioned server for above-mentioned class identifier;Receive the method letter that above-mentioned server is sent Cease list, wherein above method information list is that above-mentioned server generates, is square defined in the corresponding class of above-mentioned class identifier The list of the method information of method, wherein above method information includes the method name and parameter type of method;Show the above method Information list inputs method for testing selection information to be measured so that above-mentioned user is based on above method information list.
In some embodiments, above-mentioned generation unit is further used for: according to the parameter type of above-mentioned method for testing to be measured from Get parms value in pre-set set of parameter values, wherein above-mentioned parameter value set includes basic data type, and and base The corresponding data acquisition system of notebook data type;The parameter of above-mentioned method for testing to be measured is generated using the parameter value of acquisition.
Fourth aspect, the embodiment of the present application provide a kind of test device, which includes: request reception unit, are used for Receive the test request that terminal is sent, wherein above-mentioned test request includes the method name and ginseng of class identifier, method for testing to be measured Number;Test execution unit, the method name for executing above-mentioned method for testing to be measured according to above-mentioned test request are corresponding to be tested Method obtains implementing result, wherein above-mentioned method for testing to be measured is method defined in the corresponding class of above-mentioned class identifier;Information Transmission unit, for sending test result information to above-mentioned terminal according to above-mentioned implementing result, so that above-mentioned terminal is shown.
In some embodiments, above-mentioned apparatus further include: class identifier receiving unit, for receiving the category of terminal transmission Know symbol;List generation unit, for according to above-mentioned class identifier generation method information list, wherein above method information list The list of method information including method defined in the corresponding class of above-mentioned class identifier, wherein above method information includes side The method name and parameter type of method;List transmission unit, for sending above-mentioned terminal for above method information list.
In some embodiments, above-mentioned list generation unit is further used for: determining above-mentioned class according to above-mentioned class identifier The method name and the first parameter type of each method defined in the corresponding class of identifier;It is corresponding for above-mentioned class identifier First parameter type of each method defined in class will if first parameter type of this method is basic data type Parameter type of first parameter type of this method as this method;If first parameter type of this method is object type, Then obtain parameter type of the corresponding basic data type of object as this method;Using fixed in the corresponding class of above-mentioned class identifier The method name and parameter type generation method information list of the method for justice.
5th aspect, the embodiment of the present application provide a kind of terminal, which includes: one or more processors;Storage Device, for storing one or more programs, when said one or multiple programs are executed by said one or multiple processors, So that said one or multiple processors realize the method as described in implementation any in first aspect.
6th aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence, which is characterized in that the side as described in implementation any in first aspect is realized when the computer program is executed by processor Method.
Test method provided by the embodiments of the present application and device are chosen information according to the method for testing to be measured that user sends and are determined The method name and parameter type of method for testing to be measured, then generate the ginseng of method for testing to be measured according to the parameter type of method for testing to be measured Then number sends the test request including class identifier, the method name of method for testing to be measured and parameter to server, for service Device executes method for testing to be measured, finally receives the test result information that server is sent, and test result information is shown, by It does not need to build test environment in test process, and the parameter of method for testing to be measured can be automatically generated, therefore simplify test step Suddenly, testing efficiency is improved.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the test method of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the test method of the application;
Fig. 4 is the flow chart according to another embodiment of the test method of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the test device of the application;
Fig. 6 is the structural schematic diagram according to another embodiment of the test device of the application;
Fig. 7 is adapted for the structural schematic diagram for the computer system for realizing the terminal device of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the exemplary system architecture of the embodiment of the test method or test device of the application 100。
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various client applications, such as web browser applications, purchase can be installed on terminal device 101,102,103 Species application, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 101,102,103 can be with display screen and the various electronic equipments of supporting information to show, packet Include but be not limited to smart phone, tablet computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) it is player, on knee portable Computer and desktop computer etc..
Server 105 can be to provide the server of various services, such as sent according to terminal device 101,102,103 Test request executes method for testing to be measured, and will be according to implementing result to 101,102,103 feedback test result information of terminal device.
It should be noted that test method provided by the application Fig. 2 corresponding embodiment generally by according to terminal device 101, 102, it 103 executes, correspondingly, test device is generally positioned in terminal device 101,102,103 in Fig. 5;Fig. 4 corresponding embodiment Provided test method is generally executed by server 105, and correspondingly, test device is generally positioned at server 105 in Fig. 6 In.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates the processes 200 according to one embodiment of the test method of the application.The test Method, comprising the following steps:
Step 201, it receives the method for testing to be measured that user sends and chooses information.
In the present embodiment, test method operation thereon electronic equipment (such as terminal device shown in FIG. 1 101, 102,103) method for testing to be measured that can receive user's transmission chooses information, above-mentioned method for testing to be measured choose information for choose to Method for testing to be measured defined in test interface.Above-mentioned method for testing selection information to be measured can be user and send by various modes , for example, it may be the side of the information such as the method name of method for testing to be measured is directly inputted on above-mentioned electronic equipment by user What formula was sent, it can also be and choose method name of method for testing to be measured shown in advance on above-mentioned electronic equipment etc. to believe by user What the mode of breath was sent.Above-mentioned user can refer to tester.
Step 202, the method name and parameter type that information determines method for testing to be measured are chosen according to method for testing to be measured.
In the present embodiment, above-mentioned electronic equipment can choose information according to above-mentioned method for testing to be measured and determine method for testing to be measured Method name and parameter type, wherein above-mentioned method for testing to be measured is the corresponding class of class identifier that pre-enters of above-mentioned user Defined in method.Herein, the corresponding class of above-mentioned class identifier can be JavaBean, and JavaBean is a kind of JAVA language The Reusable Module write as.The parameter type of above-mentioned method for testing to be measured can be basic data type.
Step 203, the parameter of method for testing to be measured is generated according to the parameter type of method for testing to be measured.
In the present embodiment, above-mentioned electronic equipment can adopt (example in various manners according to the parameter type of method for testing to be measured Such as, random to generate) generate the parameter of method for testing to be measured.
In some optional implementations of the present embodiment, step 203 can be specifically included:
Firstly, above-mentioned electronic equipment can be according to the parameter type of above-mentioned method for testing to be measured from pre-set parameter value collection Get parms value in conjunction, wherein above-mentioned parameter value set may include basic data type, and corresponding with basic data type Data acquisition system.A set of parameter values can be stored in advance in above-mentioned electronic equipment, may include base in the set of parameter values Notebook data type, such as Boolean type (boolean), byte (byte), character type (char), double precision (double), floating type (float), integer (int), long (long), short (short), every kind of basic data type, which respectively corresponds, stores one A data acquisition system.Above-mentioned electronic equipment can be obtained from corresponding data acquisition system according to the parameter type of above-mentioned method for testing to be measured (for example, random obtain) parameter value.If above-mentioned electronic equipment can be from for example, the parameter type of method for testing to be measured is integer The parameter value of an integer is obtained in the corresponding data acquisition system of integer at random.
Then, above-mentioned electronic equipment can also generate the parameter of above-mentioned method for testing to be measured using the parameter value obtained.For example, The parameter value that above-mentioned electronic equipment can will acquire is assembled into json (JavaScript Object Notation, JS object mark Note) format forms complete parameter.
Step 204, test request is sent to server, so that server executes method for testing to be measured according to test request.
In the present embodiment, above-mentioned electronic equipment can be by wired connection mode or radio connection to server Send test request, wherein above-mentioned server is the server where method for testing to be measured.Above-mentioned test request may include category Know the method name and parameter of symbol, method for testing to be measured.It should be pointed out that above-mentioned radio connection can include but is not limited to 3G/4G connection, WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection and Other currently known or exploitation in the future radio connections.
Step 205, the test result information that server is sent is received, test result information is shown.
In the present embodiment, above-mentioned electronic equipment can receive the test result information that above-mentioned server is sent, and should Test result information is shown, so that user checks.Above-mentioned test result information can be " passing through ", " not passing through " etc. For prompting the information of user's test result.
In some optional implementations of the present embodiment, before step 201, above-mentioned electronic equipment be can also be performed It operates below:
Firstly, sending above-mentioned server for above-mentioned class identifier in response to detecting that user inputs class identifier;
Then, above-mentioned electronic equipment can receive the method information list that above-mentioned server is sent, wherein above method letter Breath list can be the column of the method information of method defined in the corresponding class of class identifier that above-mentioned server generates, above-mentioned Table, wherein above method information may include the method name and parameter type of method;
Finally, above-mentioned electronic equipment can show above method information list, so that user is arranged based on above method information Table inputs method for testing to be measured and chooses information.For example, user can input method for testing to be measured by way of click chooses information.
With continued reference to the schematic diagram that Fig. 3, Fig. 3 are according to the application scenarios of the test method of the present embodiment.Fig. 3's In application scenarios, user sends method for testing to be measured to terminal device 301 first and chooses information;Later, terminal device 301 is according to this Method for testing to be measured chooses the method name and parameter type that information determines method for testing to be measured;Then, terminal device 301 according to this to The parameter type of test method generates the parameter of the method for testing to be measured;It is tested secondly, terminal device 301 is sent to server 302 Request, server 302 execute method for testing to be measured according to the test request, obtain implementing result;Finally, server 302 is to terminal Equipment 301 sends the test result information obtained according to implementing result, and the test result information is shown, for user It checks.
The method provided by the above embodiment of the application can automatically generate the parameter of method for testing to be measured, and test process is not It needs to build test environment, therefore simplifies testing procedure, improve testing efficiency.
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of test method.The stream of the test method Journey 400, comprising the following steps:
Step 401, the test request that terminal is sent is received.
In the present embodiment, test method operation electronic equipment (such as server 105 shown in FIG. 1) thereon can be with Pass through wired connection mode or radio connection and receive the test request that terminal is sent, wherein above-mentioned test request can be with Method name and parameter including class identifier, method for testing to be measured.
In some optional implementations of the present embodiment, before step 401, above-mentioned electronic equipment be can also be performed It operates: firstly, above-mentioned electronic equipment can receive the class identifier of terminal transmission, being set according to the above-mentioned electronics of the class identifier below It is standby to position a specific class, and the example for obtaining such.Then, above-mentioned electronic equipment can be according to above-mentioned class identifier Generation method information list, wherein above method information list may include side defined in the corresponding class of above-mentioned class identifier The list of the method information of method, wherein above method information may include the method name and parameter type of method.On finally, Above method information list can be sent to above-mentioned terminal by stating electronic equipment, so that above-mentioned terminal is shown.
It is above-mentioned according to above-mentioned class identifier generation method information list in some optional implementations, it can be specific Include:
Firstly, above-mentioned electronic equipment can be determined according to above-mentioned class identifier defined in the corresponding class of above-mentioned class identifier The method name of each method and the first parameter type, the first parameter type can be basic data type, be also possible to quote Data type (such as object), herein, above-mentioned electronic equipment can obtain above-mentioned class identifier pair using reflection mechanism first The method name of each method defined in the class answered, then for each method defined in the corresponding class of above-mentioned class identifier In each method, first parameter type of this method is obtained using reflection mechanism according to the method name of this method.
Then, for the first parameter type of each method defined in the corresponding class of above-mentioned class identifier, if the party First parameter type of method is basic data type, then using first parameter type of this method as the parameter type of this method; If first parameter type of this method is object type, ginseng of the corresponding basic data type of object as this method is obtained Several classes of types, for example, above-mentioned electronic equipment can obtain object category with recurrence when first parameter type of this method is object type Property type, until obtaining the corresponding basic data type of object.
Finally, above-mentioned electronic equipment can be used method defined in the corresponding class of above-mentioned class identifier method name and Parameter type generation method information list.
Step 402, the corresponding method for testing to be measured of the method name for executing method for testing to be measured according to test request, is executed As a result.
In the present embodiment, above-mentioned electronic equipment can execute above-mentioned to be measured according to test request received in step 401 The corresponding method for testing to be measured of the method name of method for testing, obtains implementing result, and implementing result may include occurring abnormal and not going out It is now abnormal.Herein, above-mentioned method for testing to be measured can be method defined in the corresponding class of above-mentioned class identifier, and above-mentioned electronics is set It is standby a specific class to be positioned according to the class identifier in above-mentioned test request first, then, according to above-mentioned test request In method for testing to be measured method name, corresponding side to be tested is further navigated to from method defined in the class positioned Method, finally, the parameter by the method for testing to be measured in test request calls method for testing to be measured.
Step 403, test result information is sent to terminal according to implementing result, so that terminal is shown.
In the present embodiment, above-mentioned electronic equipment can send test result to terminal according to the implementing result of step 402 Information, so that terminal is shown, for example, above-mentioned electronic equipment can be to above-mentioned terminal when implementing result is to occur abnormal The test result information for sending " not passing through ", when implementing result is not occur abnormal, above-mentioned electronic equipment can be to above-mentioned end End sends the test result information of " passing through ".
Figure 4, it is seen that the process 400 of the test method in the present embodiment is held according to the test request that terminal is sent Row method for testing to be measured, obtains implementing result, therefore do not need tester and build test environment, therefore simplify testing procedure, Improve testing efficiency.
With further reference to Fig. 5, as the realization to method shown in above-mentioned Fig. 2, this application provides a kind of test devices One embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to various electricity In sub- equipment.
As shown in figure 5, the test device 500 of the present embodiment includes: receiving unit 501, determination unit 502, generation unit 503, transmission unit 504 and display unit 505.Wherein, the method for testing to be measured that receiving unit 501 is used to receive user's transmission is chosen Information;Determination unit 502 is used to choose the method name and parameter that information determines method for testing to be measured according to above-mentioned method for testing to be measured Type, wherein method defined in the corresponding class of class identifier that above-mentioned method for testing to be measured pre-enters for above-mentioned user;It generates Unit 503 is used to generate the parameter of above-mentioned method for testing to be measured according to the parameter type of above-mentioned method for testing to be measured;Transmission unit 504 is used In sending test request to server, so that above-mentioned server executes above-mentioned method for testing to be measured according to above-mentioned test request, wherein Above-mentioned test request includes the method name and parameter of above-mentioned class identifier, above-mentioned method for testing to be measured;Display unit 505 is for connecing The test result information that above-mentioned server is sent is received, above-mentioned test result information is shown.
In the present embodiment, the receiving unit 501 of test device 500, determination unit 502, generation unit 503, transmission are single The specific processing of member 504 and display unit 505 and its brought technical effect can be respectively with reference to steps in Fig. 2 corresponding embodiment 201, the related description of step 202, step 203, step 204 and step 205, details are not described herein.
In some optional implementations of the present embodiment, above-mentioned apparatus 500 can also be including display unit (in figure not Show), above-mentioned display unit is used for: in response to detecting that user inputs above-mentioned class identifier, being sent above-mentioned class identifier to Above-mentioned server;Receive the method information list that above-mentioned server is sent, wherein above method information list is above-mentioned server The list of method information generate, method defined in the corresponding class of above-mentioned class identifier, wherein above method information includes The method name and parameter type of method;Above method information list is shown, so that above-mentioned user is arranged based on above method information Table inputs method for testing to be measured and chooses information.
In some optional implementations of the present embodiment, above-mentioned generation unit 503 can be further used for: according to upper The parameter type for stating method for testing to be measured gets parms value from pre-set set of parameter values, wherein above-mentioned parameter value set Including basic data type, and data acquisition system corresponding with basic data type;Using acquisition parameter value generate it is above-mentioned to The parameter of test method.
With further reference to Fig. 6, as the realization to method shown in above-mentioned Fig. 4, this application provides a kind of test devices One embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 4, which specifically can be applied to various electricity In sub- equipment.
As shown in fig. 6, the test device 600 of the present embodiment includes: request reception unit 601,602 and of test execution unit Information transmitting unit 603.Wherein, request reception unit 601 is used to receive the test request of terminal transmission, wherein above-mentioned test Request includes the method name and parameter of class identifier, method for testing to be measured;Test execution unit 602 according to above-mentioned test for asking The corresponding method for testing to be measured of method name for executing above-mentioned method for testing to be measured is sought, obtains implementing result, wherein above-mentioned side to be tested Method is method defined in the corresponding class of above-mentioned class identifier;Information transmitting unit 603 is used for upward according to above-mentioned implementing result It states terminal and sends test result information, so that above-mentioned terminal is shown.
In the present embodiment, the request reception unit 601 of test device 600, test execution unit 602 and information send single Member 603 it is specific processing and its brought technical effect can respectively refer to Fig. 4 corresponding embodiment in step 401, step 402 and The related description of step 403, details are not described herein.
In some optional implementations of the present embodiment, above-mentioned apparatus 600 can also include: that class identifier receives list First (not shown), for receiving the class identifier of terminal transmission;List generation unit (not shown), for according to State class identifier generation method information list, wherein above method information list includes fixed in the corresponding class of above-mentioned class identifier The list of the method information of the method for justice, wherein above method information includes the method name and parameter type of method;List hair Unit (not shown) is sent, for sending above-mentioned terminal for above method information list.
In some optional implementations of the present embodiment, above-mentioned list generation unit can be further used for: according to Above-mentioned class identifier determines the method name and the first parameter type of each method defined in the corresponding class of above-mentioned class identifier; For the first parameter type of each method defined in the corresponding class of above-mentioned class identifier, if the first parameter class of this method Type is basic data type, then using first parameter type of this method as the parameter type of this method;If the of this method One parameter type is object type, then obtains parameter type of the corresponding basic data type of object as this method;Using upper State the method name and parameter type generation method information list of method defined in the corresponding class of class identifier.
Below with reference to Fig. 7, it illustrates the computer systems 700 for the terminal device for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.Terminal device shown in Fig. 7 is only an example, function to the embodiment of the present application and should not use model Shroud carrys out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU, Central Processing Unit) 701, it can be according to the program being stored in read-only memory (ROM, Read Only Memory) 702 or from storage section 708 programs being loaded into random access storage device (RAM, Random Access Memory) 703 and execute various appropriate Movement and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data.CPU 701,ROM 702 and RAM 703 is connected with each other by bus 704.Input/output (I/O, Input/Output) interface 705 is also connected to Bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode Spool (CRT, Cathode Ray Tube), liquid crystal display (LCD, Liquid Crystal Display) etc. and loudspeaker Deng output par, c 707;Storage section 708 including hard disk etc.;And including such as LAN (local area network, Local Area Network) the communications portion 709 of the network interface card of card, modem etc..Communications portion 709 is via such as internet Network executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to from the calculating read thereon Machine program is mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 709, and/or from detachable media 711 are mounted.When the computer program is executed by central processing unit (CPU) 701, limited in execution the present processes Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination. The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires electrical connection, Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang Any appropriate combination stated.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include receiving unit, determination unit, generation unit, transmission unit and display unit.Wherein, the title of these units is in certain situation Under do not constitute restriction to the unit itself, for example, receiving unit be also described as " receive user send it is to be tested The unit of method selection information ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should Device: it receives the method for testing to be measured that user sends and chooses information;Information, which is chosen, according to above-mentioned method for testing to be measured determines side to be tested The method name and parameter type of method, wherein above-mentioned method for testing to be measured is that the class identifier that above-mentioned user pre-enters is corresponding Method defined in class;The parameter of above-mentioned method for testing to be measured is generated according to the parameter type of above-mentioned method for testing to be measured;To server Test request is sent, so that above-mentioned server executes above-mentioned method for testing to be measured according to above-mentioned test request, wherein above-mentioned test is asked Ask method name and parameter including above-mentioned class identifier, above-mentioned method for testing to be measured;Receive the test knot that above-mentioned server is sent Above-mentioned test result information is shown by fruit information.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (14)

1. a kind of test method, which is characterized in that the described method includes:
It receives the method for testing to be measured that user sends and chooses information;
Choose the method name and parameter type that information determines method for testing to be measured according to the method for testing to be measured, wherein it is described to Method defined in the corresponding class of class identifier that test method pre-enters for the user;
The parameter of the method for testing to be measured is generated according to the parameter type of the method for testing to be measured;
Test request is sent to server, so that the server executes the method for testing to be measured according to the test request, In, the test request includes the method name and parameter of the class identifier, the method for testing to be measured;
The test result information that the server is sent is received, the test result information is shown.
2. the method according to claim 1, wherein the method for testing to be measured in the reception user input chooses letter Before breath, the method also includes:
In response to detecting that user inputs the class identifier, the server is sent by the class identifier;
Receive the method information list that the server is sent, wherein the method information list be the server generate, The list of the method information of method defined in the corresponding class of the class identifier, wherein the method information includes method Method name and parameter type;
It shows the method information list, inputs method for testing selection letter to be measured so that the user is based on the method information list Breath.
3. method according to claim 1, which is characterized in that described to generate institute according to the parameter type of the method for testing to be measured State the parameter of method for testing to be measured, comprising:
It is got parms from pre-set set of parameter values value according to the parameter type of the method for testing to be measured, wherein described Set of parameter values includes basic data type, and data acquisition system corresponding with basic data type;
The parameter of the method for testing to be measured is generated using the parameter value of acquisition.
4. a kind of test method, which is characterized in that the described method includes:
Receive the test request that terminal is sent, wherein the test request includes the method name of class identifier, method for testing to be measured And parameter;
The corresponding method for testing to be measured of method name for executing the method for testing to be measured according to the test request, obtains executing knot Fruit, wherein the method for testing to be measured is method defined in the corresponding class of the class identifier;
Test result information is sent to the terminal according to the implementing result, so that the terminal is shown.
5. according to the method described in claim 4, it is characterized in that, receive terminal send test request before, the side Method further include:
Receive the class identifier that terminal is sent;
According to the class identifier generation method information list, wherein the method information list includes the class identifier pair The list of the method information of method defined in the class answered, wherein the method information includes the method name and parameter of method Type;
The terminal is sent by the method information list.
6. according to the method described in claim 5, it is characterized in that, described arrange according to the class identifier generation method information Table, comprising:
According to the class identifier determine the corresponding class of the class identifier defined in each method method name and first Parameter type;
For the first parameter type of each method defined in the corresponding class of the class identifier, if the first of this method joins Several classes of types are basic data type, then using first parameter type of this method as the parameter type of this method;If this method The first parameter type be object type, then obtain parameter type of the corresponding basic data type of object as this method;
Use the method name and parameter type generation method information list of method defined in the corresponding class of the class identifier.
7. a kind of test device, which is characterized in that described device includes:
Receiving unit, the method for testing to be measured for receiving user's transmission choose information;
Determination unit, for choosing the method name and parameter class that information determines method for testing to be measured according to the method for testing to be measured Type, wherein method defined in the corresponding class of class identifier that the method for testing to be measured pre-enters for the user;
Generation unit, for generating the parameter of the method for testing to be measured according to the parameter type of the method for testing to be measured;
Transmission unit, for sending test request to server, so that the server is according to test request execution Method for testing to be measured, wherein the test request includes the method name and parameter of the class identifier, the method for testing to be measured;
Display unit, the test result information sent for receiving the server, the test result information is shown.
8. device according to claim 7, which is characterized in that described device further includes display unit, the display unit For:
In response to detecting that user inputs the class identifier, the server is sent by the class identifier;
Receive the method information list that the server is sent, wherein the method information list be the server generate, The list of the method information of method defined in the corresponding class of the class identifier, wherein the method information includes method Method name and parameter type;
It shows the method information list, inputs method for testing selection letter to be measured so that the user is based on the method information list Breath.
9. device according to claim 7, which is characterized in that the generation unit is further used for:
It is got parms from pre-set set of parameter values value according to the parameter type of the method for testing to be measured, wherein described Set of parameter values includes basic data type, and data acquisition system corresponding with basic data type;
The parameter of the method for testing to be measured is generated using the parameter value of acquisition.
10. a kind of test device, which is characterized in that described device includes:
Request reception unit, for receive terminal transmission test request, wherein the test request include class identifier, to The method name and parameter of test method;
Test execution unit, the method name for executing the method for testing to be measured according to the test request are corresponding to be tested Method obtains implementing result, wherein the method for testing to be measured is method defined in the corresponding class of the class identifier;
Information transmitting unit, for sending test result information to the terminal according to the implementing result, for the terminal It is shown.
11. device according to claim 10, which is characterized in that described device further include:
Class identifier receiving unit, for receiving the class identifier of terminal transmission;
List generation unit, for according to the class identifier generation method information list, wherein the method information list packet Include the list of the method information of method defined in the corresponding class of the class identifier, wherein the method information includes method Method name and parameter type;
List transmission unit, for sending the terminal for the method information list.
12. device according to claim 11, which is characterized in that the list generation unit is further used for:
According to the class identifier determine the corresponding class of the class identifier defined in each method method name and first Parameter type;
For the first parameter type of each method defined in the corresponding class of the class identifier, if the first of this method joins Several classes of types are basic data type, then using first parameter type of this method as the parameter type of this method;If this method The first parameter type be object type, then obtain parameter type of the corresponding basic data type of object as this method;
Use the method name and parameter type generation method information list of method defined in the corresponding class of the class identifier.
13. a kind of terminal, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Realize such as method as claimed in any one of claims 1-3.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Such as method as claimed in any one of claims 1-3 is realized when processor executes.
CN201710975922.8A 2017-10-19 2017-10-19 Test method and device Active CN109684188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710975922.8A CN109684188B (en) 2017-10-19 2017-10-19 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710975922.8A CN109684188B (en) 2017-10-19 2017-10-19 Test method and device

Publications (2)

Publication Number Publication Date
CN109684188A true CN109684188A (en) 2019-04-26
CN109684188B CN109684188B (en) 2022-04-12

Family

ID=66182895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710975922.8A Active CN109684188B (en) 2017-10-19 2017-10-19 Test method and device

Country Status (1)

Country Link
CN (1) CN109684188B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618927A (en) * 2019-06-20 2019-12-27 北京无限光场科技有限公司 Method and apparatus for testing applications
CN110716877A (en) * 2019-09-30 2020-01-21 拉扎斯网络科技(上海)有限公司 Automatic test method, device, computer system and readable storage medium
CN111563035A (en) * 2020-04-22 2020-08-21 腾讯科技(成都)有限公司 Test result display method, device, equipment and storage medium
CN111752834A (en) * 2020-06-24 2020-10-09 京东数字科技控股有限公司 Automatic testing method and device
CN112037861A (en) * 2020-09-15 2020-12-04 中国科学院微生物研究所 Method and device for processing microorganism information analysis result, electronic device and medium
CN113138912A (en) * 2020-01-17 2021-07-20 北京京东振世信息技术有限公司 Interface testing method and system, client and server
CN117118962A (en) * 2023-07-25 2023-11-24 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001265594A (en) * 2000-03-15 2001-09-28 Nippon Telegr & Teleph Corp <Ntt> Program function managing device, function managing method and recording medium with program for performing the method recorded thereon
CN104731566A (en) * 2013-12-19 2015-06-24 华为软件技术有限公司 Testing device, method and system for IDE (Integrated Development Environment)
CN106021112A (en) * 2016-05-31 2016-10-12 腾讯科技(深圳)有限公司 Program testing system, method and device
CN107239392A (en) * 2016-03-29 2017-10-10 腾讯科技(深圳)有限公司 A kind of method of testing, device and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001265594A (en) * 2000-03-15 2001-09-28 Nippon Telegr & Teleph Corp <Ntt> Program function managing device, function managing method and recording medium with program for performing the method recorded thereon
CN104731566A (en) * 2013-12-19 2015-06-24 华为软件技术有限公司 Testing device, method and system for IDE (Integrated Development Environment)
CN107239392A (en) * 2016-03-29 2017-10-10 腾讯科技(深圳)有限公司 A kind of method of testing, device and terminal
CN106021112A (en) * 2016-05-31 2016-10-12 腾讯科技(深圳)有限公司 Program testing system, method and device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618927A (en) * 2019-06-20 2019-12-27 北京无限光场科技有限公司 Method and apparatus for testing applications
CN110716877A (en) * 2019-09-30 2020-01-21 拉扎斯网络科技(上海)有限公司 Automatic test method, device, computer system and readable storage medium
CN113138912A (en) * 2020-01-17 2021-07-20 北京京东振世信息技术有限公司 Interface testing method and system, client and server
CN113138912B (en) * 2020-01-17 2023-09-22 北京京东振世信息技术有限公司 Interface testing method and system, client and server
CN111563035A (en) * 2020-04-22 2020-08-21 腾讯科技(成都)有限公司 Test result display method, device, equipment and storage medium
CN111563035B (en) * 2020-04-22 2023-05-12 腾讯科技(成都)有限公司 Test result display method, device, equipment and storage medium
CN111752834A (en) * 2020-06-24 2020-10-09 京东数字科技控股有限公司 Automatic testing method and device
CN112037861A (en) * 2020-09-15 2020-12-04 中国科学院微生物研究所 Method and device for processing microorganism information analysis result, electronic device and medium
CN117118962A (en) * 2023-07-25 2023-11-24 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms
CN117118962B (en) * 2023-07-25 2024-03-22 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms

Also Published As

Publication number Publication date
CN109684188B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN109684188A (en) Test method and device
CN109460513A (en) Method and apparatus for generating clicking rate prediction model
CN108459953A (en) test method and device
CN109815105A (en) Applied program testing method and device based on Btrace
CN109995877A (en) Information-pushing method and device
CN108958992A (en) test method and device
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN109992732A (en) Information sharing method, device, electronic equipment and storage medium
CN109062563A (en) Method and apparatus for generating the page
CN109510881A (en) Method, apparatus, electronic equipment and the readable storage medium storing program for executing of sharing files
CN108959087A (en) test method and device
CN109241722A (en) For obtaining method, electronic equipment and the computer-readable medium of information
CN110007936A (en) Data processing method and device
CN109408748A (en) Method and apparatus for handling information
CN109818994A (en) Information processing method and device for agent side
CN109688086A (en) Authority control method and device for terminal device
CN109218041A (en) Request processing method and device for server system
CN109656799A (en) Test method and device
CN107347093A (en) Collocation method and device for distributed server system
CN108694120A (en) The method and apparatus of testing service component
CN110389899A (en) Detect square law device, medium and the equipment of the API data type of JS program
CN109614327A (en) Method and apparatus for output information
CN108182180A (en) For generating the method and apparatus of information
CN109144864A (en) Method and device for test window
CN110489326A (en) HTTPAPI adjustment method device, medium and equipment based on IDS

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant