On the Impact of Multiple Source Code Representations on Software Engineering Tasks -- An Empirical Study

Karthik Chandra Swarna, Noble Saji Mathews, Dheeraj Vagavolu, Sridhar Chimalakonda
6/21/2021
10 citations
cs.SE

Official code: NobleMathews/mocktail-blend (10 stars, Python, last commit 2022-11-06). 1 more implementation below.

Abstract

Efficiently representing source code is crucial for various software engineering tasks such as code classification and clone detection. Existing approaches primarily use Abstract Syntax Tree (AST), and only a few focus on semantic graphs such as Control Flow Graph (CFG) and Program Dependency Graph (PDG), which contain information about source code that AST does not.

Show full abstract

Even though some works tried to utilize multiple representations, they do not provide any insights about the costs and benefits of using multiple representations. The primary goal of this paper is to discuss the implications of utilizing multiple code representations, specifically AST, CFG, and PDG. We modify an AST path-based approach to accept multiple representations as input to an attention-based model. We do this to measure the impact of additional representations (such as CFG and PDG) over AST. We evaluate our approach on three tasks: Method Naming, Program Classification, and Clone Detection. Our approach increases the performance on these tasks by 11% (F1), 15.7% (Accuracy), and 9.3% (F1), respectively, over the baseline. In addition to the effect on performance, we discuss timing overheads incurred with multiple representations. We envision this work providing researchers with a lens to evaluate combinations of code representations for various tasks.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
NobleMathews/mocktail-blendOfficial10Python–2022-11-06
NobleMathews/mocktail-blue-lagoonOfficial5Python–2024-01-05

A Mocktail of Source Code Representations - Consolidated Pipeline

102Python, CMar 1, 20224 years ago

Pipeline to analyze the impact of multiple source code representations in software engineering tasks

53Python, CNov 6, 20222 years ago

Similar Papers

Cite this paper

@article{swarna2021impact,
  title  = {On the Impact of Multiple Source Code Representations on Software Engineering Tasks -- An Empirical Study},
  author = {Karthik Chandra Swarna and Noble Saji Mathews and Dheeraj Vagavolu and Sridhar Chimalakonda},
  year   = {2021},
  eprint = {2106.10918},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.10918}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.10918.svg)](https://codeofpaper.com/paper/2106.10918)

Discussion