基于注释重用和程序解析的代码注释自动生成

Yang Bai, Liping Zhang, Sheng Yan
{"title":"基于注释重用和程序解析的代码注释自动生成","authors":"Yang Bai, Liping Zhang, Sheng Yan","doi":"10.1109/IICSPI48186.2019.9095968","DOIUrl":null,"url":null,"abstract":"In order to solve the problem of rare comments and low quality, a method of automatically generating code comments by comment reuse and program parsing is proposed. First, the clone code is detected by Nicad, and the codes and their comments are extracted. Then, through a series of heuristic rules such as dedrying and generalization, the code and the relatively simple code comments are streamlined and optimized. For complex code comments with obvious semantic characteristics, the program parsing method is used to optimize, finally, the comments are mapped to the code to automatically generate comments for the target code. In order to verify the validity of the experiment, the code comments in the 14 target software were manually verified, the comment results were evaluated, and then the five softwares were compared with the previous methods of ours team. The experimental results show that 33.69% of the code comments are good, the generated comments are 14.13% higher than the previous experimental methods, and the quality is improved by about 5%.","PeriodicalId":318693,"journal":{"name":"2019 2nd International Conference on Safety Produce Informatization (IICSPI)","volume":"46 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"Automatic Generation of Code Comments Based on Comment Reuse and Program Parsing\",\"authors\":\"Yang Bai, Liping Zhang, Sheng Yan\",\"doi\":\"10.1109/IICSPI48186.2019.9095968\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In order to solve the problem of rare comments and low quality, a method of automatically generating code comments by comment reuse and program parsing is proposed. First, the clone code is detected by Nicad, and the codes and their comments are extracted. Then, through a series of heuristic rules such as dedrying and generalization, the code and the relatively simple code comments are streamlined and optimized. For complex code comments with obvious semantic characteristics, the program parsing method is used to optimize, finally, the comments are mapped to the code to automatically generate comments for the target code. In order to verify the validity of the experiment, the code comments in the 14 target software were manually verified, the comment results were evaluated, and then the five softwares were compared with the previous methods of ours team. The experimental results show that 33.69% of the code comments are good, the generated comments are 14.13% higher than the previous experimental methods, and the quality is improved by about 5%.\",\"PeriodicalId\":318693,\"journal\":{\"name\":\"2019 2nd International Conference on Safety Produce Informatization (IICSPI)\",\"volume\":\"46 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-11-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2019 2nd International Conference on Safety Produce Informatization (IICSPI)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/IICSPI48186.2019.9095968\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 2nd International Conference on Safety Produce Informatization (IICSPI)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IICSPI48186.2019.9095968","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

摘要

为了解决代码注释少、质量低的问题,提出了一种通过注释重用和程序解析来自动生成代码注释的方法。首先,Nicad检测克隆代码,提取代码及其注释。然后,通过一系列启发式规则如去干和泛化,对代码和相对简单的代码注释进行精简和优化。对于语义特征明显的复杂代码注释,采用程序解析的方法进行优化,最后将注释映射到代码中,为目标代码自动生成注释。为了验证实验的有效性,我们对14个目标软件中的代码注释进行了人工验证,并对注释结果进行了评价,然后将这5个软件与我们团队之前的方法进行了比较。实验结果表明,33.69%的代码注释是好的,生成的注释比以前的实验方法提高了14.13%,质量提高了约5%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Automatic Generation of Code Comments Based on Comment Reuse and Program Parsing
In order to solve the problem of rare comments and low quality, a method of automatically generating code comments by comment reuse and program parsing is proposed. First, the clone code is detected by Nicad, and the codes and their comments are extracted. Then, through a series of heuristic rules such as dedrying and generalization, the code and the relatively simple code comments are streamlined and optimized. For complex code comments with obvious semantic characteristics, the program parsing method is used to optimize, finally, the comments are mapped to the code to automatically generate comments for the target code. In order to verify the validity of the experiment, the code comments in the 14 target software were manually verified, the comment results were evaluated, and then the five softwares were compared with the previous methods of ours team. The experimental results show that 33.69% of the code comments are good, the generated comments are 14.13% higher than the previous experimental methods, and the quality is improved by about 5%.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信