Back to Search Start Over

Suggesting method names based on graph neural network with salient information modelling.

Authors :
Kuang, Li
Ge, Fan
Zhang, Lingyan
Source :
Expert Systems. Jul2022, Vol. 39 Issue 6, p1-17. 17p.
Publication Year :
2022

Abstract

Descriptive method names have a great impact on improving program readability and facilitating software maintenance. Recently, due to high similarity between the task of method naming and text summarization, large amount of research based on natural language processing has been conducted to generate method names. However, method names are much shorter compared to long source code sequences. The salient information of the whole code snippet account for an relatively small part. Additionally, unlike natural language, source code has complicated structure information. Thus, modelling the salient information from highly structured input presents a great challenge. To tackle this problem, we propose a graph neural network (GNN)‐based model with a novel salient information selection layer. Specifically, to comprehensively encode the tokens of the source code, we employ a GNN‐based encoder, which can be directly applied to the code graph to ensure that the syntactic information of code structure and semantic information of code sequence can be modelled sufficiently. To effectively discriminate the salient information, we introduce an information selection layer which contains two parts: a global filter gate used to filter irrelevant information, and a semantic‐aware convolutional layer used to focus on the semantic information contained in code sequence. To improve the precision of the copy mechanism when decoding, we introduce a salient feature enhanced attention mechanism to facilitate the accuracy of copying tokens from input. Experimental results on an open source dataset indicate that our proposed model, equipped with the salient information selection layer, can effectively improve method naming performance compared to other state‐of‐the‐art models. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
02664720
Volume :
39
Issue :
6
Database :
Academic Search Index
Journal :
Expert Systems
Publication Type :
Academic Journal
Accession number :
157616538
Full Text :
https://doi.org/10.1111/exsy.13030