Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance

Yewei Song, Cedric Lothritz, Daniel Tang, Tegawendé F. Bissyandé, Jacques Klein
4/12/2024
cs.CLcs.PLcs.SE

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

This paper revisits recent code similarity evaluation metrics, particularly focusing on the application of Abstract Syntax Tree (AST) editing distance in diverse programming languages. In particular, we explore the usefulness of these metrics and compare them to traditional sequence similarity metrics. Our experiments showcase the effectiveness of AST editing distance in capturing intricate code structures, revealing a high correlation with established metrics. Furthermore, we explore the strengths and weaknesses of AST editing distance and prompt-based GPT similarity scores in comparison to BLEU score, execution match, and Jaccard Similarity. We propose, optimize, and publish an adaptable metric that demonstrates effectiveness across all tested languages, representing an enhanced version of Tree Similarity of Edit Distance (TSED).

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{song2024revisiting,
  title  = {Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance},
  author = {Yewei Song and Cedric Lothritz and Daniel Tang and Tegawendé F. Bissyandé and Jacques Klein},
  year   = {2024},
  eprint = {2404.08817},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.08817v2}
}

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/2404.08817.svg)](https://codeofpaper.com/paper/2404.08817)

Discussion