Deep Learning Based Identification of Suspicious Return Statements

Guangjie Li, Hui Liu*, Jiahao Jin, Qasim Umer

*此作品的通讯作者

科研成果: 书/报告/会议事项章节会议稿件同行评审

9 引用 (Scopus)

摘要

Identifiers in source code are composed of terms in natural languages. Such terms, as well as phrases composed of such terms, convey rich semantics that could be exploited for program analysis and comprehension. To this end, in this paper we propose a deep learning based approach, called MLDetector, to identifying suspicious return statements by leveraging semantics conveyed by the natural language phrases that are used as identifiers in the source code. We specially design a deep neural network to tell whether a given return statement matches its corresponding method signature. The rationale is that both method signature and return value should explicitly specify the output of the method, and thus a significant mismatch between method signature and return value may suggest a suspicious return statement. To address the challenge of lacking negative training data, i.e., incorrect return statements, we generate negative training data automatically by transforming real-world correct return statements. To feed code into neural network, we convert them into vectors by Word2Vec, an unsupervised neural network based learning algorithm. We evaluate the proposed approach in two parts. In the first part, we evaluate it on 500 open-source applications by automatically generating labeled training data. Results suggest that the precision of the proposed approach varies from 83% to 90%. In the second part, we conduct a case study on 100 real-world applications. Evaluation results suggest that 42 out of 65 real-world incorrect return statements are detected (with precision of 59%).

源语言英语
主期刊名SANER 2020 - Proceedings of the 2020 IEEE 27th International Conference on Software Analysis, Evolution, and Reengineering
编辑Kostas Kontogiannis, Foutse Khomh, Alexander Chatzigeorgiou, Marios-Eleftherios Fokaefs, Minghui Zhou
出版商Institute of Electrical and Electronics Engineers Inc.
480-491
页数12
ISBN(电子版)9781728151434
DOI
出版状态已出版 - 2月 2020
活动27th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2020 - London, 加拿大
期限: 18 2月 202021 2月 2020

出版系列

姓名SANER 2020 - Proceedings of the 2020 IEEE 27th International Conference on Software Analysis, Evolution, and Reengineering

会议

会议27th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2020
国家/地区加拿大
London
时期18/02/2021/02/20

指纹

探究 'Deep Learning Based Identification of Suspicious Return Statements' 的科研主题。它们共同构成独一无二的指纹。

引用此