A comment-driven approach to API usage patterns discovery and search

Shin-Jie Lee, Xavier Lin, Wu Chen Su, Hsi Min Chen

Research output: Contribution to journalArticle

Abstract

Considerable effort has gone into the discovery of API usage patterns or examples. However, how to enable programmers to search for discovered API usage examples using natural language queries is still a significant research problem. This paper presents an approach, referred to as Codepus, to facilitate the discovery of API usage examples based on mining comments in open source code while permitting searches using natural language queries. The approach includes two key features: API usage patterns as well as multiple keywords and tf-idf values are discovered by mining open source comments and code snippets; and a matchmaking function is devised for searching for API usage examples using natural language queries by aggregating scores related to semantic similarity, correctness, and the number of APIs. In a practical application, the proposed approach discovered 43,721 API usage patterns with 641,591 API usage examples from 15,814 open source projects. Experiment results revealed the following: (1) Codepus reduced the browsing time required for locating API usage examples by 46.5%, compared to the time required when using a web search engine. (2) The precision of Codepus is 91% when using eleven real-world frequently asked questions, which is superior to those of Gists and Open Hub.

Original languageEnglish
Pages (from-to)1587-1601
Number of pages15
JournalJournal of Internet Technology
Volume19
Issue number5
DOIs
Publication statusPublished - 2018 Jan 1

Fingerprint

Application programming interfaces (API)
Query languages
Search engines
Semantics

All Science Journal Classification (ASJC) codes

  • Software
  • Computer Networks and Communications

Cite this

Lee, Shin-Jie ; Lin, Xavier ; Su, Wu Chen ; Chen, Hsi Min. / A comment-driven approach to API usage patterns discovery and search. In: Journal of Internet Technology. 2018 ; Vol. 19, No. 5. pp. 1587-1601.
@article{2349a3d365d54de083b4cd168dd20e3f,
title = "A comment-driven approach to API usage patterns discovery and search",
abstract = "Considerable effort has gone into the discovery of API usage patterns or examples. However, how to enable programmers to search for discovered API usage examples using natural language queries is still a significant research problem. This paper presents an approach, referred to as Codepus, to facilitate the discovery of API usage examples based on mining comments in open source code while permitting searches using natural language queries. The approach includes two key features: API usage patterns as well as multiple keywords and tf-idf values are discovered by mining open source comments and code snippets; and a matchmaking function is devised for searching for API usage examples using natural language queries by aggregating scores related to semantic similarity, correctness, and the number of APIs. In a practical application, the proposed approach discovered 43,721 API usage patterns with 641,591 API usage examples from 15,814 open source projects. Experiment results revealed the following: (1) Codepus reduced the browsing time required for locating API usage examples by 46.5{\%}, compared to the time required when using a web search engine. (2) The precision of Codepus is 91{\%} when using eleven real-world frequently asked questions, which is superior to those of Gists and Open Hub.",
author = "Shin-Jie Lee and Xavier Lin and Su, {Wu Chen} and Chen, {Hsi Min}",
year = "2018",
month = "1",
day = "1",
doi = "10.3966/160792642018091905030",
language = "English",
volume = "19",
pages = "1587--1601",
journal = "Journal of Internet Technology",
issn = "1607-9264",
publisher = "Taiwan Academic Network Management Committee",
number = "5",

}

A comment-driven approach to API usage patterns discovery and search. / Lee, Shin-Jie; Lin, Xavier; Su, Wu Chen; Chen, Hsi Min.

In: Journal of Internet Technology, Vol. 19, No. 5, 01.01.2018, p. 1587-1601.

Research output: Contribution to journalArticle

TY - JOUR

T1 - A comment-driven approach to API usage patterns discovery and search

AU - Lee, Shin-Jie

AU - Lin, Xavier

AU - Su, Wu Chen

AU - Chen, Hsi Min

PY - 2018/1/1

Y1 - 2018/1/1

N2 - Considerable effort has gone into the discovery of API usage patterns or examples. However, how to enable programmers to search for discovered API usage examples using natural language queries is still a significant research problem. This paper presents an approach, referred to as Codepus, to facilitate the discovery of API usage examples based on mining comments in open source code while permitting searches using natural language queries. The approach includes two key features: API usage patterns as well as multiple keywords and tf-idf values are discovered by mining open source comments and code snippets; and a matchmaking function is devised for searching for API usage examples using natural language queries by aggregating scores related to semantic similarity, correctness, and the number of APIs. In a practical application, the proposed approach discovered 43,721 API usage patterns with 641,591 API usage examples from 15,814 open source projects. Experiment results revealed the following: (1) Codepus reduced the browsing time required for locating API usage examples by 46.5%, compared to the time required when using a web search engine. (2) The precision of Codepus is 91% when using eleven real-world frequently asked questions, which is superior to those of Gists and Open Hub.

AB - Considerable effort has gone into the discovery of API usage patterns or examples. However, how to enable programmers to search for discovered API usage examples using natural language queries is still a significant research problem. This paper presents an approach, referred to as Codepus, to facilitate the discovery of API usage examples based on mining comments in open source code while permitting searches using natural language queries. The approach includes two key features: API usage patterns as well as multiple keywords and tf-idf values are discovered by mining open source comments and code snippets; and a matchmaking function is devised for searching for API usage examples using natural language queries by aggregating scores related to semantic similarity, correctness, and the number of APIs. In a practical application, the proposed approach discovered 43,721 API usage patterns with 641,591 API usage examples from 15,814 open source projects. Experiment results revealed the following: (1) Codepus reduced the browsing time required for locating API usage examples by 46.5%, compared to the time required when using a web search engine. (2) The precision of Codepus is 91% when using eleven real-world frequently asked questions, which is superior to those of Gists and Open Hub.

UR - http://www.scopus.com/inward/record.url?scp=85054952387&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=85054952387&partnerID=8YFLogxK

U2 - 10.3966/160792642018091905030

DO - 10.3966/160792642018091905030

M3 - Article

AN - SCOPUS:85054952387

VL - 19

SP - 1587

EP - 1601

JO - Journal of Internet Technology

JF - Journal of Internet Technology

SN - 1607-9264

IS - 5

ER -