咨询与建议

看过本文的还看了

相关文献

该作者的其他文献

文献详情 >Expanding Queries for Code Sea... 收藏

Expanding Queries for Code Search Using Semantically Related API Class-names

为用语义上相关的 API 班名字的代码搜索的膨胀询问

作     者:Zhang, Feng Niu, Haoran Keivanloo, Iman Zou, Ying 

作者机构:Queens Univ Sch Comp Kingston ON K7L 3N6 Canada Queens Univ Dept Elect & Comp Engn Kingston ON K7L 3N6 Canada 

出 版 物:《IEEE TRANSACTIONS ON SOFTWARE ENGINEERING》 (IEEE软件工程汇刊)

年 卷 期:2018年第44卷第11期

页      面:1070-1082页

核心收录:

学科分类:0808[工学-电气工程] 08[工学] 0835[工学-软件工程] 0812[工学-计算机科学与技术(可授工学、理学学位)] 

主  题:Query expansion code search neural network language model API class-name 

摘      要:When encountering unfamiliar programming tasks (e.g., connecting to a database), there is a need to seek potential working code examples. Instead of using code search engines, software developers usually post related programming questions on online Q&A forums (e.g., Stack Overflow). One possible reason is that existing code search engines would return effective code examples only if a query contains identifiers (e.g., class or method names). In other words, existing code search engines do not handle natural-language queries well (e.g., a description of a programming task). However, developers may not know the appropriate identifiers at the time of the search. As the demand of searching code examples is increasing, it is of significant interest to enhance code search engines. We conjecture that expanding natural-language queries with their semantically related identifiers has a great potential to enhance code search engines. In this paper, we propose an automated approach to find identifiers (in particular API class-names) that are semantically related to a given natural-language query. We evaluate the effectiveness of our approach using 74 queries on a corpus of 23,677,216 code snippets that are extracted from 24,666 open source Java projects. The results show that our approach can effectively recommend semantically related API class-names to expand the original natural-language queries. For instance, our approach successfully retrieves relevant code examples in the top 10 retrieved results for 76 percent of 74 queries, while it is 36 percent when using the original natural-language query;and the median rank of the first relevant code example is increased from 22 to 7.

读者评论 与其他读者分享你的观点

用户名:未登录
我的评分