一句话:提出利用代码克隆与NLP自动预测日志语句的位置、描述及详细级别和变量等细节,并在七个Java项目上优于先前工作。
软件日志对追踪运行时问题和系统调试至关重要,但当前日志插入与内容多依赖人工和临时决策,“何处、记录什么、如何记录”仍是难题。本文提出利用源代码克隆与自然语言处理预测日志语句:先研究代码克隆能否用于日志位置预测,继而提出基于克隆的日志语句预测方法,并结合代码克隆与NLP模型预测日志描述,进一步自动预测日志的详细级别和变量等细节。作者在七个开源Java项目上开展实验分析,抽取方法级代码克隆并考察其属性,用于日志位置和描述预测。结果表明,日志感知的克隆检测能有效支持自动化日志位置与描述预测,并优于先前工作。
Software developers embed logging statements inside the source code as an imperative duty in modern software development as log files are necessary for tracking down runtime system issues and troubleshooting system management tasks. Prior research has emphasized the importance of logging statements in the operation and debugging of software systems. However, the current logging process is mostly manual and ad hoc, and thus, proper placement and content of logging statements remain as challenges. To overcome these challenges, methods that aim to automate log placement and log content, i.e., ‘where, what, and how to log’, are of high interest. Thus, we propose to accomplish the goal of this research, that is “to predict the log statements by utilizing source code clones and natural language processing (NLP)”, as these approaches provide additional context and advantage for log prediction. We pursue the following four research objectives: (RO1) investigate whether source code clones can be leveraged for log statement location prediction, (RO2) propose a clone-based approach for log statement prediction, (RO3) predict log statement’s description with code-clone and NLP models, and (RO4) examine approaches to automatically predict additional details of the log statement, such as its verbosity level and variables. For this purpose, we perform an experimental analysis on seven open-source java projects, extract their method-level code clones, investigate their attributes, and utilize them for log location and description prediction. Our work demonstrates the effectiveness of log-aware clone detection for automated log location and description prediction and outperforms the prior work.
DOI 原文 ·
@inproceedings{paperbot6616,
title = {Leveraging Code Clones and Natural Language Processing for Log Statement Prediction},
author = {Sina Gholamian},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678596}
}