• Cite Icon621
  • https://doi.org/10.1145/3180155.3180167Copy DOI Icon

Deep code search

  • May 27, 2018
  • Xiaodong Gu +2 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

To implement a program functionality, developers can reuse previously written code snippets by searching through a large-scale codebase. Over the years, many code search tools have been proposed to help developers. The existing approaches often treat source code as textual documents and utilize information retrieval models to retrieve relevant code snippets that match a given query. These approaches mainly rely on the textual similarity between source code and natural language query. They lack a deep understanding of the semantics of queries and source code. In this paper, we propose a novel deep neural network named CODEnn (Code-Description Embedding Neural Network). Instead of matching text similarity, CODEnn jointly embeds code snippets and natural language descriptions into a high-dimensional vector space, in such a way that code snippet and its corresponding description have similar vectors. Using the unified vector representation, code snippets related to a natural language query can be retrieved according to their vectors. Semantically related words can also be recognized and irrelevant/noisy keywords in queries can be handled. As a proof-of-concept application, we implement a code search tool named DeepCS using the proposed CODEnn model. We empirically evaluate DeepCS on a large scale codebase collected from GitHub. The experimental results show that our approach can effectively retrieve relevant code snippets and outperforms previous techniques.

Similar Papers
  • Conference Article
  • Citations280

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

  • Nov 01, 2015
  • Fei Lv +5
  • 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
  • Research Article
  • Citations47

CRaDLe: Deep code retrieval based on semantic Dependency Learning

  • Apr 26, 2021
  • Neural Networks
  • Wenchao Gu +6
  • Research Article
  • Citations28

CodeMatcher: Searching Code Based on Sequential Semantics of Important Query Words

  • Sep 28, 2021
  • ACM Transactions on Software Engineering and Methodology
  • Chao Liu +5
  • Conference Article
  • Citations63

Relationship-aware code search for JavaScript frameworks

  • Nov 01, 2016
  • Xuan Li +5
  • Conference Article
  • Citations78

Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual Learning

  • Apr 20, 2020
  • Wei Ye +5
  • Conference Article
  • Citations11

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

  • Jan 01, 2024
  • Haochen Li +2
  • 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
  • Citations13

Generating VHDL models from natural language descriptions

  • Sep 23, 1994
  • Walling R Cyre +3
  • Research Article

A Transformer-based approach to highly granular source code authorship attribution

  • Jul 16, 2024
  • Applied and Computational Engineering
  • Chongzheng Shi
  • Conference Article
  • Citations20

Source code retrieval on StackOverflow using LDA

  • May 01, 2015
  • Achmad Arwan +2
  • Research Article
  • Citations49

Example overflow: using social media for code recommendation

  • Jun 04, 2012
  • Alexey Zagalsky +2
  • PDF
  • Conference Article
  • Citations4

Bag-of-Words Baselines for Semantic Code Search

  • Jan 01, 2021
  • Xinyu Zhang +3
  • Conference Article
  • Citations6

Automatic Generation of Pseudocode with Attention Seq2seq Model

  • Dec 01, 2018
  • Shaofeng Xu +1
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.