摘要
如何有效地帮助程序员从目前的各种代码库中搜索与特定编程任务相关的代码,已成为软件工程重要的研究领域之一.提出一种基于增强描述的代码搜索方法 DERECS,该方法首先基于开源项目、问答系统等构建一个代码-描述语料库,并分析代码及自然语言描述,提取方法调用和代码结构相关特征值;然后,基于代码片段中的方法调用及代码片段的结构特征对代码进行描述增强,以减小被搜索的代码与自然语言查询语句之间的差异,扩大搜索的范围.使用真实自然语言查询语句作为测试基准,对DERECS进行验证.验证结果表明,DERECS的效果显著优于典型方法 SNIFF和Krugle的查询结果.
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 code- description 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.
出处
《软件学报》
EI
CSCD
北大核心
2017年第6期1405-1417,共13页
Journal of Software
基金
国家重点基础研究发展计划(973)(2015CB352200
2015CB352201)
国家自然科学基金(61672045
61421091
61529201
91318301)~~
关键词
代码搜索
自然语言处理
代码-描述对
代码特征提取
代码描述增强
code search
natural language process
code-description pair
code feature extraction
code description reinforcement