On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformations
Autor: | Nghi D. Q. Bui, Lingxiao Jiang, Md. Rafiqul Islam Rabin, Yijun Yu, Mohammad Amin Alipour, Ke Wang |
---|---|
Jazyk: | angličtina |
Rok vydání: | 2020 |
Předmět: |
FOS: Computer and information sciences
Computer Science - Machine Learning Source code Computer science Semantics (computer science) media_common.quotation_subject Context (language use) 02 engineering and technology Machine learning computer.software_genre Machine Learning (cs.LG) Computer Science - Software Engineering Program analysis Abstract syntax 0202 electrical engineering electronic engineering information engineering Generalizability theory media_common Computer Science - Programming Languages Artificial neural network business.industry Program transformation 020207 software engineering Computer Science Applications Software Engineering (cs.SE) ComputingMethodologies_PATTERNRECOGNITION 020201 artificial intelligence & image processing Artificial intelligence business computer Software Information Systems Programming Languages (cs.PL) |
Popis: | With the prevalence of publicly available source code repositories to train deep neural network models, neural program models can do well in source code analysis tasks such as predicting method names in given programs that cannot be easily done by traditional program analysis techniques. Although such neural program models have been tested on various existing datasets, the extent to which they generalize to unforeseen source code is largely unknown. Since it is very challenging to test neural program models on all unforeseen programs, in this paper, we propose to evaluate the generalizability of neural program models with respect to semantic-preserving transformations: a generalizable neural program model should perform equally well on programs that are of the same semantics but of different lexical appearances and syntactical structures. We compare the results of various neural program models for the method name prediction task on programs before and after automated semantic-preserving transformations. We use three Java datasets of different sizes and three state-of-the-art neural network models for code, namely code2vec, code2seq, and GGNN, to build nine such neural program models for evaluation. Our results show that even with small semantically preserving changes to the programs, these neural program models often fail to generalize their performance. Our results also suggest that neural program models based on data and control dependencies in programs generalize better than neural program models based only on abstract syntax trees. On the positive side, we observe that as the size of the training dataset grows and diversifies the generalizability of correct predictions produced by the neural program models can be improved too. Our results on the generalizability of neural program models provide insights to measure their limitations and provide a stepping stone for their improvement. Information and Software Technology, IST Journal 2021, Elsevier. Related to arXiv:2004.07313 |
Databáze: | OpenAIRE |
Externí odkaz: |