English

Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distance

Computation and Language 2025-06-06 v2 Programming Languages Software Engineering

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).

Keywords

Cite

@article{arxiv.2404.08817,
  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},
  journal= {arXiv preprint arXiv:2404.08817},
  year   = {2025}
}

Comments

ACL 2024 Main

R2 v1 2026-06-28T15:53:03.317Z