Generating class name in sequential manner using convolution attention neural network

Publications

Generating class name in sequential manner using convolution attention neural network

Author : Dr Sawan Rai

Year : 2022

Publisher : Elsevier Ltd

Source Title : Expert Systems with Applications

Document Type :

Abstract

Software code comprehension is strongly dependent on identifier names; therefore, software developers spend a lot of time assigning suitable names to identifiers. Manually suggesting a good name is a time taking and hard problem for developers. For automatic identifiers name recommendation, various techniques have been proposed. Most of the work has been done for method name prediction. We found very few research works on class name recommendation. A good class name communicates the class’s intent, whereas bad ones create confusion and frustration in the developer’s mind. In this paper, we first analyze the existing class name recommendation approach for dynamically typed language. In this approach, we represent the nature or behavior of python classes in quantitative form using the embedding concept for heterogeneous graphs. Next, we use these embeddings to suggest class names. The first approach can only suggest the existing class names. Therefore, we propose a new approach, which is based on the convolution attention model. In the new approach, we try to generate class name as a token sequence, instead of whole class name at once. We use two variants of the attention mechanism: simple attention and copy attention. Copy attention based model is able to predict out-of-vocab tokens during prediction. Experimental results suggest that the convolution attention model can predict accurate class name tokens.