• Home
  • Search
  • Cross-language code search using static and dynamic analyses
  • Cite Icon36
  • https://doi.org/10.1145/3468264.3468538Copy DOI Icon

Cross-language code search using static and dynamic analyses

  • Aug 18, 2021
  • George Mathew +1 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

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.

Similar Papers
  • Conference Article
  • Citations30

Is a Single Model Enough? MuCoS: A Multi-Model Ensemble Learning Approach for Semantic Code Search

  • Oct 26, 2021
  • Lun Du +5
  • Conference Article
  • Citations63

Relationship-aware code search for JavaScript frameworks

  • Nov 01, 2016
  • Xuan Li +5
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
  • Research Article
  • Citations15

Big Code Search: A Bibliography

  • Aug 26, 2023
  • ACM Computing Surveys
  • Kisub Kim +7
  • Conference Article
  • Citations4

Code Semantic Detection

  • Aug 27, 2021
  • Bhavna Arora +4
  • PDF
  • Research Article
  • Citations67

Malware Classification Using Probability Scoring and Machine Learning

  • Jan 01, 2019
  • IEEE Access
  • Di Xue +4
  • Research Article
  • Citations1

Deep Semantics-Enhanced Neural Code Search

  • Nov 28, 2024
  • Electronics
  • Ying Yin +5
  • Conference Article
  • Citations6

Reinforcement Learning of Code Search Sessions

  • Dec 01, 2019
  • Wei Li +3
  • Dissertation

Data flow and heap analysis with application to privilege escalation vulnerability scanning and software theft detection

  • Jan 01, 2013
  • Ping-Fai Chan
  • Conference Article

Scaling up evaluation of code search tools through developer usage metrics

  • Mar 01, 2015
  • Kostadin Damevski +2
  • Conference Article
  • Citations280

CodeHow: Effective Code Search Based on API Understanding and Extended Boolean Model (E)

  • Nov 01, 2015
  • Fei Lv +5
  • Conference Article
  • Citations40

Invited Talk Static and dynamic analysis

  • Jun 07, 2004
  • Michael D Ernst
  • Conference Article

Machine Learning Based Thread Pool Tuning via Program Analysis

  • Dec 01, 2021
  • Lakindu Akash +4
  • Research Article
  • Citations5

SECON: Maintaining Semantic Consistency in Data Augmentation for Code Search

  • Jan 16, 2025
  • ACM Transactions on Information Systems
  • Xu Zhang +5
  • Conference Article
  • Citations69

Are the Code Snippets What We Are Searching for? A Benchmark and an Empirical Study on Code Search with Natural-Language Queries

  • Feb 01, 2020
  • Shuhan Yan +4
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.