Deep Learning Similarities from Different Representations of Source Code

被引:120
作者
Tufano, Michele [1 ]
Watson, Cody [1 ]
Bavota, Gabriele [2 ]
Di Penta, Massimiliano [3 ]
White, Martin [1 ]
Poshyvanyk, Denys [1 ]
机构
[1] Coll William & Mary, Williamsburg, VA 23185 USA
[2] USI, Lugano, Switzerland
[3] Univ Sannio, Benevento, Italy
来源
2018 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR) | 2018年
基金
瑞士国家科学基金会;
关键词
deep learning; code similarities; neural networks; FEATURE LOCATION;
D O I
10.1145/3196398.3196431
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Assessing the similarity between code components plays a pivotal role in a number of Software Engineering (SE) tasks, such as clone detection, impact analysis, refactoring, etc. Code similarity is generally measured by relying on manually defined or hand-crafted features, e.g., by analyzing the overlap among identifiers or comparing the Abstract Syntax Trees of two code components. These features represent a best guess at what SE researchers can utilize to exploit and reliably assess code similarity for a given task. Recent work has shown, when using a stream of identifiers to represent the code, that Deep Learning (DL) can effectively replace manual feature engineering for the task of clone detection. However, source code can be represented at different levels of abstraction: identifiers, Abstract Syntax Trees, Control Flow Graphs, and Bytecode. We conjecture that each code representation can provide a different, yet orthogonal view of the same code fragment, thus, enabling a more reliable detection of similarities in code. In this paper, we demonstrate how SE tasks can benefit from a DL-based approach, which can automatically learn code similarities from different representations.
引用
收藏
页码:542 / 553
页数:12
相关论文
共 72 条
[1]  
Allamanis M., FSE 15
[2]  
Allamanis M, 2016, PR MACH LEARN RES, V48
[3]   Mining Idioms from Source Code [J].
Allamanis, Miltiadis ;
Sutton, Charles .
22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, :472-483
[4]   Bug Localization with Combination of Deep Learning and Information Retrieval [J].
An Ngoc Lam ;
Anh Tuan Nguyen ;
Hoan Anh Nguyen ;
Nguyen, Tien N. .
2017 IEEE/ACM 25TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2017, :218-229
[5]   Automatic Categorization with Deep Neural Network for Open-Source Java']Java Projects [J].
Anh Tuan Nguyen ;
Nguyen, Tien N. .
PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, :164-166
[6]   Graph-based Statistical Language Model for Code [J].
Anh Tuan Nguyen ;
Nguyen, Tien N. .
2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 1, 2015, :858-868
[7]  
[Anonymous], 2017, ABS170502801 CORR
[8]  
Baker B., 1992, Computer Science and Statistics
[9]  
Baker B., 1996, JCSS, V52, P1
[10]  
Baker B. S., WCRE 95