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

  1. Nan Duan
  2. Daya Guo
  3. Colin B. Clement
  4. Shujie Liu
  5. Ming Zhou
  6. Neel Sundaresan
  7. Alexey Svyatkovskiy
  8. Duyu Tang

In Information Systems

  1. Nan Duan
  2. Daya Guo
  3. Neel Sundaresan
  4. Alexey Svyatkovskiy
  5. Colin B. Clement
  6. Shuai Lu
  7. Shao Kun Deng
  8. Dawn Drain

In Software

  1. Neel Sundaresan
  2. Alexey Svyatkovskiy
  3. Daya Guo
  4. Nan Duan
  5. Colin B. Clement
  6. Shao Kun Deng
  7. Dawn Drain
  8. Michele Tufano

In Program Analysis & Verification

  1. Ge Li
  2. Neel Sundaresan
  3. Daya Guo
  4. Michele Tufano
  5. Nan Duan
  6. Alexey Svyatkovskiy

Citations in the corpus