Method and device for generating function test code

A technology for testing codes and functions, applied in software testing/debugging, electrical digital data processing, error detection/correction, etc., can solve problems such as low testing efficiency, achieve the effect of solving low testing efficiency and improving testing efficiency

Active Publication Date: 2017-03-15
WUHAN DOUYU NETWORK TECH CO LTD
View PDF4 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Embodiments of the present invention provide a method and device for generating function test codes, which solve the technical problem of low test efficiency in the application program development process of the prior art, and improve test efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for generating function test code
  • Method and device for generating function test code
  • Method and device for generating function test code

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] Please refer to figure 1 , an embodiment of the present application provides a method for generating a function test code, the method comprising:

[0047] S101: the target function to be tested is set with a function test buried point, and the function test buried point is a position characterizing each component of the target function;

[0048] S102: Based on the function test buried point, read and parse the code source file of the target function, and obtain the value of the function name, function parameter, and function return type of the target function;

[0049] S103: Construct a test function of the target function based on the function name, function parameters, and value of the function return type of the target, and generate a test code file of the target function.

[0050] In the specific implementation process, in order to be able to automatically generate the test code, the embodiment of the present application first executes S101 to set buried points in ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and device for generating a function test code. The method comprises the steps that a function test burying point is set for a target function to be tested, and the function test burying point is used for representing the positions of all composition parts of the target function; based on the function test burying point, a code source file of the target function is read and analyzed, and the values of the function name, the function parameter and the function return type of the target function are obtained; based on the types of the function name, the function parameter and the function return type of the target function, a test function of the target function is constructed, and the test code file of the target function is generated. According to the technical scheme, automatic generation of the test code is achieved, developers do not need to manually compile the test code any more, therefore, the technical problem that in the application development process of the prior art, testing efficiency is low is solved, and testing efficiency is improved.

Description

technical field [0001] The invention relates to the technical field of software, in particular to a method and device for generating function test codes. Background technique [0002] With the continuous development of information technology, the development and application of application programs have developed rapidly. During the development of an application, in order to ensure the correctness of the logic in the code, test case code is usually written to detect the correctness of the function. [0003] In projects developed in the Java language, the most used testing framework is a regression testing framework written by Erich Gamma and Kent Beck: Junit unit testing framework. Using this testing framework can help developers test the correctness of functions in their code. However, this solution has a very fatal flaw, that is, all test codes need to be manually written, which will cost a lot of labor, and at the same time, the test efficiency in the development process...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684
Inventor 张磊
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products