DeepClone: Modeling Clones to Generate Code Predictions

07/22/2020
by   Muhammad Hammad, et al.
0

During software development, programmers often tend to reuse the code for common functionalities, available in other source code repositories. This activity helps them to reduce time and effort to develop code, instead of building it from scratch. Code clones are candidates for reuse in an exploratory or rapid development, as they represent often repeated functionality in software systems. To facilitate code clone reuse, we propose a novel approach, Deep-Clone, where we utilize a deep learning algorithm for modeling code clones and predicting the next possible set of tokens (up to the cloned method body) based on the user input so far. The generated predictions aim to potentially help developers to write code rapidly with minimum tuning of values later on. DeepClone applies natural language processing techniques to learn from a large code corpus (the BigCloneBench dataset), and generates code tokens (full clone methods where applicable) using the model learned. We have quantitatively evaluated our solution to assess (1) our model's quality and its accuracy in token prediction, and (2) its performance and effectiveness in clone method prediction. With a high quality and accurate model as the foundation, we further discuss scenarios for exploiting our approach.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset