Cross-Language Code Search using Static and Dynamic Analyses
Not on the map. Why?
Abstract (arXiv)
As code search permeates most activities in software development,code-to-code search has emerged to support using code as a query and retrieving similar code in the search results. Applications include duplicate code detection for refactoring, patch identification for program repair, and language translation. Existing code-to-code search tools rely on static similarity approaches such as the comparison of tokens and abstract syntax trees (AST) to approximate dynamic behavior, leading to low precision. Most tools do not support cross-language code-to-code search, and those that do, rely on machine learning models that require labeled training data. We present Code-to-Code Search Across Languages (COSAL), a cross-language technique that uses both static and dynamic analyses to identify similar code and does not require a machine learning model. Code snippets are ranked using non-dominated sorting based on code token similarity, structural similarity, and behavioral similarity. We empirically evaluate COSAL on two datasets of 43,146Java and Python files and 55,499 Java files and find that 1) code search based on non-dominated ranking of static and dynamic similarity measures is more effective compared to single or weighted measures; and 2) COSAL has better precision and recall compared to state-of-the-art within-language and cross-language code-to-code search tools. We explore the potential for using COSAL on large open-source repositories and discuss scalability to more languages and similarity metrics, providing a gateway for practical,multi-language code-to-code search.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). First posted on arXiv 16 Jun 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 1; 2023: 1; 2024: 1; 2025: 1.
4 papers.
- 2022InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignmentscited by 4
- 2023REINFOREST: Reinforcing Semantic Code Similarity for Cross-Lingual Code Search Modelscited by 3
- 2024On the Use of Deep Learning Models for Semantic Clone Detectioncited by 1
- 2025How Small Transformation Expose the Weakness of Semantic Similarity Measurescited by 0
- 2025How Small Transformation Expose the Weakness of Semantic Similarity Measures8 Sep 2025
- 2024On the Use of Deep Learning Models for Semantic Clone Detection19 Dec 2024
- 2023REINFOREST: Reinforcing Semantic Code Similarity for Cross-Lingual Code Search Models5 May 2023
- 2022InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignments28 Jun 2022