融合结构与语义特征的代码注释决策支持方法
作者:
作者单位:

作者简介:

黄袁(1987-),男,四川内江人,博士,副研究员,主要研究领域为软件工程,程序理解,软件工程过程数据挖掘;陈湘萍(1981-),女,博士,助理研究员,CCF专业会员,主要研究领域为数据驱动的软件工程,程序理解,Web工程;贾楠(1988-),女,博士,讲师,主要研究领域为计算机仿真,数据挖掘;熊英飞(1982-),男,博士,研究员,博士生导师,CCF专业会员,主要研究领域为软件工程,程序设计语言;周强(1993-),男,硕士,主要研究领域为软件工程,软件工程过程数据挖掘;罗笑南(1963-),男,博士,教授,博士生导师,主要研究领域为图形图像处理,三维仿真CAD技术,数字家庭技术

通讯作者:

陈湘萍,E-mail:chenxp8@mail.sysu.edu.cn

中图分类号:

基金项目:

国家重点研发计划(2016YFB1000101);国家自然科学基金(61672545,61402546);广东省科技计划项目(2013B0907 00009);中山市科技计划项目(2016A1044)


Method Combining Structural and Semantic Features to Support Code Commenting Decision
Author:
Affiliation:

Fund Project:

National Key Research and Development Program of China (2016YFB1000101); National Natural Science Foundation of China (61672545, 61402546); Science and Technology Planning Project of Guangdong Province (2013B090700009); Science and Technology Planning Project of Zhongshan City (2016A1044)

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

    代码注释是辅助编程人员理解源代码的有效手段之一.高质量的注释决策不仅能够覆盖软件系统中的核心代码片段,还能避免产生多余的代码注释.然而在实际开发中,编程人员往往缺乏统一的注释规范,大部分的注释决策都取决于个人经验以及领域知识.对于新手程序员来说,注释决策显然成为一项重要而艰巨的任务.为了减少编程人员投入过多的精力在注释决策上,从大量的代码注释实例中学习出一种通用的注释决策规范,并提出了CommentAdviser方法,以辅助编程人员在代码开发过程中做出恰当的注释决策.由于注释决策与代码本身的上下文信息密切相关,因此,从当前代码行的上下文代码中提取代码结构特征以及代码语义特征作为支持注释决策的主要依据.然后,利用机器学习算法判定当前代码行是否为可能的注释点.在GitHub中的10个大型开源软件的数据集上评估了所提出的方法,实验结果以及用户调研表明,代码注释决策支持CommentAdviser方法的可行性和有效性.

    Abstract:

    Code comment is quite important to help developer review and comprehend source code. Strategic comment decision is desired to cover core code snippets of software system without incurring unintended trivial comments. However, in current practice, there is a lack of rigorous specifications for developers to make their comment decisions. Commenting has become an important yet tough decision which mostly depends on the personal experience of developers. To reduce the effort on making comment decisions, this paper investigates a unified commenting regulation from a large number of commenting instances. A method, CommentAdviser, is proposed to guide developers in placing comments in source code. Since making comment is closely related to the context information of source code themselves, the method identifies this important factor for determining where to comment and extract them as structural context feature and semantic context feature. Next, machine learning techniques are applied to identify the possible commenting locations in source code. CommentAdviser is evaluated on 10 data sets from GitHub. The experimental results, as well as a user study, demonstrate the feasibility and effectiveness of CommentAdviser.

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

黄袁,贾楠,周强,陈湘萍,熊英飞,罗笑南.融合结构与语义特征的代码注释决策支持方法.软件学报,2018,29(8):2226-2242

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

京公网安备 11040202500063号