Learning from Mistakes: Understanding Ad-hoc Logs through Analyzing Accidental Commits
Yi-Hung Chou, Yiyang Min, April Yi Wang, James A. Jones

TL;DR
This paper investigates developers' use of temporary ad-hoc logs in code by analyzing accidental commits and live coding videos, providing the first large-scale empirical study and dataset on this common but understudied practice.
Contribution
It introduces the first large-scale dataset of accidental commits with ad-hoc logs and offers empirical insights into their usage patterns and contexts in software development.
Findings
Developers frequently use ad-hoc logs in asynchronous and callback functions.
A large dataset of 548,880 removed ad-hoc logs was collected from GitHub.
Insights into when, where, and why developers insert temporary logs in code.
Abstract
Developers often insert temporary "print" or "log" instructions into their code to help them better understand runtime behavior, usually when the code is not behaving as they expected. Despite the fact that such monitoring instructions, or "ad-hoc logs," are so commonly used by developers, there is almost no existing literature that studies developers' practices in how they use them. This paucity of knowledge of the use of these ephemeral logs may be largely due to the fact that they typically only exist in the developers' local environments and are removed before they commit their code to their revision control system. In this work, we overcome this challenge by observing that developers occasionally mistakenly forget to remove such instructions before committing, and then they remove them shortly later. Additionally, we further study such developer logging practices by watching and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAnomaly Detection Techniques and Applications
