Learning to Represent Programs with Code Hierarchies

05/31/2022
by   Minh H. Nguyen, et al.
0

Graph neural networks have been shown to produce impressive results for a wide range of software engineering tasks. Existing techniques, however, still have two issues: (1) long-term dependency and (2) different code components are treated as equals when they should not be. To address these issues, we propose a method for representing code as a hierarchy (Code Hierarchy), in which different code components are represented separately at various levels of granularity. Then, to process each level of representation, we design a novel network architecture, ECHELON, which combines the strengths of Heterogeneous Graph Transformer Networks and Tree-based Convolutional Neural Networks to learn Abstract Syntax Trees enriched with code dependency information. We also propose a novel pretraining objective called Missing Subtree Prediction to complement our Code Hierarchy. The evaluation results show that our method significantly outperforms other baselines in three tasks: any-code completion, code classification, and code clone detection.

READ FULL TEXT
research
02/20/2020

Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Tree

Code clones are semantically similar code fragments pairs that are synta...
research
09/05/2020

TreeCaps: Tree-Based Capsule Networks for Source Code Processing

Recently program learning techniques have been proposed to process sourc...
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
02/14/2018

Convolutional Neural Networks over Control Flow Graphs for Software Defect Prediction

Existing defects in software components is unavoidable and leads to not ...
research
09/16/2019

A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learning

Code completion, one of the most useful features in the integrated devel...
research
12/29/2022

Meta-Path Based Attentional Graph Learning Model for Vulnerability Detection

In recent years, deep learning (DL)-based methods have been widely used ...
research
12/06/2022

Unifying Short and Long-Term Tracking with Graph Hierarchies

Tracking objects over long videos effectively means solving a spectrum o...

Please sign up or login with your details

Forgot password? Click here to reset