DeepSim: deep learning code functional similarity

By Gang Zhao, Jeff Huang. 2018

288 citations recorded by the source corpus.

Measuring code similarity is fundamental for many software engineering tasks, e.g., code search, refactoring and reuse. However, most existing techniques focus on code syntactical similarity only, while measuring code functional similarity remains a challenging problem. In this paper, we propose a novel approach that encodes code control flow and data flow into a semantic matrix in which each element is a high dimensional sparse binary feature vector, and we design a new deep learning model that measures code functional similarity based on this representation. By concatenating hidden representations learned from a code pair, this new model transforms the problem of detecting functionally similar code to binary classification, which can effectively learn patterns between functionally similar code with very different syntactics. We have implemented our approach, DeepSim, for Java programs and evaluated its recall, precision and time performance on two large datasets of functionally similar code. The experimental results show that DeepSim significantly outperforms existing state-of-the-art techniques, such as DECKARD, RtvNN, CDLH, and two baseline deep neural networks models.

Subfields: Information Systems, Software, Program Analysis & Verification, Signal Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Michael Pradel
  2. Ge Li
  3. Zhi Jin
  4. Shaohua Wang
  5. Yi Li
  6. Georgios Gousios
  7. Tien Nhut Nguyen
  8. Satish Chandra

In Software

  1. Michael Pradel
  2. Shaohua Wang
  3. Yi Li
  4. Tien Nhut Nguyen
  5. Ge Li
  6. Zhi Jin
  7. Satish Chandra
  8. Georgios Gousios

In Program Analysis & Verification

  1. Shaohua Wang
  2. Yi Li
  3. Tien Nhut Nguyen
  4. Georgios Gousios
  5. Michael Pradel
  6. Satish Chandra
  7. Jason Liu
  8. Ge Li

In Signal Processing

  1. Michael Pradel
  2. Ge Li
  3. Georgios Gousios
  4. Satish Chandra
  5. Jason Liu
  6. Zhi Jin
  7. Tien Nhut Nguyen
  8. Shaohua Wang

Citations in the corpus