Evaluating How Developers Use General-Purpose Web-Search for Code Retrieval

Md. Masudur Rahman, Jed Barson, Sydney Paul, Joshua Kayani, Federico Andres Lois, Sebastian Fernandez Quezada, Christopher Parnin, Kathryn T. Stolee, Baishakhi Ray · DOI

Introduction

General-purpose search engines (GPSEs) like Google have become indispensable tools in the modern developer's workflow. However, these engines are often optimized for natural language and general information rather than the specific syntax and semantics of source code. This paper investigates the "effort gap" between code-related and general-purpose searches, demonstrating that developers face significantly higher friction when retrieving technical information.

Methodology: The 'Codeness' Model

To quantify search behavior, researchers analyzed 149,610 Google search queries and associated clickstream data from 310 developers over 14 months. A key challenge was distinguishing between technical and non-technical queries. The authors developed a "Codeness Score" classifier trained on 19.8K unique technical tags from Stack Overflow. This model allows for the automated identification of technical intent with high accuracy (87% F1-score), enabling a large-scale comparison of user effort across different task types.

The study reveals that code-related queries are linguistically distinct from general web searches. On average, code queries are significantly longer, containing 4.7 words compared to the 2.3-word average for non-code queries. This increased length suggests that developers must use more descriptive language to compensate for the search engine's lack of technical context.

Query length distributions for code vs. non-code queries (a) and across codeness score buckets (b).

Despite this verbosity, developers explicitly mention a programming language in their queries only 20% of the time. They frequently rely on the search engine to infer context—a major hurdle for GPSEs that treat code as plain text. Furthermore, while code queries are longer, they draw from a more restricted and specialized vocabulary compared to general search.

The Effort Gap: Quantifying Developer Struggle

The core finding of the research is the significant disparity in effort required to resolve code-related tasks. Because GPSEs often ignore code semantics, developers frequently engage in a cycle of "query-click-fail-edit." The data shows that 34.9% of code queries are edited, nearly double the 17% edit rate for non-code queries.

Task duration distributions for code vs. non-code queries (a) and across codeness score buckets (b).

This struggle translates directly into time and navigation effort. Code search tasks take a median of approximately 3 minutes, compared to 1.5 minutes for general tasks. Additionally, developers visit more websites per task (median of 8 vs. 6) and demonstrate much higher persistence, often performing five or more edits to a single query to find a solution.

Conclusion and Future Directions

The findings highlight a critical need for "code-aware" search engines. Current GPSEs force developers to act as human translators, manually bridging the gap between their technical needs and the engine's text-based indexing. Future search tools could drastically reduce this effort by incorporating context-aware features, such as analyzing a developer's open IDE files or project dependencies to automatically fill in missing language context. By reducing the number of manual query edits and failed clicks, such tools could significantly boost developer productivity.

Summary updated

BibTeX
@inproceedings{rahman2018evaluating,
  author = {Md. Masudur Rahman and Jed Barson and Sydney Paul and Joshua Kayani and Federico Andres Lois and Sebastian Fernandez Quezada and Christopher Parnin and Kathryn T. Stolee and Baishakhi Ray},
  title = {{Evaluating How Developers Use General-Purpose Web-Search for Code Retrieval}},
  booktitle = {MSR},
  year = {2018},
  doi = {10.1145/3196398.3196425},
}
Figure