A code annotation generation method based on program analysis and a recurrent neural network

A technology of cyclic neural network and program analysis, which is applied in the field of automatic generation of code comments, can solve problems such as poor comprehensibility, increased maintenance costs, and poor program readability

Inactive Publication Date: 2019-05-21
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF4 Cites 27 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the deficiencies of the above-mentioned prior art, the purpose of the present invention is to provide a code comment generation method based on program analysis and cyclic neural network, to solve the...

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 code annotation generation method based on program analysis and a recurrent neural network
  • A code annotation generation method based on program analysis and a recurrent neural network
  • A code annotation generation method based on program analysis and a recurrent neural network

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] In order to facilitate the understanding of those skilled in the art, the present invention will be further described below in conjunction with the embodiments and accompanying drawings, and the contents mentioned in the embodiments are not intended to limit the present invention.

[0026] refer to figure 1 As shown, a method for generating code comments based on program analysis and cyclic neural network of the present invention includes the following content:

[0027] (1) Construction of the code base

[0028] The training of the neural network model is data-driven, and the ultimate goal of the present invention is to train a neural network-based code comment generation model, so it is necessary to build a large-scale code library to meet the needs of model training. Download 6705 Java projects from the open source community GitHub to build the code base. The Java project is parsed by using the abstract syntax tree, and Java methods are extracted therefrom, and the ...

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 code annotation generation method based on program analysis and a recurrent neural network. The code annotation generation method comprises the following steps: constructinga large-scale code library; Extracting information contained in each Java method in the Java project and dependency information of each Java method; Filtering and reconstructing an execution code partof each Java method by combining a heuristic method according to the extracted information; obtaining Annotations matched with the execution codes; Combining the filtered codes and corresponding annotations into a set of (codes, annotations) pairs, and taking the set as a training set of a code annotation generation model; According to the training set obtained through the steps, an Encoder-Decoder model-is used for carrying out the training of a code annotation generation model; And after model training is completed, prediction can be performed. The annotations generated by the method are concise and clear, and can help developers understand code functions, accelerate the software maintenance process and improve the quality of software products.

Description

technical field [0001] The invention belongs to the technical field of software engineering, and in particular relates to a method for automatically generating code comments for a Java method by utilizing program static analysis, natural language processing and neural network technology. Background technique [0002] With the continuous deepening of computer applications, software has gradually penetrated and integrated into various fields of the national economy, and software ecology has undergone profound changes. New software forms and development models continue to emerge, and their scale and number are expanding at an alarming rate. "Software swallows the world" "This trend has become increasingly clear, and the sharp increase in social demand has brought new challenges and opportunities to software productivity at this stage. [0003] Large-scale empirical studies have shown that more than 60% of software engineering resources are devoted to software maintenance. Soft...

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
IPC IPC(8): G06F8/30G06F8/41G06N3/08
CPCG06N3/08G06F8/30G06F8/41
Inventor 周宇闫鑫黄志球
Owner NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
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