TY - GEN
T1 - A Neural Model for Method Name Generation from Functional Description
AU - Gao, Sa
AU - Chen, Chunyang
AU - Xing, Zhenchang
AU - Ma, Yukun
AU - Song, Wen
AU - Lin, Shang Wei
N1 - Publisher Copyright:
© 2019 IEEE.
PY - 2019/3/15
Y1 - 2019/3/15
N2 - The names of software artifacts, e.g., method names, are important for software understanding and maintenance, as good names can help developers easily understand others' code. However, the existing naming guidelines are difficult for developers, especially novices, to come up with meaningful, concise and compact names for the variables, methods, classes and files. With the popularity of open source, an enormous amount of project source code can be accessed, and the exhaustiveness and instability of manually naming methods could now be relieved by automatically learning a naming model from a large code repository. Nevertheless, building a comprehensive naming system is still challenging, due to the gap between natural language functional descriptions and method names. Specifically, there are three challenges: how to model the relationship between the functional descriptions and formal method names, how to handle the explosion of vocabulary when dealing with large repositories, and how to leverage the knowledge learned from large repositories to a specific project. To answer these questions, we propose a neural network to directly generate readable method names from natural language description. The proposed method is built upon the encoder-decoder framework with the attention and copying mechanisms. Our experiments show that our method can generate meaningful and accurate method names and achieve significant improvement over the state-of-The-Art baseline models. We also address the cold-start problem using a training trick to utilize big data in Github for specific projects.
AB - The names of software artifacts, e.g., method names, are important for software understanding and maintenance, as good names can help developers easily understand others' code. However, the existing naming guidelines are difficult for developers, especially novices, to come up with meaningful, concise and compact names for the variables, methods, classes and files. With the popularity of open source, an enormous amount of project source code can be accessed, and the exhaustiveness and instability of manually naming methods could now be relieved by automatically learning a naming model from a large code repository. Nevertheless, building a comprehensive naming system is still challenging, due to the gap between natural language functional descriptions and method names. Specifically, there are three challenges: how to model the relationship between the functional descriptions and formal method names, how to handle the explosion of vocabulary when dealing with large repositories, and how to leverage the knowledge learned from large repositories to a specific project. To answer these questions, we propose a neural network to directly generate readable method names from natural language description. The proposed method is built upon the encoder-decoder framework with the attention and copying mechanisms. Our experiments show that our method can generate meaningful and accurate method names and achieve significant improvement over the state-of-The-Art baseline models. We also address the cold-start problem using a training trick to utilize big data in Github for specific projects.
KW - Encoder-Decoder Model
KW - Naming Convention
KW - Transfer Learning
UR - http://www.scopus.com/inward/record.url?scp=85064159567&partnerID=8YFLogxK
U2 - 10.1109/SANER.2019.8667994
DO - 10.1109/SANER.2019.8667994
M3 - Conference contribution
AN - SCOPUS:85064159567
T3 - SANER 2019 - Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution, and Reengineering
SP - 411
EP - 421
BT - SANER 2019 - Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution, and Reengineering
A2 - Shihab, Emad
A2 - Lo, David
A2 - Wang, Xinyu
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 26th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2019
Y2 - 24 February 2019 through 27 February 2019
ER -