一句话:FastLog 端到端预测日志插入位置并生成完整日志语句,效率与质量均优于现有方法。
日志语句的质量直接影响基于日志的软件维护任务,已有辅助开发者编写日志的工作要么只覆盖整个流程中的部分子任务,要么时间开销较高且可能引入多余修改。本文提出 FastLog,支持日志语句生成与插入的完整活动,且速度极快。给定一个程序方法,FastLog 首先在最细的 token 粒度上预测日志插入位置,随后生成完整的日志语句并插入。为提升长输入文本下插入位置预测的准确率,方法还采用了文本切分策略。全面的实证分析表明,FastLog 在效率与输出质量两方面均优于当前最先进的方法,显示出其在实时智能开发环境中的巨大潜力与实用性。
Logs play a crucial role in modern software systems, serving as a means for developers to record essential information for future software maintenance. As the performance of these log-based maintenance tasks heavily relies on the quality of logging statements, various works have been proposed to assist developers in writing appropriate logging statements. However, these works either only support developers in partial sub-tasks of this whole activity; or perform with a relatively high time cost and may introduce unwanted modifications. To address their limitations, we propose FastLog, which can support the complete logging statement generation and insertion activity, in a very speedy manner. Specifically, given a program method, FastLog first predicts the insertion position in the finest token level, and then generates a complete logging statement to insert. We further use text splitting for long input texts to improve the accuracy of predicting where to insert logging statements. A comprehensive empirical analysis shows that our method outperforms the state-of-the-art approach in both efficiency and output quality, which reveals its great potential and practicality in current real-time intelligent development environments.
DOI 原文 ·
@inproceedings{paperbot8574,
title = {FastLog: An End-to-End Method to Efficiently Generate and Insert Logging Statements},
author = {Xiaoyuan Xie and Zhipeng Cai and Songqiang Chen and Jifeng Xuan},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3652107}
}