arrow
Return

Characterizing top ranked code examples in Google

delete2021-08-01
delete5
PRE
AI
A
André Hora *
DOI:10.1016/j.jss.2021.110971delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Developers often look for code examples on the web to improve learning and accelerate development. Google indexes millions of pages with code examples: pages with better content are likely to be top ranked. In practice, many factors may influence the rank: page reputation, content quality, etc. Consequently, the most relevant information on the page, i.e., the code example, may be overshadowed by the search engine. Thus, a better understanding of how Google would rank code examples in isolation may provide the basis to detect its strengths and limitations on dealing with such content. In this paper, we assess how the Google search engine ranks code examples. We build a website with 1,000 examples and submit it to Google. After being fully indexed, we query and analyze the returned examples. We find that pages with multiple code examples are more likely to top ranked by Google. Overall, single code examples that are higher ranked are larger, however, they are not necessarily more readable and reusable. We predict top ranked examples with a good level of confidence, but generic factors have more importance than code quality ones. Based on our results, we provide insights for researchers and practitioners. (C) 2021 Elsevier Inc. All rights reserved.
Keywords:
Code examples
API usage
Software quality
Code search
Google search engine
FACER: An API usage-based code-example recommender for opportunistic reuse
err2021-08-18
err10
PREAI
errAbid, Shamsa; Shamail, Shafay; Basit, Hamid Abdul; Nadi, Sarah
errShare
errSave
Learning to rank code examples for code search engines
err2016-01-21
err56
PREAI
errNiu, Haoran; Keivanloo, Iman; Zou, Ying
errShare
errSave
WhoReview: A multi-objective search-based approach for code reviewers recommendation in modern code review
err2021-03-01
err40
PREAI
errChouchen, Moataz; Ouni, Ali; Mkaouer, Mohamed Wiem; Kula, Raula Gaikovina; Inoue, Katsuro
errShare
errSave
Code Search: A Survey of Techniques for Finding Code
err2023-02-09
err17
errOAAI
errDi Grazia, Luca; Pradel, Michael
errShare
errSave
Code-Smell Detection as a Bilevel Problem
err2014-10-14
err74
PREAI
errSahin, Dilan; Kessentini, Marouane; Bechikh, Slim; Deb, Kalyanmoy
errShare
errSave
Analyzing and mining a code search engine usage log
err2010-09-18
err68
errOAAI
errBajracharya, Sushil Krishna; Lopes, Cristina Videira
errShare
errSave

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
1.0W

Organization

U
Universidade Federal de Minas Gerais
Scholars:
1.1K
Papers: 331
Citations: 7.2K
Cited Papers

Cited Papers

What do developers search for on the web?
err2017-04-09
err132
PREAI
errXia, Xin; Bao, Lingfeng; Lo, David; Kochhar, Pavneet Singh; Hassan, Ahmed E.; Xing, Zhenchang
errShare
errSave
Learning to rank code examples for code search engines
err2016-01-21
err56
PREAI
errNiu, Haoran; Keivanloo, Iman; Zou, Ying
errShare
errSave
How Well Do Search Engines Support Code Retrieval on the Web?
err2011-12-01
err75
errOAAI
errSim, Susan Elliott; Umarji, Medha; Ratanotayanon, Sukanya; Lopes, Cristina V.
errShare
errSave
Enriching Documents with Examples: A Corpus Mining Approach
err2013-01-01
err38
PREAI
errKim, Jinhan; Lee, Sanghoon; Hwang, Seung-Won; Kim, Sunghun
errShare
errSave
VECTOR-SPACE MODEL FOR AUTOMATIC INDEXING
err1975-11-01
err4.8K
errOAAI
errSALTON, G; WONG, A; YANG, CS
errShare
errSave
Exemplar: A Source Code Search Engine for Finding Highly Relevant Applications
err2012-09-01
err123
errOAAI
errMcMillan, Collin; Grechanik, Mark; Poshyvanyk, Denys; Fu, Chen; Xie, Qing
errShare
errSave
Solving the Search for Source Code
err2014-06-02
err86
errOAAI
errStolee, Kathryn T.; Elbaum, Sebastian; Dobos, Daniel
errShare
errSave
A field study of API learning obstacles
err2010-12-14
err260
PREAI
errRobillard, Martin P.; DeLine, Robert
errShare
errSave
Analyzing and mining a code search engine usage log
err2010-09-18
err68
errOAAI
errBajracharya, Sushil Krishna; Lopes, Cristina Videira
errShare
errSave
researcher View more