Code Nano-Pattern Detection using Deep Learning

Anubhav Trivedi, Jitendra Singh Thakur, Atul Kumar Gupta · 2020

Nano-patterns are the method-level code building blocks of the code which can reveal crucial information of the code. In this paper, we present some initial results of our investigation to detect nano-patterns in a Java code using a deep learning approach. For this purpose, first, we generated a method level tagged corpus for 15 nano-patterns using nine open source Java projects. Subsequently, the tagged corpus was used to train a Long Short-Term Memory (LSTM) network to predict the nano-patterns present in the Java code. Our deep learning model gave an average accuracy of 88.3% with an average precision of 74.4% and average recall of 78.3%.

Read the paper · More papers on PaperTik