Borrowing from Similar Code: A Deep Learning NLP-Based Approach for Log Statement Automation

12/02/2021
by   Sina Gholamian, et al.
0

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. However, the current logging process is mostly manual, and thus, proper placement and content of logging statements remain as challenges. To overcome these challenges, methods that aim to automate log placement and predict its content, i.e., 'where and what to log', are of high interest. Thus, we focus on predicting the location (i.e., where) and description (i.e., what) for log statements by utilizing source code clones and natural language processing (NLP), as these approaches provide additional context and advantage for log prediction. Specifically, we guide our research with three research questions (RQs): (RQ1) how similar code snippets, i.e., code clones, can be leveraged for log statements prediction? (RQ2) how the approach can be extended to automate log statements' descriptions? and (RQ3) how effective the proposed methods are for log location and description prediction? To pursue our RQs, we perform an experimental study on seven open-source Java projects. We introduce an updated and improved log-aware code-clone detection method to predict the location of logging statements (RQ1). Then, we incorporate natural language processing (NLP) and deep learning methods to automate the log statements' description prediction (RQ2). Our analysis shows that our hybrid NLP and code-clone detection approach (NLP CC'd) outperforms conventional clone detectors in finding log statement locations on average by 15.60 performance on BLEU and ROUGE scores for predicting the description of logging statements when compared to prior research (RQ3).

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/08/2021

Leveraging Code Clones and Natural Language Processing for Log Statement Prediction

Software developers embed logging statements inside the source code as a...
research
01/13/2022

Using Deep Learning to Generate Complete Log Statements

Logging is a practice widely adopted in several phases of the software l...
research
12/06/2021

A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree of Interest

Logging is a significant programming practice. Due to the highly transac...
research
03/02/2021

An Exploratory Study of Log Placement Recommendation in an Enterprise System

Logging is a development practice that plays an important role in the op...
research
12/11/2019

Using GGNN to recommend log statement level

In software engineering, log statement is an important part because prog...
research
06/01/2021

Studying Duplicate Logging Statements and Their Relationships with Code Clones

In this paper, we focus on studying duplicate logging statements, which ...
research
02/13/2020

On Learning Meaningful Assert Statements for Unit Test Cases

Software testing is an essential part of the software lifecycle andrequi...

Please sign up or login with your details

Forgot password? Click here to reset