基于代码库和特征匹配的函数名称推荐方法
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

国家自然科学基金(61272169,61472034,61003065,61371194);国家重点基础研究发展计划(973)(2013CB329303);教育部新世纪优秀人才支持计划(NCET-13-0041);北京高等学校青年英才计划(YETP1183);新闻出版重大科技工程项目(GAPP_ZDKJ_BQ/01)


Method Name Recommendation Based on Source Code Depository and Feature Matching
Author:
Affiliation:

Fund Project:

National Natural Science Foundation of China (61272169, 61472034, 61003065, 61371194); National Program on Key Basic Research Project of China (973 Program) (2013CB329303); Program for New Century Excellent Talents in University of Ministry of Education of China (NCET-13-0041); Beijing Higher Education Young Elite Teacher Project (YETP1183); Major Scientific and Technological Projects of Press and Publication, China (GAPP_ZDKJ_ BQ/01)

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    函数名称质量的高低,对于理解和维护程序非常重要.然而对于软件开发人员,尤其是母语非英语的软件开发人员,为函数选取高质量的名称比较困难.为此,提出一种函数名称推荐方法.首先,基于开源软件创建函数库;然后,对于某个需要推荐名称的函数f,从函数库中检索与其相似的函数.对检索返回的相似函数用自然语言处理工具对函数名进行解析并获取标注词条,然后,从相应的函数体中提取特征代码并与相应的标注词条建立关联.基于此关联关系以及函数f的特征,自动推荐合适的函数名.该方法在开源项的1430个函数中进行了初步验证,结果表明:有22.7%的推荐结果与原函数名完全一致,有57.9%的推荐结果与原函数名关键词一致或基本一致.

    Abstract:

    Quality of method names is critical for the readability and maintainability of program. However, it is difficult for software engineers, especially non-English speaking, inexperienced engineers, to propose high quality method names. To address this issue, this paper proposes an approach to recommend method names. First, a method corpus is constructed from open source applications. For a given method f to be named, similar methods are retrieved from the method corpus. Names of these retrieved methods are divided into phrases, and features of these methods are extracted as well. A mapping between these phrases and features is also created to derive a list of candidate phrases and features for the method to be named. These phrases are finally constructed into candidate method names. The proposed approach is evaluated on 1430 methods in open source applications. Evaluation results suggest that 22.7 percent of recommended method names are the same as original ones, and 57.9 percent has the same or almost the same keywords as original ones.

    参考文献
    相似文献
    引证文献
引用本文

高原,刘辉,樊孝忠,牛振东.基于代码库和特征匹配的函数名称推荐方法.软件学报,2015,26(12):3062-3074

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2013-12-03
  • 最后修改日期:2015-01-08
  • 录用日期:
  • 在线发布日期: 2015-12-04
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号