paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Leveraging Code Clones and Natural Language Processing for Log Statement Prediction

利用代码克隆与自然语言处理进行日志语句预测
ASE 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)2021匹配度 2/10 · 该论文属于机器学习/NLP用于软件工程中的日志语句预测,虽涉及代码克隆与程序代码分析,但未涉及用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析。其方法基于传统NLP与代码克隆,而非LLM/Agentic或形式化分析,因此与研究画像匹配度低。引用 9 inbox
Sina Gholamian
crossref: 2026-09-12

AI 速览

一句话:提出利用代码克隆与NLP自动预测日志语句的位置、描述及详细级别和变量等细节,并在七个Java项目上优于先前工作。

软件日志对追踪运行时问题和系统调试至关重要,但当前日志插入与内容多依赖人工和临时决策,“何处、记录什么、如何记录”仍是难题。本文提出利用源代码克隆与自然语言处理预测日志语句:先研究代码克隆能否用于日志位置预测,继而提出基于克隆的日志语句预测方法,并结合代码克隆与NLP模型预测日志描述,进一步自动预测日志的详细级别和变量等细节。作者在七个开源Java项目上开展实验分析,抽取方法级代码克隆并考察其属性,用于日志位置和描述预测。结果表明,日志感知的克隆检测能有效支持自动化日志位置与描述预测,并优于先前工作。

问题
日志语句的放置与内容当前多依赖人工和临时决策,难以确定何处、记录什么及如何记录。
方法
利用源代码克隆与NLP,在七个开源Java项目上抽取方法级克隆并分析其属性,构建克隆驱动的日志位置、描述、详细级别和变量预测方法。
评估
在七个开源Java项目上进行实验,验证日志感知克隆检测对自动日志位置与描述预测的有效性,并显示优于先前工作。
原文摘要(Abstract)

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 原文 ·

BibTeX
@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}
}