Data-Driven Approach for Log Instruction Quality Assessment

04/06/2022
by   Jasmin Bogatinovski, et al.
0

In the current IT world, developers write code while system operators run the code mostly as a black box. The connection between both worlds is typically established with log messages: the developer provides hints to the (unknown) operator, where the cause of an occurred issue is, and vice versa, the operator can report bugs during operation. To fulfil this purpose, developers write log instructions that are structured text commonly composed of a log level (e.g., "info", "error"), static text ("IP cannot be reached"), and dynamic variables (e.g. IP ). However, as opposed to well-adopted coding practices, there are no widely adopted guidelines on how to write log instructions with good quality properties. For example, a developer may assign a high log level (e.g., "error") for a trivial event that can confuse the operator and increase maintenance costs. Or the static text can be insufficient to hint at a specific issue. In this paper, we address the problem of log quality assessment and provide the first step towards its automation. We start with an in-depth analysis of quality log instruction properties in nine software systems and identify two quality properties: 1) correct log level assignment assessing the correctness of the log level, and 2) sufficient linguistic structure assessing the minimal richness of the static text necessary for verbose event description. Based on these findings, we developed a data-driven approach that adapts deep learning methods for each of the two properties. An extensive evaluation on large-scale open-source systems shows that our approach correctly assesses log level assignments with an accuracy of 0.88, and the sufficient linguistic structure with an F1 score of 0.99, outperforming the baselines. Our study shows the potential of the data-driven methods in assessing instructions quality and aid developers in comprehending and writing better code.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/18/2021

Speculative Analysis for Quality Assessment of Code Comments

Previous studies have shown that high-quality code comments assist devel...
research
08/17/2023

Are They All Good? Studying Practitioners' Expectations on the Readability of Log Messages

Developers write logging statements to generate logs that provide run-ti...
research
08/13/2022

The Sense of Logging in the Linux Kernel

Logging plays a crucial role in software engineering because it is key t...
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
02/15/2022

Documentation based Semantic-Aware Log Parsing

With the recent advances of deep learning techniques, there are rapidly ...
research
03/28/2023

Automatically Generating Dockerfiles via Deep Learning: Challenges and Promises

Containerization allows developers to define the execution environment i...
research
03/28/2023

Reproducibility is Nothing without Correctness: The Importance of Testing Code in NLP

Despite its pivotal role in research experiments, code correctness is of...

Please sign up or login with your details

Forgot password? Click here to reset