[go: up one dir, main page]

CN106502896A - A kind of generation method of function test code and device - Google Patents

A kind of generation method of function test code and device Download PDF

Info

Publication number
CN106502896A
CN106502896A CN201610921921.0A CN201610921921A CN106502896A CN 106502896 A CN106502896 A CN 106502896A CN 201610921921 A CN201610921921 A CN 201610921921A CN 106502896 A CN106502896 A CN 106502896A
Authority
CN
China
Prior art keywords
function
test
parameter
value
name
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
CN201610921921.0A
Other languages
Chinese (zh)
Other versions
CN106502896B (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.)
Chengdu Everx Technology Co.,Ltd.
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201610921921.0A priority Critical patent/CN106502896B/en
Publication of CN106502896A publication Critical patent/CN106502896A/en
Application granted granted Critical
Publication of CN106502896B publication Critical patent/CN106502896B/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/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of function tests the generation method of code and device, the method includes:Arrange function test to bury a little to object function to be tested, position a little for each ingredient of the sign object function is buried in the function test;Buried a little based on function test, read and parse the code source file of the object function, the function name of the acquisition object function, function parameter, the value of function return type;Based on the function name of the target, function parameter, function return type value, construct the test function of the object function, and generate the test code file of the object function.In by above-mentioned technical proposal, it is achieved that test code is automatically generated, it is no longer necessary to which developer writes test code manually, so as to solve testing efficiency low technical problem in the process of application development of prior art, testing efficiency is improve.

Description

A kind of generation method of function test code and device
Technical field
The present invention relates to software technology field, more particularly to a kind of generation method of function test code and device.
Background technology
With the continuous development of information technology, the exploitation of application program and application obtain development at full speed.Application program In development process, in order to ensure the correctness of logic in code, it will usually write test case code for detection function function Correctness.
In the project of Java language exploitation, the use of most test frame compiled by Erich Gamma and Kent Beck The regression testing framework that writes:Junit unit testing frameworks.Developer's test code can be helped using the test frame The correctness of middle function performance.But, this scheme has a very fatal defect, that is, all of test code is all needed Manually to write, thus can spend substantial amounts of human cost, simultaneously as manually write test code dropping significantly Testing efficiency in low development process.
It can be seen that, there is the low technical problem of testing efficiency in the process of application development of prior art.
Content of the invention
The embodiment of the present invention provides a kind of generation method of function test code and device, solves the application journey of prior art There is the low technical problem of testing efficiency in sequence development process, improve testing efficiency.
The embodiment of the present application provides the generation method that a kind of function tests code, and methods described includes:
Arrange function test to bury a little to object function to be tested, the function test is buried a little as the sign object function The position of each ingredient;
Buried a little based on function test, read and parse the code source file of the object function, obtain the target The function name of function, function parameter, the value of function return type;
Based on the function name of the target, function parameter, function return type value, construct the survey of the object function Trial function, and generate the test code file of the object function.
Optionally, described to object function arrange function test bury a little, including:
Function test is arranged to the function name of the object function, function parameter, return type respectively to bury a little.
Optionally, described test based on the function is buried a little, reads and parses the code source file of the object function, wrap Include:
The source file that the object function is opened by document reading manner;
The source file of opening is converted to inlet flow, function test is obtained from inlet flow and buries burying and indicate a little Symbol;
The target data between the corresponding original position mark of an indications and end position mark is buried described in reading;
The target data is returned class as the corresponding function name of an indications, function parameter or the function of burying Type.
Optionally, described based on the function name of the target, function parameter, function return type value, construction is described The test function of object function, including:
Based on the function name that the value of the function name of the object function constructs the test function;
Parsed by data interchange format JSON, the corresponding all parameters of the value of function parameter in the acquisition object function Value, the function parameter for constructing the test function by all parameter values;
Arrange and receive and preserve the test letter with the value identical variable of the function return type of the object function Several function return values.
Optionally, the test code file for generating the object function, including:
By the function name of the test function, function parameter, function return value and the printing function return value work( The information write of energy is described to be tested in code file.
The embodiment of the present application also provides the generating means that a kind of function tests code, and described device includes:
Dot element being buried, being buried a little for function test is arranged to object function to be tested, it be a little table that the function test is buried Levy the position of each ingredient of the object function;
Resolution unit, for burying a little based on function test, reads and parses the code source file of the object function, Obtain the function name of the object function, function parameter, the value of function return type;
Signal generating unit, for based on the function name of the target, function parameter, function return type value, construct institute The test function of object function is stated, and generates the test code file of the object function.
Optionally, described bury dot element, be used for:Respectively to the function name of the object function, function parameter, return class Type arranges function test and buries a little.
Optionally, the resolution unit, including:
Subelement is opened, for the source file of the object function is opened by document reading manner;
Subelement is obtained, and for the source file of opening is converted to inlet flow, the function test is obtained from inlet flow Bury a little bury an indications;
Subelement is read, for reading described burying between the corresponding original position mark of an indications and end position mark Target data;The target data is returned as the corresponding function name of an indications, function parameter or the function of burying Return type.
Optionally, the signal generating unit, including:
Title constructs subelement, and the value for the function name based on the object function constructs the letter of the test function Several titles;
Parametric configuration subelement, for parsing by data interchange format JSON, obtains function ginseng in the object function The corresponding all parameter values of several values, the function parameter for constructing the test function by all parameter values;
Return value constructs subelement, and the value identical variable for arranging with the function return type of the object function comes Receive and preserve the function return value of the test function.
Optionally, the signal generating unit, is additionally operable to:The function name of the test function, function parameter, function are returned Value and print the function return value function information write described test code file in.
Said one or multiple technical schemes in the embodiment of the present application, at least imitates with following one or more technology Really:
The embodiment of the present application provides the generation method that a kind of function tests code, arranges function to object function to be tested Test is buried a little, and buries a function name for reading and parsing object function, function parameter and function return class based on function test The value of type, and then the value construction test function of the function name according to object function, function parameter and function return type life Into test code file, it is achieved that test automatically generating for code, it is no longer necessary to which developer writes test code manually, so as to The low technical problem of testing efficiency in the process of application development of prior art is solved, testing efficiency is improve.
Description of the drawings
A kind of flow chart of the generation method of function test code that Fig. 1 is provided for the embodiment of the present application;
Reading and the flow chart of parsing code source file that Fig. 2 is provided for the embodiment of the present application;
The schematic diagram of the generation test code file that Fig. 3 is provided for the embodiment of the present application;
Fig. 4 tests the generating means of code for a kind of function that the embodiment of the present application is provided.
Specific embodiment
In the technical scheme that the embodiment of the present application is provided, buried by arranging function test to object function to be tested Point, reads and parses each ingredient of object function, and each ingredient construction test function according to object function, life Into test code file, realize that test code is automatically generated, caused by solving in prior art because writing manually and to test code The low technical problem of testing efficiency.
Principle, specific embodiment and its corresponding are realized to the main of the embodiment of the present application technical scheme below in conjunction with the accompanying drawings The beneficial effect that can be reached is explained in detail.
Embodiment one
Fig. 1 is refer to, the embodiment of the present application provides the generation method that a kind of function tests code, and the method includes:
S101:Arrange function test to bury a little to object function to be tested, the function test is buried a little as the sign mesh The position of each ingredient of scalar functions;
S102:Buried a little based on function test, read and parse the code source file of the object function, obtained described The function name of object function, function parameter, the value of function return type;
S103:Based on the function name of the target, function parameter, function return type value, construct the target letter Several test functions, and generate the test code file of the object function.
In specific implementation process, test code is automatically generated in order to side, the embodiment of the present application is first carried out S101 Carry out burying a setting in source code.Function test is set and buries and started with burying an indications Test description information.Wherein, it is the word for distinguishing the variable or function of object function place application program to bury an indications Symbol, and the operation of application program is not affected, for example:In Java grammers, variable or function etc. all can not be started using@, then @can be used in java applet as burying an indications.It should be noted that the embodiment of the present application is not intended to limit buries an indications Concrete form, the program for becoming language using difference, it is possible to use different buries an indications such as assumes # in C++ programs Cannot be used for the beginning of variable or function, then can be using # as burying an indications in C++ programs.
Below with Junit unit testing frameworks under, carry out burying a little with the trial function to be measured in source code in java applet As a example by, the setting of burying that the embodiment of the present application is provided is described in detail.
One function has generally comprised three ingredients:1st, function name;2nd, function parameter;3rd, function return value, so right Function carries out burying when arranging, and can arrange function test respectively to function name, function parameter and function return type and bury a little, The setting that is buried a little by these three function tests just can accurately identify a function very much, parse life in order to follow-up to which Into corresponding test code.
Function test is buried a little is used for the position for characterizing each ingredient of object function, including:An indications is buried, and mark is buried Show that the corresponding original position mark of symbol and end position are identified, for example:@funName:[function name] ,@funParam:[function Parameter] ,@return:[return type], " [" and "] " is respectively the corresponding original position marks of@and end position is identified, that is, exist Target data in " [" and "] " is the function data for needing to be read out and parse.
a)@funName:[function name]
Understand to bury for convenience and a little watch attentively rule, above-mentioned form is exemplified below:@funName:[addFun], it is right to represent The function (addFun is specific function name) of addFun carries out burying a note, buries Then analysis generates the corresponding test code of the function.
b)@funParam:[function parameter]
Likewise, form is exemplified below:@funParam:[A], representing carries out burying a note to parameter A, needs to the ginseng Number A carries out parsing and generates corresponding test code.
By JSON, ((JavaScript Object Notation, are one to function parameter wherein in " [function parameter] " The data interchange format of kind of lightweight) form to be being described.JSON can very easily describe one or more object Specifying information.Very easily multiple parameters can be described clearly by JSON.
For example:Following form is describing the information of Person parameters:
JSON character strings above are explained as follows:
Param1:Param1 represents first parameter, and it is exactly that param is several to have several parameters.It is to the ginseng inside Param1 Several descriptions, the parameter in example in Param1 are Person.
Person:It is a customization type, the content inside following Person is the description to Person, wherein retouches It is 10 years old to have stated age (age), and name (name) is tom, and height (height) is 180.
Param2:Param2 represents the second parameter of the incoming function, and this parameter only becomes comprising a hobby Amount, its value is play.
c)@return:[return type]
If a function has return value so to carry out burying a little the return value by@return sentences, such as:@ return:[String], the declaration of will function of the words have return value, and return value is String types.
For the object function that is a little provided with is buried, execute S102 and read and parse the code source file of object function, have Body implementation process is as follows:
Step 1, the source file for opening object function by document reading manner.
Wherein, specifically can be realized by File classes (tool-class that Java language JDK is carried), for example:By calling File file=File (filePath) (File is method name, and filePath represents the absolute path that file is located), with regard to energy Enough by corresponding for filePath File Open, and it is file by the file designation that opens.
Step 2, the source file of opening is converted to inlet flow, function test is obtained from inlet flow and buries burying and indicate a little Symbol.
Specifically, fileInputStream=new FileInputStream (file) can be adopted, file is changed Become inlet flow, and inlet flow be named as fileInputStream) for inlet flow fileInputStream, can adopt Go to read a line in file line by line with readline methods (reading the functional based method of a full line of file corresponding to inlet flow) Information.Using read line by line be exactly circulation go call the readline methods in fileInputStream, and will read The data of current line are saved in the variable lineString of String types.
In lineString, by calling contains ("@") method, (the method major function is to judge the character string In whether comprising this character string of@) judging whether this buries an indications comprising@in current line.If comprising@this Indications, then continue the data for reading next line, as shown in Figure 2.The data for reading next line are equally called Readline methods in fileInputStream.If containing this indications execution step 3 of@.
Step 3, reading bury the target data between the corresponding original position mark of an indications and end position mark.
Due to read this indications, illustrate in this line comprising the information for needing parsing.The step in then need The position of indications in lineString to be determined.In lineString can by call indexOf ("@") function come The positional information of positioning indications@, this function major function are to return to this character string position of@in lineString Information (is assumed to represent this position with pos1).From the beginning of this position of pos1, then taken out by way of searching loop All data within first " [] " next symbol, as shown in Figure 2.From the beginning of this position of pos1, a word is once taken out Symbol (obtains the string value of pos1 using the function of charAt (pos1), each positional value adds 1 in cyclic process), then sentences Break this character whether and " ["or"] ", the two characters are equal.And if " [" is equal, then record from that point on Data below.And if "] " equal, then stop recording data.From the beginning of at the mark of starting position, to end position mark Terminate at knowledge, the data for reading are exactly the truthful data value for needing to obtain, i.e. target data.
Step 4, using target data as burying the corresponding function name of an indications, function parameter or function return type Value.If@followed by character string be funName, then the target data in@first " [] " symbol below is then The value of function name;If@followed by character string be funParam, then the target in@first " [] " symbol below Data value then for function parameter;If@followed by character string be return, then in@first " [] " symbol below Target data then for function return type value.
It should be noted that:In order to subsequent descriptions are convenient, funName is come representative function title@for the embodiment of the present application The concrete value information of funName;With returnValue come the concrete value information of representative function return type return;With ParamValue carrys out the concrete value information of representative function parameter funParam.
After S102, values of the S103 based on the function name, function parameter, function return type for reading, construction is executed The test function of object function, and generate the test code file of object function.
Fig. 3 is refer to, the test function of object function is constructed, is specifically included following steps:
S31:Based on the function name that the value of the function name of object function constructs test function.
Have determined that by the parsing of S102 above it is funName to need the object function title that tests, for Uniform Name It is testfunName that rule can construct the title of test function, is exactly before interpolation test before original function name Sew, its main purpose is for clear and definite test function function and Uniform Name rule.The embodiment of the present application is not intended to limit test letter The concrete name of several function names, or t-funName, funNametest etc..
S32:Parsed by data interchange format JSON, the corresponding all parameters of the value of function parameter in acquisition object function Value, the function parameter for constructing test function by all parameter values.
As function parameter is the JSON forms of standard, (current techique) can be parsed by JSON, be parsed All of parameter value in paramValue, then constructs the function parameter of test function according to the value for parsing.Example Such as:The information of above-mentioned Person parameters, the occurrence parsed in Person include:"age":"10","name":"tom"," height":180, then by the constructed fuction instantiation Person objects of Person out.
S33:Arrange and receive and preserve test function with the value identical variable of the function return type of object function Function return value.
Have confirmed that what the returned data of object function is by returnValue, to this end it is possible to use, same type Variable is carried out being received and saved in returnValue2 to the value of the return type of test function.Function return value is printed Come, by the printf System.println (" returnValue2 ") of system, (this function major function is to print, will Information in bracket is printed on control station), the return value of function is printed in control station.
By the construction of above-mentioned test function, the function name of test function, function parameter, function return value is obtained, Next, generating the test code file of object function.Specifically, by the function name of above-mentioned test function, function parameter, letter The information such as number return value and printing return value function is all written in file.The mode of write file is to pass through FileWriter classes (tool-class that JDK is provided) are completed.By the write functions that call in FileWriter, (function is main Function is write information in file), corresponding information is written in file.
The operation of write file is as follows:
1st, the constructed fuction by FileWriter classes obtains FileWriter objects, and constructed fuction is (for example: FileWriter("C:\\demo1.java",false);) in need to transmit 2 parameters:First parameter:It is to need write text The position of part, that is, the file for writing;Second parameter:Whether file continues (namely file appending write), if true It is exactly to add write, if false is exactly to restart to write.
2nd, the constructed fuction of FileWriter obtains the object fw of a FileWriter after returning, and has one inside fw Write functions, the major function of this function is write file operation.(for example:Fw.write (" writing some information "), this Sample will be in the content of double quotation marks write file).
3rd, after file write is finished, inside fw, there is a close function, after calling close functions, system can be closed Close the resources such as the resource occupation of corresponding file operation, the internal memory of releasing document read-write.
Achieve automatization in the generation method that code is tested by a kind of function that above-described embodiment is provided generate test The function of code, can greatly save the time that developer writes test code, greatly improve the survey in development process Examination efficiency.
Same inventive concept is based on, the embodiment of the present application is also tested the generation method of code, correspondingly carried based on above-mentioned function For the generating means that a kind of function tests code, as shown in figure 4, the device includes:
Dot element 41 being buried, being buried a little for function test is arranged to object function to be tested, the function test is buried and is a little Characterize the position of each ingredient of the object function;
Resolution unit 42, for burying a little based on function test, reads and parses the code source document of the object function Part, the function name of the acquisition object function, function parameter, the value of function return type;
Signal generating unit 43, for based on the function name of the target, function parameter, function return type value, construction The test function of the object function, and generate the test code file of the object function.
In specific implementation process, described bury dot element 41, be used for:Respectively to the function name of the object function, letter Number parameter, return type arrange function test and bury a little.
The resolution unit 42 includes:Subelement is opened, subelement is obtained and is read subelement.Opening subelement is used for leading to Cross the source file that document reading manner opens the object function;Obtaining subelement is used for for the source file of opening being converted to input Stream, obtain from inlet flow function test bury a little bury an indications;Read subelement and be used for reading and described bury a sign Accord with the target data between corresponding original position mark and end position mark;The target data is buried a mark as described Show the corresponding function name of symbol, function parameter or function return type.
The signal generating unit 43, including:Title construction subelement, parametric configuration subelement and return value construction subelement. Title construction subelement is used for the function name that the value of the function name based on the object function constructs the test function;Ginseng Number construction subelement is used for parsing by data interchange format JSON, and the value for obtaining function parameter in the object function is corresponding All parameter values, the function parameter for constructing the test function by all parameter values;Return value construction subelement is used for Arrange the function of the test function is received and preserve with the value identical variable of the function return type of the object function Return value.
The signal generating unit 43 generate test code file when, specifically for:By the function name of the test function, The information write of function parameter, function return value and the printing function return value function is described to be tested in code file.
Device in regard to above-described embodiment, wherein unit execute the concrete mode of operation in relevant the method Embodiment in be described in detail, explanation will be not set forth in detail herein.
One or more technical schemes in by the embodiment of the present application, it is possible to achieve one or more technology are imitated as follows Really:
The embodiment of the present application provides the generation method that a kind of function tests code, arranges function to object function to be tested Test is buried a little, and buries a function name for reading and parsing object function, function parameter and function return class based on function test The value of type, and then the value construction test function of the function name according to object function, function parameter and function return type life Into test code file, it is achieved that test automatically generating for code, it is no longer necessary to which developer writes test code manually, so as to The low technical problem of testing efficiency in the process of application development of prior art is solved, testing efficiency is improve.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can adopt complete hardware embodiment, complete software embodiment or with reference to software and hardware in terms of reality Apply the form of example.And, the present invention can be adopted in one or more computers for wherein including computer usable program code The upper computer program that implements of usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) is produced The form of product.
The present invention is the flow process with reference to method according to embodiments of the present invention, equipment (system) and computer program Figure and/or block diagram are describing.It should be understood that can be by computer program instructions flowchart and/or each stream in block diagram Journey and/or the combination of square frame and flow chart and/or the flow process in block diagram and/or square frame.These computer programs can be provided Instruct the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices The device of the function of specifying in present one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in and can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory is produced to be included referring to Make the manufacture of device, the command device realize in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or The function of specifying in multiple square frames.
These computer program instructions can be also loaded in computer or other programmable data processing devices so that in meter Series of operation steps is executed on calculation machine or other programmable devices to produce computer implemented process, so as in computer or The instruction executed on other programmable devices is provided for realization in one flow process of flow chart or multiple flow processs and/or block diagram one The step of function of specifying in individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described Property concept, then can make other change and modification to these embodiments.So, claims are intended to be construed to include excellent Select embodiment and fall into the had altered of the scope of the invention and change.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (10)

1. a kind of function tests the generation method of code, it is characterised in that methods described includes:
Arrange function test to bury a little to object function to be tested, the function test is buried a little as the sign object function each group Position into part;
Buried a little based on function test, read and parse the code source file of the object function, obtain the object function Function name, function parameter, the value of function return type;
Based on the function name of the target, function parameter, function return type value, construct the test letter of the object function Number, and generate the test code file of the object function.
2. the method for claim 1, it is characterised in that described object function is arranged function test bury a little, including:
Function test is arranged to the function name of the object function, function parameter, return type respectively to bury a little.
3. method as claimed in claim 2, it is characterised in that described buried a little based on function test, read and parse institute The code source file of object function is stated, including:
The source file that the object function is opened by document reading manner;
The source file of opening is converted to inlet flow, obtain from inlet flow function test bury a little bury an indications;
The target data between the corresponding original position mark of an indications and end position mark is buried described in reading;
The target data is buried the corresponding function name of an indications, function parameter or function return type as described.
4. the method for claim 1, it is characterised in that described based on the function name of the target, function parameter, letter The value of number return type, constructs the test function of the object function, including:
Based on the function name that the value of the function name of the object function constructs the test function;
Parsed by data interchange format JSON, the corresponding all parameter values of the value of function parameter in the acquisition object function, The function parameter that the test function is constructed by all parameter values;
Arrange and receive and preserve the test function with the value identical variable of the function return type of the object function Function return value.
5. method as claimed in claim 4, it is characterised in that the test code file of the generation object function, bag Include:
By the function name of the test function, function parameter, function return value and the printing function return value function In the information write test code file.
6. a kind of function tests the generating means of code, it is characterised in that described device includes:
Dot element being buried, being buried a little for function test is arranged to object function to be tested, the function test is buried a little as sign institute State the position of each ingredient of object function;
Resolution unit, for being buried a little based on function test, is read and is parsed the code source file of the object function, obtain The function name of the object function, function parameter, the value of function return type;
Signal generating unit, for based on the function name of the target, function parameter, function return type value, construct the mesh The test function of scalar functions, and generate the test code file of the object function.
7. device as claimed in claim 6, it is characterised in that described bury dot element, be used for:
Function test is arranged to the function name of the object function, function parameter, return type respectively to bury a little.
8. device as claimed in claim 7, it is characterised in that the resolution unit, including:
Subelement is opened, for the source file of the object function is opened by document reading manner;
Subelement is obtained, and for the source file of opening is converted to inlet flow, the function test is obtained from inlet flow and is buried a little Bury an indications;
Subelement is read, for reading the mesh buried between the corresponding original position mark of an indications and end position mark Mark data;The target data is returned class as the corresponding function name of an indications, function parameter or the function of burying Type.
9. device as claimed in claim 6, it is characterised in that the signal generating unit, including:
Title constructs subelement, and the value for the function name based on the object function constructs the function name of the test function Claim;
Parametric configuration subelement, for parsing by data interchange format JSON, obtains function parameter in the object function Be worth corresponding all parameter values, the function parameter for the test function being constructed by all parameter values;
Return value constructs subelement, receives with the value identical variable of the function return type of the object function for arranging And preserve the function return value of the test function.
10. device as claimed in claim 9, it is characterised in that the signal generating unit, is additionally operable to:
By the function name of the test function, function parameter, function return value and the printing function return value function In the information write test code file.
CN201610921921.0A 2016-10-21 2016-10-21 A kind of generation method and device of function test code Active CN106502896B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610921921.0A CN106502896B (en) 2016-10-21 2016-10-21 A kind of generation method and device of function test code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610921921.0A CN106502896B (en) 2016-10-21 2016-10-21 A kind of generation method and device of function test code

Publications (2)

Publication Number Publication Date
CN106502896A true CN106502896A (en) 2017-03-15
CN106502896B CN106502896B (en) 2019-08-23

Family

ID=58318602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610921921.0A Active CN106502896B (en) 2016-10-21 2016-10-21 A kind of generation method and device of function test code

Country Status (1)

Country Link
CN (1) CN106502896B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133174A (en) * 2017-05-04 2017-09-05 浙江路港互通信息技术有限公司 Test case code automatically generating device and method
CN108984612A (en) * 2018-06-12 2018-12-11 中国平安人寿保险股份有限公司 Acquisition methods, device, computer equipment and the storage medium of target SQL statement
CN110209386A (en) * 2019-05-17 2019-09-06 北京奇艺世纪科技有限公司 The acquisition methods and device that data bury setting method a little, bury point data
CN110471830A (en) * 2018-05-10 2019-11-19 武汉斗鱼网络科技有限公司 A kind of program testing method, device and electronic equipment
CN110858172A (en) * 2018-08-23 2020-03-03 北京京东尚科信息技术有限公司 A kind of automatic test code generation method and device
WO2020082558A1 (en) * 2018-10-26 2020-04-30 深圳壹账通智能科技有限公司 Function name-based breakpoint setting method, device, computer apparatus, and storage medium
CN111190807A (en) * 2018-11-14 2020-05-22 杭州萤石软件有限公司 Buried point testing method and device
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN111813648A (en) * 2019-06-03 2020-10-23 北京嘀嘀无限科技发展有限公司 A kind of automated testing method, device, storage medium and electronic equipment applied to App
CN111913888A (en) * 2020-09-09 2020-11-10 中移(杭州)信息技术有限公司 Function generation method, automatic test method, electronic device, and storage medium
CN113139190A (en) * 2020-01-17 2021-07-20 Oppo广东移动通信有限公司 Program file detection method and device, electronic equipment and storage medium
CN113688031A (en) * 2021-07-15 2021-11-23 上海浦东发展银行股份有限公司 Testing positioning method based on byte code enhancement technology
CN114328276A (en) * 2022-03-10 2022-04-12 北京车智赢科技有限公司 Test case generation method and device, and test case display method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101802792A (en) * 2007-09-14 2010-08-11 空中客车运营简易股份公司 Method for automatic script generation for testing the validity of operational software of a system onboard and aircraft and device for implementing the same
CN102591777A (en) * 2012-01-10 2012-07-18 深圳市同洲视讯传媒有限公司 Unit test code generation method and device
CN103914370A (en) * 2012-12-31 2014-07-09 百度国际科技(深圳)有限公司 XML (Extensive Markup Language) configuration file based test method and device
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101802792A (en) * 2007-09-14 2010-08-11 空中客车运营简易股份公司 Method for automatic script generation for testing the validity of operational software of a system onboard and aircraft and device for implementing the same
CN102591777A (en) * 2012-01-10 2012-07-18 深圳市同洲视讯传媒有限公司 Unit test code generation method and device
CN103914370A (en) * 2012-12-31 2014-07-09 百度国际科技(深圳)有限公司 XML (Extensive Markup Language) configuration file based test method and device
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133174A (en) * 2017-05-04 2017-09-05 浙江路港互通信息技术有限公司 Test case code automatically generating device and method
CN110471830B (en) * 2018-05-10 2022-06-21 武汉斗鱼网络科技有限公司 Program testing method and device and electronic equipment
CN110471830A (en) * 2018-05-10 2019-11-19 武汉斗鱼网络科技有限公司 A kind of program testing method, device and electronic equipment
CN108984612A (en) * 2018-06-12 2018-12-11 中国平安人寿保险股份有限公司 Acquisition methods, device, computer equipment and the storage medium of target SQL statement
CN108984612B (en) * 2018-06-12 2024-02-02 中国平安人寿保险股份有限公司 Method and device for acquiring target SQL statement, computer equipment and storage medium
CN110858172A (en) * 2018-08-23 2020-03-03 北京京东尚科信息技术有限公司 A kind of automatic test code generation method and device
WO2020082558A1 (en) * 2018-10-26 2020-04-30 深圳壹账通智能科技有限公司 Function name-based breakpoint setting method, device, computer apparatus, and storage medium
CN111190807A (en) * 2018-11-14 2020-05-22 杭州萤石软件有限公司 Buried point testing method and device
CN111190807B (en) * 2018-11-14 2023-08-18 杭州萤石软件有限公司 Buried point testing method and equipment
CN110209386B (en) * 2019-05-17 2023-07-21 北京奇艺世纪科技有限公司 Method for setting buried point of data, method and device for acquiring buried point data
CN110209386A (en) * 2019-05-17 2019-09-06 北京奇艺世纪科技有限公司 The acquisition methods and device that data bury setting method a little, bury point data
CN111813648A (en) * 2019-06-03 2020-10-23 北京嘀嘀无限科技发展有限公司 A kind of automated testing method, device, storage medium and electronic equipment applied to App
CN111209195B (en) * 2019-12-30 2023-08-15 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN113139190A (en) * 2020-01-17 2021-07-20 Oppo广东移动通信有限公司 Program file detection method and device, electronic equipment and storage medium
CN111913888A (en) * 2020-09-09 2020-11-10 中移(杭州)信息技术有限公司 Function generation method, automatic test method, electronic device, and storage medium
CN113688031A (en) * 2021-07-15 2021-11-23 上海浦东发展银行股份有限公司 Testing positioning method based on byte code enhancement technology
CN113688031B (en) * 2021-07-15 2024-03-26 上海浦东发展银行股份有限公司 Test positioning method based on byte code enhancement technology
CN114328276A (en) * 2022-03-10 2022-04-12 北京车智赢科技有限公司 Test case generation method and device, and test case display method and device
CN114328276B (en) * 2022-03-10 2022-05-20 北京车智赢科技有限公司 Test case generation method and device, and test case display method and device

Also Published As

Publication number Publication date
CN106502896B (en) 2019-08-23

Similar Documents

Publication Publication Date Title
CN106502896B (en) A kind of generation method and device of function test code
US7828551B2 (en) Method and system for computer based testing using customizable templates
US9082309B1 (en) Dynamic question template system and architecture
CN109871326A (en) Method and device for recording a script
CN108388515A (en) Test data generating method, device, equipment and computer readable storage medium
US20230195825A1 (en) Browser extension with automation testing support
CN110221959B (en) Application program testing method, device and computer readable medium
CN107506190A (en) XML file amending method and device based on Spring frameworks
Núñez et al. A model-driven approach for the development of native mobile applications focusing on the data layer
Stocco et al. Why creating web page objects manually if it can be done automatically?
CN105743736A (en) Automated testing method and system
CN111143228B (en) Test code generation method and device based on decision table method
CN103631783A (en) Method and system for generating front end page
CN111427760B (en) Page test method, device, equipment and storage medium
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN110211581A (en) A kind of laboratory automatic speech recognition record identification system and method
CN109977020A (en) A kind of automated testing method
CN112433929B (en) Web page debugging method, device, computer equipment and storage medium
CN112380133A (en) Method and device for simulating instruction set simulator by using function library
CN107797917A (en) Performance test script generation method and device
Melo et al. Using docker to assist Q&A forum users
CN107741905B (en) Test case, analytic model thereof, execution method, storage medium and processor
Bafna et al. Review on study and usage of mern stack for web development
CN112860584A (en) Test method and device based on workflow model
CN114721932A (en) Data processing method, device, equipment and storage medium

Legal Events

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

Effective date of registration: 20240918

Address after: No. 513, 5th Floor, Building 20, No. 1201, Section 2, Lushan Avenue, Wan'an Street, Tianfu New Area, Chengdu City, Sichuan Province 610000 China (Sichuan) Pilot Free Trade Zone

Patentee after: Chengdu Everx Technology Co.,Ltd.

Country or region after: China

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China