funcGNN: A Graph Neural Network Approach to Program Similarity

07/26/2020
by   Aravind Nair, et al.
0

Program similarity is a fundamental concept, central to the solution of software engineering tasks such as software plagiarism, clone identification, code refactoring and code search. Accurate similarity estimation between programs requires an in-depth understanding of their structure, semantics and flow. A control flow graph (CFG), is a graphical representation of a program which captures its logical control flow and hence its semantics. A common approach is to estimate program similarity by analysing CFGs using graph similarity measures, e.g. graph edit distance (GED). However, graph edit distance is an NP-hard problem and computationally expensive, making the application of graph similarity techniques to complex software programs impractical. This study intends to examine the effectiveness of graph neural networks to estimate program similarity, by analysing the associated control flow graphs. We introduce funcGNN, which is a graph neural network trained on labeled CFG pairs to predict the GED between unseen program pairs by utilizing an effective embedding vector. To our knowledge, this is the first time graph neural networks have been applied on labeled CFGs for estimating the similarity between high-level language programs. Results: We demonstrate the effectiveness of funcGNN to estimate the GED between programs and our experimental analysis demonstrates how it achieves a lower error rate (0.00194), with faster (23 times faster than the quickest traditional GED approximation method) and better scalability compared with the state of the art methods. funcGNN posses the inductive learning ability to infer program structure and generalise to unseen programs. The graph embedding of a program proposed by our methodology could be applied to several related software engineering problems (such as code plagiarism and clone identification) thus opening multiple research directions.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/16/2018

Graph Edit Distance Computation via Graph Neural Networks

Graph similarity search is among the most important graph-based applicat...
research
12/24/2021

A Neural Framework for Learning Subgraph and Graph Similarity Measures

Subgraph similarity search is a fundamental operator in graph analysis. ...
research
10/24/2022

Scalable Program Clone Search Through Spectral Analysis

We consider the problem of program clone search, i.e. given a target pro...
research
04/29/2019

Graph Matching Networks for Learning the Similarity of Graph Structured Objects

This paper addresses the challenging problem of retrieval and matching o...
research
02/07/2021

Graph Neural Network to Dilute Outliers for Refactoring Monolith Application

Microservices are becoming the defacto design choice for software archit...
research
03/18/2015

Exploration of the scalability of LocFaults approach for error localization with While-loops programs

A model checker can produce a trace of counterexample, for an erroneous ...
research
03/18/2015

Exploration of the scalability of LocFaults

A model checker can produce a trace of counterexample, for an erroneous ...

Please sign up or login with your details

Forgot password? Click here to reset