TG-CUP: A Transformer and GNN-Based Multi-Modal Comment Updating Method

Y. Chen, Yuan Huang, Xiangping Chen, Zibin Zheng · ACM Transactions on Software Engineering and Methodology · 2024

Comments play a crucial role in code comprehension and maintenance. This is particularly vital when the code is changed, as comments should be promptly updated to maintain consistency between the code and the comments. Existing comment update methods usually treat code as natural language text, ignore the information of code structure, and often fail when code changes are not associated with comment updates (called a non-code-indicative update (NCIU)). Therefore, we propose a Transformer and Graph neural network-based Comment UPdate method (TG-CUP). The model integrates the information of old comment, code edit sequence, and AST-Difference Graph to update the outdated comments. The experimental results show that TG-CUP increased by 5.16% and 2.23% compared with the most advanced methods on Accuracy and Recall@5, and the performance on NCIUs is improved as well.

Read the paper · More papers on PaperTik