返回
Towards Improving the Performance of Comment Generation Models by Using BytecodeInformation
DOI:10.1109/TSE.2024.3523713.png)
摘要
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

