中国科学技术大学学报 ›› 2017, Vol. 47 ›› Issue (1): 80-86.DOI: 10.3969/j.issn.0253-2778.2017.01.011

• 原创论文 • 上一篇    

软件历史代码库词库自动构建技术及实现

孙伟松   

  1. 扬州大学信息工程学院,江苏扬州 225127) 摘要: 在对已有程序代码进行理解或者维护时,开发人员通常需要使用代码搜索技术搜寻感兴趣的代码,但有时候不知道该软件系统过去的开发者和维护者在软件开发和维护过程中定义了哪些元素以及这些元素之间存在着什么关系,因此就很难搜索到想要的代码来进行维护.针对以上问题,提出一个针对具体软件历史版本库的词库自动构建方法,基于该方法建立的词库可以有效地帮助开发人员进行系统的理解和维护.另外,给出了针对历史代码库进行词库建立的工具WB4HPR.WB4HPR可以为开发人员检索出他们想要了解的词语、词语之间的关系以及它们在历史库中的演化情况.基于WB4HPR,开发人员可以方便地理解软件系统在过去版本中使用的单词或词组以及使用单词之间存在的关系,能够有效地保证软件代码中词语前后使用的一致性. 关键词:源代码分析;词库;程序理解 中图分类号:TP 391 文献标识码:A doi:10.3969/j.issn.0253-2778.2017.01.011
  • 收稿日期:2016-03-01 修回日期:2016-09-17 出版日期:2017-01-31 发布日期:2017-01-31
  • 通讯作者: 孙小兵
  • 作者简介:孙伟松,男,1994年生,本科生.研究方向:软件数据分析.E-mail: weisong_sun@126.com
  • 基金资助:
    国家自然科学资金(61402396),教育部博士后面向基金(2015M571489),江苏省普通高校研究生实践创新计划 (SJLX15_0665),江苏省大学生创新创业训练计划项目资助.

On automatic construction of the word base for historical program repository

SUN Weisong   

  1. School of Information Engineering, Yangzhou University, Yangzhou 225127, China
  • Received:2016-03-01 Revised:2016-09-17 Online:2017-01-31 Published:2017-01-31

摘要: 在对已有程序代码进行理解或者维护时,开发人员通常需要使用代码搜索技术搜寻感兴趣的代码,但有时候不知道该软件系统过去的开发者和维护者在软件开发和维护过程中定义了哪些元素以及这些元素之间存在着什么关系,因此就很难搜索到想要的代码来进行维护.针对以上问题,提出一个针对具体软件历史版本库的词库自动构建方法,基于该方法建立的词库可以有效地帮助开发人员进行系统的理解和维护.另外,给出了针对历史代码库进行词库建立的工具WB4HPR.WB4HPR可以为开发人员检索出他们想要了解的词语、词语之间的关系以及它们在历史库中的演化情况.基于WB4HPR,开发人员可以方便地理解软件系统在过去版本中使用的单词或词组以及使用单词之间存在的关系,能够有效地保证软件代码中词语前后使用的一致性.

关键词: 源代码分析, 词库, 程序理解

Abstract: Developers or maintainers are finging it harder to understand and maintain software. Given a system under maintenance, developers may use a code search technique to locate the code of their interests. However, it may be difficult for them to understand the elements and the relation among them for the system at hand. Thus, the returned code may not fit their needs. It is thus necessary to have a word base to recover the elements and their relations for a target system. A tool, WB4HPR(word base for historical program repository) was introduced which focuses on building the word base for a specific system. WB4HPR can retrieve the words, recover the relationship between them, and display the evolution of these words during the program evolution to help developers and maintainers comprehend the program, while effectively keeping the consistency of the use of words during the software maintenance process.

Key words: source code analysis, word base, program comprehension