A Comment-Driven Approach to API Usage Patterns Discovery and Search

IF 0.9 4区 计算机科学 Q4 COMPUTER SCIENCE, INFORMATION SYSTEMS
Shin-Jie Lee, X. Lin, Wu-Chen Su, Hsi-Min Chen
{"title":"A Comment-Driven Approach to API Usage Patterns Discovery and Search","authors":"Shin-Jie Lee, X. Lin, Wu-Chen Su, Hsi-Min Chen","doi":"10.3966/160792642018091905030","DOIUrl":null,"url":null,"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.","PeriodicalId":50172,"journal":{"name":"Journal of Internet Technology","volume":"19 1","pages":"1587-1601"},"PeriodicalIF":0.9000,"publicationDate":"2018-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Internet Technology","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.3966/160792642018091905030","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 4

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.
注释驱动的API使用模式发现和搜索方法
API使用模式或示例的发现已经付出了相当大的努力。然而,如何使程序员能够使用自然语言查询来搜索发现的API使用示例仍然是一个重要的研究问题。本文提出了一种称为Codepus的方法,该方法基于开源代码中的挖掘注释来促进API使用示例的发现,同时允许使用自然语言查询进行搜索。该方法包括两个关键特性:通过挖掘开源注释和代码片段,发现API使用模式以及多个关键字和tf-idf值;并设计了一种匹配功能,用于通过聚合与语义相似性、正确性和API数量相关的分数,使用自然语言查询来搜索API使用示例。在实际应用中,所提出的方法从15814个开源项目中发现了43721个API使用模式和641591个API使用示例。实验结果表明:(1)与使用网络搜索引擎相比,Codepus将查找API使用示例所需的浏览时间减少了46.5%。(2) Codepus在使用11个现实世界常见问题时的准确率为91%,优于Gists和Open Hub。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Internet Technology
Journal of Internet Technology COMPUTER SCIENCE, INFORMATION SYSTEMS-TELECOMMUNICATIONS
CiteScore
3.20
自引率
18.80%
发文量
112
审稿时长
13.8 months
期刊介绍: The Journal of Internet Technology accepts original technical articles in all disciplines of Internet Technology & Applications. Manuscripts are submitted for review with the understanding that they have not been published elsewhere. Topics of interest to JIT include but not limited to: Broadband Networks Electronic service systems (Internet, Intranet, Extranet, E-Commerce, E-Business) Network Management Network Operating System (NOS) Intelligent systems engineering Government or Staff Jobs Computerization National Information Policy Multimedia systems Network Behavior Modeling Wireless/Satellite Communication Digital Library Distance Learning Internet/WWW Applications Telecommunication Networks Security in Networks and Systems Cloud Computing Internet of Things (IoT) IPv6 related topics are especially welcome.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信