引用本文:黎宣,王千祥,金芝.基于增强描述的代码搜索方法.软件学报,2017,28(6):1405-1417
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 4664次   下载 9225 本文二维码信息
码上扫一扫!
分享到: 微信 更多
基于增强描述的代码搜索方法
黎宣1,2, 王千祥1,2, 金芝1,2
1.北京大学 信息科学技术学院, 北京 100871;2.高可信软件技术教育部重点实验室(北京大学), 北京 100871
摘要:
如何有效地帮助程序员从目前的各种代码库中搜索与特定编程任务相关的代码,已成为软件工程重要的研究领域之一.提出一种基于增强描述的代码搜索方法DERECS,该方法首先基于开源项目、问答系统等构建一个代码-描述语料库,并分析代码及自然语言描述,提取方法调用和代码结构相关特征值;然后,基于代码片段中的方法调用及代码片段的结构特征对代码进行描述增强,以减小被搜索的代码与自然语言查询语句之间的差异,扩大搜索的范围.使用真实自然语言查询语句作为测试基准,对DERECS进行验证.验证结果表明,DERECS的效果显著优于典型方法SNIFF和Krugle的查询结果.
关键词:  代码搜索  自然语言处理  代码-描述对  代码特征提取  代码描述增强
DOI:10.13328/j.cnki.jos.005226
分类号:
基金项目:国家重点基础研究发展计划(973)(2015CB352200,2015CB352201);国家自然科学基金(61672045,61421091,61529201,91318301)
Description Reinforcement Based Code Search
LI Xuan1,2, WANG Qian-Xiang1,2, JIN Zhi1,2
1.School of Electronics Engineering and Computer Science, Peking University, Beijing 100871, China;2.Key Laboratory of High Confidence Software Technologies(Peking University), Beijing 100871, China
Abstract:
Effectively searching code for specific programming task from code base has become an important research field of software engineering. This paper presents a description reinforcement based code search (DERECS) approach. DERECS first builds a codedescription pair corpus, analyzes both code and its natural language description, and extracts features about method calls and code structure. DERECS reinforces the description of code based on the method calls and code structure features, reduces the gaps between code snippet and natural language query, and expands the search scope. Evaluation is conducted against real-world queries, and the results show DERECS is significantly better than SNIFF and Krugle.
Key words:  code search  natural language process  code-description pair  code feature extraction  code description reinforcement

引用本文:
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览次   下载  
分享到: 微信 更多
摘要:
关键词:  
DOI:
分类号:
基金项目:
Abstract:
Key words: