arrow
返回

An alternative to code comment generation? Generating comment from bytecode

delete2025-03-01
delete0
PRE
AI
X
Xiangping Chen
陈俊琦 封面图
陈俊琦 (Junqi Chen)
L
Lian, Zhilu
黄袁 封面图
黄袁 (Yuan Huang) *
X
Xiaocong Zhou
吴
吴云志 (Yunzhi Wu)
Z
Zibin Zheng
DOI:10.1016/j.infsof.2024.107623delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Context: Due to the importance and necessity of code comments, recent works propose many comment generation models with source code as input. But sometimes there has no access to obtain the source code, only the bytecode, such as many Apps. Objective: If there is away to generate comments for bytecode directly, tasks such as malware detection and understanding closed-source software can benefit from the generated comment because it improves the understandability of the system. Therefore, we propose a novel approach called ByteGen to generate comments from bytecode. Methods: Specifically, to extract the structure characteristic of the bytecode, we utilize the control flow graph (CFG) of the bytecode and use a special traversal named enhanced SBT to serialize CFG. The enhanced SBT can completely preserve the structure of the CFG in a sequence. We set up experiments on a dataset with a scale of about 50,000 bytecode-comment pairs collected from Maven. Results: Experimental results show that the average BLEU-4 score of ByteGen is 28.67, which outperforms several baselines, and a human study also indicates the effectiveness of ByteGen in generating comments from bytecodes. Conclusion: In general, ByteGen performs better than other baselines. Therefore, this also proves the effectiveness of our approach in the code comment generation scenario without source code.
Keyword:
Code comment
Comment generation
Bytecode
Source code unavailable

期刊

Information and Software Technology 封面图
Information and Software Technology
IF:
4.3
论文数:
3.8K
被引数:
7.7K

机构

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

引用论文

err
IF0
err
err0
errOAAI
err
err分享
err收藏
Surgery of the Horseshoe Kidney
err1952-05-01
err0
PREAI
errOswald S. Lowsley
err分享
err收藏
A Comparative Study on Method Comment and Inline Comment方法注释与内联注释的比较研究
err2023-07-22
err8
errOAAI
errHuang, Yuan; Guo, Hanyang; Ding, Xi; Shu, Junhuai; Chen, Xiangping; Luo, Xiapu; Zheng, Zibin; Zhou, Xiaocong
err分享
err收藏
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
err2018-10-01
err195
errOAAI
errXia, Xin; Bao, Lingfeng; Lo, David; Xing, Zhenchang; Hassan, Ahmed E.; Li, Shanping
err分享
err收藏
err分享
err收藏
学者 查看更多内容