• Home
  • Search
  • Relationship-aware code search for JavaScript frameworks
  • Cite Icon63
  • https://doi.org/10.1145/2950290.2950341Copy DOI Icon

Relationship-aware code search for JavaScript frameworks

  • Nov 1, 2016
  • Xuan Li +5 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

JavaScript frameworks, such as jQuery, are widely used for developing web applications. To facilitate using these JavaScript frameworks to implement a feature (e.g., functionality), a large number of programmers often search for code snippets that implement the same or similar feature. However, existing code search approaches tend to be ineffective, without taking into account the fact that JavaScript code snippets often implement a feature based on various relationships (e.g., sequencing, condition, and callback relationships) among the invoked framework API methods. To address this issue, we present a novel Relationship-Aware Code Search (RACS) approach for finding code snippets that use JavaScript frameworks to implement a specific feature. In advance, RACS collects a large number of code snippets that use some JavaScript frameworks, mines API usage patterns from the collected code snippets, and represents the mined patterns with method call relationship (MCR) graphs, which capture framework API methods' signatures and their relationships. Given a natural language (NL) search query issued by a programmer, RACS conducts NL processing to automatically extract an action relationship (AR) graph, which consists of actions and their relationships inferred from the query. In this way, RACS reduces code search to the problem of graph search: finding similar MCR graphs for a given AR graph. We conduct evaluations against representative real-world jQuery questions posted on Stack Overflow, based on 308,294 code snippets collected from over 81,540 files on the Internet. The evaluation results show the effectiveness of RACS: the top 1 snippet produced by RACS matches the target code snippet for 46% questions, compared to only 4% achieved by a relationship-oblivious approach.

Similar Papers
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
  • 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
  • Conference Article
  • Citations621

Deep code search

  • May 27, 2018
  • Xiaodong Gu +2
  • 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
  • Citations27

Python Coding Style Compliance on Stack Overflow

  • May 01, 2019
  • Nikolaos Bafatakis +6
  • Conference Article
  • Citations17

ICSD

  • Dec 03, 2018
  • Yanfang Ye +7
  • Conference Article
  • Citations7

Characterizing Duplicate Code Snippets between Stack Overflow and Tutorials

  • May 01, 2019
  • Manziba Akanda Nishi +2
  • Research Article
  • Citations86

Deep Graph Matching and Searching for Semantic Code Retrieval

  • May 10, 2021
  • ACM Transactions on Knowledge Discovery from Data
  • Xiang Ling +8
  • Conference Article
  • Citations11

Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search

  • Jan 01, 2024
  • Haochen Li +2
  • PDF
  • Research Article
  • Citations1

SCC-GPT: Source Code Classification Based on Generative Pre-Trained Transformers

  • Jul 07, 2024
  • Mathematics
  • Mohammad D Alahmadi +2
  • Conference Article
  • Citations6

Reinforcement Learning of Code Search Sessions

  • Dec 01, 2019
  • Wei Li +3
  • Research Article
  • Citations1

Fault Localization from the Semantic Code Search Perspective

  • Aug 26, 2025
  • ACM Transactions on Software Engineering and Methodology
  • Yihao Qin +8
  • Conference Article
  • Citations36

Cross-language code search using static and dynamic analyses

  • Aug 18, 2021
  • George Mathew +1
  • Conference Article

Detecting Adversarial Prompted AI-Generated Code on Stack Overflow: A Benchmark Dataset and an Enhanced Detection Approach

  • Sep 07, 2025
  • Aman Swaraj +3
  • Research Article
  • Citations1

How Do OSS Developers Reuse Architectural Solutions From Q&A Sites: An Empirical Study

  • Jul 01, 2025
  • IEEE Transactions on Software Engineering
  • Musengamana Jean De Dieu +2
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.