Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Song, Yewei, Lothritz, Cedric, Tang, Daniel, Bissyandé, Tegawendé F., Klein, Jacques
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909637572296704
author Song, Yewei
Lothritz, Cedric
Tang, Daniel
Bissyandé, Tegawendé F.
Klein, Jacques
author_facet Song, Yewei
Lothritz, Cedric
Tang, Daniel
Bissyandé, Tegawendé F.
Klein, Jacques
contents 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).
format Preprint
id arxiv_https___arxiv_org_abs_2404_08817
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance
Song, Yewei
Lothritz, Cedric
Tang, Daniel
Bissyandé, Tegawendé F.
Klein, Jacques
Computation and Language
Programming Languages
Software Engineering
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).
title Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance
topic Computation and Language
Programming Languages
Software Engineering
url https://arxiv.org/abs/2404.08817