arrow
返回

Towards Improving the Performance of Comment Generation Models by Using BytecodeInformation

delete2025-02-01
delete0
PRE
AI
黄袁 封面图
黄袁 (Yuan Huang)
黄金波 封面图
黄金波 (Jinbo Huang)
X
Xiangping Chen *
Z
Zibin Zheng
DOI:10.1109/TSE.2024.3523713delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code comment plays an important role in program understanding, and a large number of automatic comment generation methods have been proposed in recent years. To get a better effect of generating comments, many studies try to extract a variety of information (e.g., code tokens, AST traverse sequence, APIs call sequence) from source code as model input. In this study, we found that the bytecode compiled from the source code can provide useful information for comment generation, hence we propose to use the information from bytecode to assist the comment generation. Specifically, we extract the control flow graph (CFG) from the bytecode and propose a serialization method to obtain the CFG sequence that preserves the program structure. Then, we discuss three methods for introducing bytecode information for different models. We collected 390,000 Java methods from the maven repository, and created a dataset of 101,124 samples after deduplication and preprocessing to evaluate our method. The results show that introducing the information extracted from the bytecode can improve the BLEU-4 of 7 comment generation models.
Keyword:
Codes
Source coding
Data mining
Flow graphs
Transformers
Training
Software engineering
Neural networks
Java
Data models
Code comment
comment generation
control flow graph
bytecode

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.8K
被引数:
1.1W

机构

S
Sun Yat Sen University
学者数:
9.9W
论文数: 7.2W
被引数: 95