Method and device for generating function test code

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

Active Publication Date: 2019-08-23
WUHAN DOUYU NETWORK TECH CO LTD
View PDF4 Cites 0 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 , the embodiment of the present application provides a method for generating a function test code, the method comprising:

[0047] S101: Setting a function test buried point for the target function to be tested, where the function test buried point is a position representing 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 value of the function name, function parameters, and 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 test codes, the embodiment of the present application first executes S101 to set buried points in th...

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 been developed rapidly. In the development process of the application program, in order to ensure the correctness of the logic in the code, the test case code is usually written to detect the correctness of the function function. [0003] In Java language development projects, the most used test framework is a regression test framework written by Erich Gamma and Kent Beck: Junit unit test framework. Using this testing framework can help developers test the correctness of functions in the 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 costs. At the same time, the manual test code writing ...

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 Patents(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