基于联合推理的软件开发中过时注释的及时检测

IF 4.3 2区 计算机科学 Q1 ENGINEERING, ELECTRICAL & ELECTRONIC
Jiaxi Tan;Shikai Guo;Zijian Tao;Zhiguo Yang;Hui Li
{"title":"基于联合推理的软件开发中过时注释的及时检测","authors":"Jiaxi Tan;Shikai Guo;Zijian Tao;Zhiguo Yang;Hui Li","doi":"10.1109/TCE.2025.3535632","DOIUrl":null,"url":null,"abstract":"Code comments are a crucial source of software to learn various aspects of code. However, with the iterative upgrades of software, outdated code comments are increasingly prevalent. Inconsistencies in code comments can mislead developers and lead to potential errors. Due to the complexity of semantic information and interactions between source code and comments, previous studies have difficulty capturing the long-term and non-sequential dependencies in source code and the complex interaction information between code and comments. To address these challenges in outdated comment detection, we propose an approach named OutComDeter consists of the following four components, i.e., the data processing component, the jointly reasoning component, the feature extraction component and the outdated comment detection component. Firstly, the data processing component transforms source code and comments into edit sequences and comment sequences. Subsequently, to address the limitations of existing methods in capturing the interactive information between code and comments, the joint reasoning component employs two encoders with co-matching attention network to incorporate the joint relational information between code and comments into their respective feature representations. This joint relational information thereby contributes to the detection of outdated code comments. Furthermore, to mitigate the interference caused by the lack of long-term and non-sequential dependencies in source code for the task of outdated code comment detection, the feature extraction component leverages multi-head attention layers and dot-product attention layers to capture these dependencies, forming the final feature representations for both code and comments. Finally, the outdated comment detection will detect the outdated comments through a non-linear transformation. The experimental results indicate that OutComDeter outperforms the state-of-the-art methods in detecting outdated comments, as evidenced by higher Precision, Recall, and F1-Score. Compared to the state-of-the-art outdated comments detection methods, OutComDeter achieves an improvement in the F1-score by 70.1% compared to FracoDetector, 69.1% compared to RandomForest, and 11.5% compared to OCD respectively, which could efficiently detect Just-In-Time outdated comments.","PeriodicalId":13208,"journal":{"name":"IEEE Transactions on Consumer Electronics","volume":"71 1","pages":"655-672"},"PeriodicalIF":4.3000,"publicationDate":"2025-01-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Just-in-Time Detection of Outdated Comments in Software Development by Jointly Reasoning\",\"authors\":\"Jiaxi Tan;Shikai Guo;Zijian Tao;Zhiguo Yang;Hui Li\",\"doi\":\"10.1109/TCE.2025.3535632\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Code comments are a crucial source of software to learn various aspects of code. However, with the iterative upgrades of software, outdated code comments are increasingly prevalent. Inconsistencies in code comments can mislead developers and lead to potential errors. Due to the complexity of semantic information and interactions between source code and comments, previous studies have difficulty capturing the long-term and non-sequential dependencies in source code and the complex interaction information between code and comments. To address these challenges in outdated comment detection, we propose an approach named OutComDeter consists of the following four components, i.e., the data processing component, the jointly reasoning component, the feature extraction component and the outdated comment detection component. Firstly, the data processing component transforms source code and comments into edit sequences and comment sequences. Subsequently, to address the limitations of existing methods in capturing the interactive information between code and comments, the joint reasoning component employs two encoders with co-matching attention network to incorporate the joint relational information between code and comments into their respective feature representations. This joint relational information thereby contributes to the detection of outdated code comments. Furthermore, to mitigate the interference caused by the lack of long-term and non-sequential dependencies in source code for the task of outdated code comment detection, the feature extraction component leverages multi-head attention layers and dot-product attention layers to capture these dependencies, forming the final feature representations for both code and comments. Finally, the outdated comment detection will detect the outdated comments through a non-linear transformation. The experimental results indicate that OutComDeter outperforms the state-of-the-art methods in detecting outdated comments, as evidenced by higher Precision, Recall, and F1-Score. Compared to the state-of-the-art outdated comments detection methods, OutComDeter achieves an improvement in the F1-score by 70.1% compared to FracoDetector, 69.1% compared to RandomForest, and 11.5% compared to OCD respectively, which could efficiently detect Just-In-Time outdated comments.\",\"PeriodicalId\":13208,\"journal\":{\"name\":\"IEEE Transactions on Consumer Electronics\",\"volume\":\"71 1\",\"pages\":\"655-672\"},\"PeriodicalIF\":4.3000,\"publicationDate\":\"2025-01-28\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"IEEE Transactions on Consumer Electronics\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://ieeexplore.ieee.org/document/10856272/\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"ENGINEERING, ELECTRICAL & ELECTRONIC\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Consumer Electronics","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/10856272/","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"ENGINEERING, ELECTRICAL & ELECTRONIC","Score":null,"Total":0}
引用次数: 0

摘要

代码注释是软件学习代码各个方面的重要来源。然而,随着软件的迭代升级,过时的代码注释越来越普遍。代码注释中的不一致会误导开发人员并导致潜在的错误。由于源代码与注释之间的语义信息和交互的复杂性,以往的研究难以捕获源代码中的长期和非顺序依赖关系以及代码与注释之间复杂的交互信息。为了解决过时评论检测中的这些挑战,我们提出了一种名为OutComDeter的方法,该方法由以下四个组件组成,即数据处理组件、联合推理组件、特征提取组件和过时评论检测组件。首先,数据处理组件将源代码和注释转换为编辑序列和注释序列。随后,为了解决现有方法在捕获代码和注释之间交互信息方面的局限性,联合推理组件采用两个具有协同匹配关注网络的编码器,将代码和注释之间的联合关系信息合并到各自的特征表示中。因此,这种联合关系信息有助于检测过时的代码注释。此外,为了减轻过时代码注释检测任务中源代码中缺乏长期和非顺序依赖所造成的干扰,特征提取组件利用多头注意层和点积注意层来捕获这些依赖,形成代码和注释的最终特征表示。最后,过时评论检测将通过非线性转换检测过时评论。实验结果表明,OutComDeter在检测过时评论方面优于最先进的方法,这可以通过更高的准确率、召回率和F1-Score得到证明。与目前最先进的过时评论检测方法相比,OutComDeter的f1分数比FracoDetector提高了70.1%,比RandomForest提高了69.1%,比OCD提高了11.5%,可以有效地检测到即时过时评论。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Just-in-Time Detection of Outdated Comments in Software Development by Jointly Reasoning
Code comments are a crucial source of software to learn various aspects of code. However, with the iterative upgrades of software, outdated code comments are increasingly prevalent. Inconsistencies in code comments can mislead developers and lead to potential errors. Due to the complexity of semantic information and interactions between source code and comments, previous studies have difficulty capturing the long-term and non-sequential dependencies in source code and the complex interaction information between code and comments. To address these challenges in outdated comment detection, we propose an approach named OutComDeter consists of the following four components, i.e., the data processing component, the jointly reasoning component, the feature extraction component and the outdated comment detection component. Firstly, the data processing component transforms source code and comments into edit sequences and comment sequences. Subsequently, to address the limitations of existing methods in capturing the interactive information between code and comments, the joint reasoning component employs two encoders with co-matching attention network to incorporate the joint relational information between code and comments into their respective feature representations. This joint relational information thereby contributes to the detection of outdated code comments. Furthermore, to mitigate the interference caused by the lack of long-term and non-sequential dependencies in source code for the task of outdated code comment detection, the feature extraction component leverages multi-head attention layers and dot-product attention layers to capture these dependencies, forming the final feature representations for both code and comments. Finally, the outdated comment detection will detect the outdated comments through a non-linear transformation. The experimental results indicate that OutComDeter outperforms the state-of-the-art methods in detecting outdated comments, as evidenced by higher Precision, Recall, and F1-Score. Compared to the state-of-the-art outdated comments detection methods, OutComDeter achieves an improvement in the F1-score by 70.1% compared to FracoDetector, 69.1% compared to RandomForest, and 11.5% compared to OCD respectively, which could efficiently detect Just-In-Time outdated comments.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
CiteScore
7.70
自引率
9.30%
发文量
59
审稿时长
3.3 months
期刊介绍: The main focus for the IEEE Transactions on Consumer Electronics is the engineering and research aspects of the theory, design, construction, manufacture or end use of mass market electronics, systems, software and services for consumers.
×
引用
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学术文献互助群
群 号:604180095
Book学术官方微信