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
N1 - Funding Information:
This research is sponsored by Ministry of Science and Technology under the grants 103-2221-E-006-218 and 105-2221-E-006-154-MY3 in Taiwan.
Publisher Copyright:
© 2018 Taiwan Academic Network Management Committee. All Rights Reserved.
PY - 2018
Y1 - 2018
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
SN - 1607-9264
VL - 19
SP - 1587
EP - 1601
JO - Journal of Internet Technology
JF - Journal of Internet Technology
IS - 5
ER -