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}
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.
期刊介绍:
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.