arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2109.03859cs.SEcs.LG
收藏

利用代码克隆和自然语言处理进行日志语句预测

Leveraging Code Clones and Natural Language Processing for Log Statement Prediction

University of Waterloo(滑铁卢大学)

Sina Gholamian

摘要:

软件开发人员将日志记录语句嵌入源代码中,作为现代软件开发中的一项重要职责,因为日志文件对于跟踪运行时系统问题和故障排除系统管理任务是必要的。先前的研究强调了日志语句在软件系统的操作和调试中的重要性。然而,当前的日志记录过程大多是手动和临时的,因此,日志记录语句的适当放置和内容仍然是一个挑战。为了克服这些挑战,旨在自动化日志放置和日志内容的方法,即,“在哪里,什么,以及如何记录”,都是很感兴趣的。因此,我们建议完成这项研究的目标,即“利用源代码克隆和自然语言处理(NLP)来预测日志语句",因为这些方法为日志预测提供了额外的上下文和优势。我们追求以下四个研究目标:(RO1)调查是否可以利用源代码克隆的日志语句位置预测,(RO2)提出了一个基于克隆的方法,日志语句预测,(RO3)预测日志语句的描述与代码克隆和NLP模型,和(RO4)检查方法来自动预测日志语句的其他细节,如其详细程度和变量。为此,我们对七个开源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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑