计算机科学 ›› 2009, Vol. 36 ›› Issue (8): 165-168.

• 软件工程与数据库技术 • 上一篇    下一篇

基于语法与语义分析的代码搜索结果优化

刘石,李合,王啸吟,张路,谢冰   

  1. (北京大学信息科学技术学院高可信软件技术教育部重点实验室 北京 100871)
  • 出版日期:2018-11-16 发布日期:2018-11-16
  • 基金资助:
    本文受国家科技支撑计划(2006BAH02A02), 国家高技术研究发展计划(863)(2006AA01Z189)资助。

Enhancement of Code Search Results Using Syntax and Semantic Analysis

LIU Shi,LI He,WANG Xiao-yin,ZHANG Lu,XIE Bing   

  • Online:2018-11-16 Published:2018-11-16

摘要: 通过示例代码学习简单算法的实现和具体API的使用方式是程序开发人员在软件开发中进行软件复用的高效手段,也是使用代码搜索引擎的主要目的。代码搜索引擎从网页搜索技术发展而来,提供对网络上源代码资源的检索功能,能够有效定位与搜索内容相关的代码,为程序开发人员提供帮助。但现有的代码搜索引擎没有在搜索结果中区别API的实现代码与使用代码,搜索结果存在冗余,导致用户无法快速有效地找到提供有用信息的代码片段。为了使用户更好更快地找到代码搜索目标,阐述了应用语法与语义分析技术从区分API实现代码和使用代码、相似代码聚类、

关键词: 软件复用,代码搜索,语法与语义分析,API的实现与使用代码

Abstract: Learning simple algorithm and specific API usage by code examples is an efficient way in software reuse and is the main purpose of using code search engine. Code search engine providing search service for source code on the internet was developed from Web search engine. It is able to locate source code related to the search input and brings great assistance to software development However, the state-of-art code search engines do not make a distinction between API implementation and usage, the results arc redundant and not easy to recognize. It is difficult for the user to obtain useful code segments from search result items. To address the problem,we proposed applying syntax and semantic analysis techniques to organizing the search results, clustering the similar code and acquiring better code digest We implemented our method with a code search engine and evaluate its effectiveness in this paper, the experimental results demonstrate that our approach works efficiently.

Key words: Software reuse,Code search,Syntax and semantic analysis,API Implementation and Usage

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!