Automatic Code Comments Generation Method Based on Convolutional Neural Network

Automatic code comment generation technology can analyze the semantic information of source code and generate corresponding natural language descriptions,which can help developers understand the program and reduce the time cost during software maintenance.Most of the existing technologies are based on the encoder and decoder model of the recurrent neural network(RNN).However,this method suffers from long-term dependency problem,which means it cannot generate high-quality comments when analyzing far-away code blocks.To solve this problem,this paper proposes an automatic code comment generation method,which uses the convolutional neural network(CNN) to alleviate the inaccurate comments information caused by the long-term dependence problem.More specifically,this paper uses two CNNs,one source-code based CNN and one AST-based CNN,to capture source code's semantic information.The experimental results indicate that,compared to the two most recent methods,DeepCom and Hybrid-DeepCom,the method proposed in this paper generates more useful code comments and takes less time to execute..

Medienart:

E-Artikel

Erscheinungsjahr:

2021

Erschienen:

2021

Enthalten in:

Zur Gesamtaufnahme - volume:48

Enthalten in:

Jisuanji kexue - 48(2021), 12, Seite 117-124

Sprache:

Chinesisch

Beteiligte Personen:

PENG Bin, LI Zheng, LIU Yong, WU Yong-hao [VerfasserIn]

Links:

doi.org [kostenfrei]
doaj.org [kostenfrei]
www.jsjkx.com [kostenfrei]
Journal toc [kostenfrei]

Themen:

Computer software
Program comprehension|code comment generation|convolutional neural network|long short-term memory network
Technology (General)

doi:

10.11896/jsjkx.201100090

funding:

Förderinstitution / Projekttitel:

PPN (Katalog-ID):

DOAJ075339641