mlsanityData to 14 Oct 2026

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

arXiv 2112.01259 ↗First posted 2 Dec 2021cs.SE cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

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% and achieves 40.86% higher performance on BLEU and ROUGE scores for predicting the description of logging statements when compared to prior research (RQ3).

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 19 of its 82 references that are in the map. First posted on arXiv 2 Dec 2021.

Builds on

19 of 82 references.

References · 19

  1. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  2. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
  3. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
  4. 2015A Neural Attention Model for Abstractive Sentence Summarizationcited by 396
  5. 2015LSTM: A Search Space Odysseycited by 316
  6. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
  7. 2015End-to-End Attention-based Large Vocabulary Speech Recognitioncited by 151
  8. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
  9. 2018Neural Document Summarization by Jointly Learning to Score and Select Sentencescited by 56
  10. 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
  11. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  12. 2017A Neural Architecture for Generating Natural Language Descriptions from Source Code Changescited by 23
7 more
  1. 2014Mining Idioms from Source Codecited by 19
  2. 2018Oreo: Detection of Clones in the Twilight Zonecited by 19
  3. 2016Learning Python Code Suggestion with a Sparse Pointer Networkcited by 12
  4. 2021Studying Duplicate Logging Statements and Their Relationships with Code Clonescited by 7
  5. 2021An Exploratory Study of Log Placement Recommendation in an Enterprise Systemcited by 4
  6. 2021What Distributed Systems Say: A Study of Seven Spark Application Logscited by 3
  7. 2021Leveraging Code Clones and Natural Language Processing for Log Statement Predictioncited by 1

Built on by

Not cited yet.