{"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}
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%.