Learning-Based Recursive Aggregation of Abstract Syntax Trees for Code Clone Detection
By Lutz Büch, Artur Andrzejak. 2019
98 citations recorded by the source corpus.
Code clone detection remains a crucial challenge in maintaining software projects. Many classic approaches rely on handcrafted aggregation schemes, while recent work uses supervised or unsupervised learning. In this work, we study several aspects of aggregation schemes for code clone detection based on supervised learning. To this aim, we implement an AST-based Recursive Neural Network. Firstly, our ablation study shows the influence of model choices and hyperparameters. We introduce error scaling as a way to effectively and efficiently address the class imbalance problem arising in code clone detection. Secondly, we study the influence of pretrained embeddings representing nodes in ASTs. We show that simply averaging all node vectors of a given AST yields strong baseline aggregation scheme. Further, learned AST aggregation schemes greatly benefit from pretrained node embeddings. Finally, we show the importance of carefully separating training and test data by clone clusters, to reliably measure generalization of models learned with supervision.
Subfields: Artificial Intelligence, Information Systems, Software, Program Analysis & Verification, Software Engineering
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Nan Duan
- Daya Guo
- Colin B. Clement
- Shujie Liu
- Ming Zhou
- Neel Sundaresan
- Alexey Svyatkovskiy
- Duyu Tang
In Information Systems
- Nan Duan
- Daya Guo
- Neel Sundaresan
- Alexey Svyatkovskiy
- Colin B. Clement
- Shuai Lu
- Shao Kun Deng
- Dawn Drain
In Software
- Neel Sundaresan
- Alexey Svyatkovskiy
- Daya Guo
- Nan Duan
- Colin B. Clement
- Shao Kun Deng
- Dawn Drain
- Michele Tufano
In Program Analysis & Verification
Citations in the corpus
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation (2021, background): “• code-code (clone detection [65, 84, 46, 80, 9, 89, 86], defect detection [91, 55, 51, 42, 78, 79], cloze test [15], code completion [57, 1, 56, 66, 67, 8, 27, 7], code repair [69, 4, 23, 26, 71, 73], and code-to-code translation [48, 37, 10, 41]) • text-code (natural language code search [32, 20, ”