A Method of Automatically Generating Functional Descriptive Comments for Program Source Code

An automatic generation and source code technology, applied in the computer field, can solve the problems of source code feature extraction defects, failure to extract programming language features and characteristics, etc., to achieve the effect of promoting maintenance and development, and comprehensive description

Inactive Publication Date: 2021-03-09
SHANGHAI JIAOTONG UNIV
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Iyer (see Iyer, S.; Konstas, I.; Cheung, A.; and Zettlemoyer, L. 2016. Summarizing source code using ing a neural attention model. In ACL, 2073–2083) proposed a method using neural networks The method of training data to generate annotations, but this method still treats the source code as ordinary text, and does not extract any unique features and characteristics of programming languages, which exist in the source code feature extraction defect

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
  • A Method of Automatically Generating Functional Descriptive Comments for Program Source Code
  • A Method of Automatically Generating Functional Descriptive Comments for Program Source Code
  • A Method of Automatically Generating Functional Descriptive Comments for Program Source Code

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0046] The present invention will be described in detail below in conjunction with specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0047] Such as figure 1 As shown, a method for automatically generating function descriptive annotations for program source codes provided by the present invention includes:

[0048] Step 1: Extract the features of the source code;

[0049]Step 2: Analyze the extracted features, and automatically express the features about functions in natural language.

[0050] Step 1 includes:

[0051] Step 1.1: Construct the corresponding parse tree according to the structural information of the source code and 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 provides a method for automatically generating function descriptive annotations for program source codes, comprising: step 1: extracting features of source code; step 2: analyzing the extracted features, and automatically expressing features about functions in natural language. The invention can automatically generate corresponding function descriptive comments for various programming languages, well expresses the functions and functions of source codes, and can effectively promote software maintenance and development. Compared with the prior art, the present invention has the following beneficial effects: 1. Compared with other methods, the present invention can characterize the characteristics of the source code more comprehensively by processing the parse tree of the source code and extracting features, not only 2. The present invention no longer relies on fixed templates when generating annotations. Compared with other methods, it is more flexible and diverse, and the generated annotations can also express more functions, and the description is more comprehensive; 3. The present invention is applicable to Various programming languages ​​are universal.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method for automatically generating function descriptive annotations for program source codes. Background technique [0002] With the rapid development of the Internet, software development has become more and more popular and accompanied by a large number of open source code libraries. Reading and understanding other people's source code in the software development process is a time-consuming and labor-intensive task. If the source code can have corresponding functional descriptive comments, this process will be greatly simplified and the speed of software development will be accelerated. At the same time, perfect comments can also improve the maintainability of the software system. However, in the current situation, less than 20% of the code has corresponding comments, so the majority of program developers urgently need a method to automatically generate functional descrip...

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): G06F8/41
CPCG06F8/427
Inventor 朱其立梁玉鼎
Owner SHANGHAI JIAOTONG UNIV
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