数据驱动的代码注释自动生成方法研究

基本信息
批准号:61902441
项目类别:青年科学基金项目
资助金额:29.00
负责人:黄袁
学科分类:
依托单位:中山大学
批准年份:2019
结题年份:2022
起止时间:2020-01-01 - 2022-12-31
项目状态: 已结题
项目参与者:
关键词:
注释生成代码注释深度学习软件维护核心代码片段
结项摘要

To meet the requirements of software code reuse and maintenance and reduce the burden of developers, automatic code comment generation has become a research hotspot in recent years. This project intends to propose a data-driven automatic code comment generation method. Specifically, it is divided into three sub-tasks, that is, the identification of core code snippets within a function, the automatic generation of function block comment, and the automatic generation of function header comment. In the first task, automatically identifying the snippets that need to be commented in a function. The snippets that need to be commented are called the core snippets of the function. In the second task, the core code snippets are used as commenting objects, and a learning-based algorithm is used to generate the function block comments. In the third task, we focus on the influence of core code snippet on the generation of function header comment, and study the automatic generation method of function header comments based on the weight of code snippets. The combination of task 1 and task 2 can make the block comment generation algorithm more intelligent and further reduce the burden on programmers. During block comment generation, task 1 can automatically determine which code snippets need to be commented, thus avoiding the programmer's involvement in the decision. The combination of task 1 and task 3 can further highlight the role of the core code snippets in the function header comment generation and improve the accuracy of the function header comment generation algorithm.

为了满足软件代码复用和维护上的需求,减轻开发人员的工作负担,自动生成代码注释成为了近年来的研究热点。本项目拟提出一种数据驱动的代码注释自动生成方法。具体分为三个子任务,即:函数内部核心代码片段识别、函数块注释自动生成、函数头注释自动生成。在任务一中,自动识别函数内部需要被注释的代码片段。需要被注释的代码片段被称为函数的核心代码片段。在任务二中,将核心代码片段作为注释对象,使用基于学习的算法自动生成函数块注释。在任务三中,重点考虑核心代码片段对于生成函数头注释的影响,研究基于代码片段权重的函数头注释自动生成方法。任务一与任务二的结合可以使函数块注释生成算法更加智能,进一步减轻程序员的负担。在块注释生成过程中,任务一可以自动决定函数内部需要添加注释的代码片段,从而避免了让程序员参与决策。任务一与任务三结合可以进一步凸显核心代码片段在函数头注释生成过程中的作用,提升函数头注释生成算法的准确率。

项目摘要

为了满足软件代码复用和维护上的需求,减轻开发人员的工作负担,项目面向自动生成代码注释展开了研究。项目按计划顺利执行,完成申请书中规定的内容。项目取得多项重要研究进展,包括实现了一种自动识别函数内部需要被注释的代码片段(核心代码片段)算法;实现了一种面向核心代码片段自动生成函数块注释的方法。收集多个代码注释数据集,实现多种代码注释自动生成算法。在CCF A及B类期刊和会议上发表相关论文7篇,其中CCF A类论文2篇,CCF B论文5篇(SCI论文6篇,EI论文1篇)。申请国家发明专利 2项,申请软件著作权 2项。项目的完成,其科学意义在于能够自动生成函数内部注释(已有方法只能自动生成函数头部注释)。项目产生的成果具有一定的应用前景,相关注释自动生成算法可以集成到Eclipse这样的IDE当中,帮助程序员在编写代码的时候自动生成代码注释。同时,对于源代码不可用的场景下,我们的方法也可以基于字节码生成代码注释,用于判定字节码是否实现了用户期望的程序功能。

项目成果
{{index+1}}

{{i.achievement_title}}

{{i.achievement_title}}

DOI:{{i.doi}}
发表时间:{{i.publish_year}}

暂无此项成果

数据更新时间:2023-05-31

其他相关文献

1

基于公众情感倾向的主题公园评价研究——以哈尔滨市伏尔加庄园为例

基于公众情感倾向的主题公园评价研究——以哈尔滨市伏尔加庄园为例

DOI:
发表时间:2022
2

F_q上一类周期为2p~2的四元广义分圆序列的线性复杂度

F_q上一类周期为2p~2的四元广义分圆序列的线性复杂度

DOI:10.11999/JEIT210095
发表时间:2021
3

基于协同表示的图嵌入鉴别分析在人脸识别中的应用

基于协同表示的图嵌入鉴别分析在人脸识别中的应用

DOI:10.3724/sp.j.1089.2022.19009
发表时间:2022
4

一种改进的多目标正余弦优化算法

一种改进的多目标正余弦优化算法

DOI:
发表时间:2019
5

面向工件表面缺陷的无监督域适应方法

面向工件表面缺陷的无监督域适应方法

DOI:
发表时间:2021

黄袁的其他基金

相似国自然基金

1

一种基于数据驱动的无人船艇航线自动生成方法

批准号:51709165
批准年份:2017
负责人:张树凯
学科分类:E1104
资助金额:23.00
项目类别:青年科学基金项目
2

基于张量积的向量化代码自动生成和调优技术研究

批准号:61572025
批准年份:2015
负责人:刘仲
学科分类:F0204
资助金额:48.00
项目类别:面上项目
3

深度生成学习机制驱动的空间信息服务自动组合方法

批准号:41871302
批准年份:2018
负责人:李文波
学科分类:D0114
资助金额:58.00
项目类别:面上项目
4

代码大数据驱动的大规模软件故障诊断技术研究

批准号:61872373
批准年份:2018
负责人:李姗姗
学科分类:F0203
资助金额:63.00
项目类别:面上项目