Learning-Based Recursive Aggregation of Abstract Syntax Trees for Code Clone Detection
Authors:
- 1 February 2019
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 95-104
Abstract
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.Keywords
This publication has 31 references indexed in Scilit:
- Evaluating clone detection tools with BigCloneBench2015
- Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks2015
- Transfer Learning for Visual Categorization: A SurveyIEEE Transactions on Neural Networks and Learning Systems, 2014
- Code completion with statistical language modelsACM SIGPLAN Notices, 2014
- Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation2014
- Sourcerer: mining and searching internet-scale software repositoriesData Mining and Knowledge Discovery, 2008
- Clone Smells in Software Evolution2007
- DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones29th International Conference on Software Engineering (ICSE'07), 2007
- Long Short-Term MemoryNeural Computation, 1997
- SIGNATURE VERIFICATION USING A “SIAMESE” TIME DELAY NEURAL NETWORK1994