CSSG: Measuring Code Similarity with Semantic Graphs
By: Jingwen Xu , Yiyang Lu , Changze Lv and more
Potential Business Impact:
Finds similar computer code by understanding how it works.
Existing code similarity metrics, such as BLEU, CodeBLEU, and TSED, largely rely on surface-level string overlap or abstract syntax tree structures, and often fail to capture deeper semantic relationships between programs.We propose CSSG (Code Similarity using Semantic Graphs), a novel metric that leverages program dependence graphs to explicitly model control dependencies and variable interactions, providing a semantics-aware representation of code.Experiments on the CodeContests+ dataset show that CSSG consistently outperforms existing metrics in distinguishing more similar code from less similar code under both monolingual and cross-lingual settings, demonstrating that dependency-aware graph representations offer a more effective alternative to surface-level or syntax-based similarity measures.
Similar Papers
Esim: EVM Bytecode Similarity Detection Based on Stable-Semantic Graph
Cryptography and Security
Finds copied or bad code in digital money.
Deep Assessment of Code Review Generation Approaches: Beyond Lexical Similarity
Software Engineering
Checks computer code quality better than before.
Beyond Surface Similarity: Evaluating LLM-Based Test Refactorings with Structural and Semantic Awareness
Software Engineering
Measures how well AI improves computer code.