计算机与现代化

• 算法设计与分析 • 上一篇    下一篇

一种高效的源代码搜索算法

  

  1. 上海交通大学软件学院,上海200240
  • 收稿日期:2014-12-04 出版日期:2015-03-23 发布日期:2015-03-26
  • 作者简介:吕飞(1988-),男,湖北鄂州人,上海交通大学软件学院硕士研究生,研究方向:程序分析与测试,代码搜索,代码推荐。
  • 基金资助:
    国家自然科学基金资助项目(61272102)

An Efficient Code Search Algorithm

  1. School of Software, Shanghai Jiaotong University, Shanghai 200240, China
  • Received:2014-12-04 Online:2015-03-23 Published:2015-03-26

摘要: 多年来的软件开发积累了大量的源代码,同时不少代码搜索工具也被开发出来,但是,现有的工具都不够精确,因而很少有人使用。本文提出一种高效的源代码搜索算法,通过识别查询语句与API的关系,以提高代码搜索的准确性。基于该算法,本文实现一个针对C#源代码的搜索工具,并通过客观实验与用户调研对算法进行评估。实验结果表明本文提出的搜索算法是十分有效的。

关键词: C#, 代码搜索, 信息检索

Abstract: Over the years of software development, a vast amount of source code has been accumulated. At the same time, many code search tools have been developed to help programmers searching source code. As all these code search tools are not accurate enough, few developers use these tools to help them. In this paper, we propose an efficient code search algorithm, which can recognize the relation between APIs and queries, so it can improve the accuracy in code search. This paper also implements a C# code search tools based on the algorithm. At last, we did the experiment objectively and conducted a user study to evaluate the algorithm. The experiment results verify that the algorithm is efficient.

Key words: C#, code search, information retrieval

中图分类号: