Learning from Mistakes: Understanding Ad-hoc Logs through Analyzing Accidental Commits
METADATA ONLY
Author / Producer
Date
2025
Publication Type
Conference Paper
ETH Bibliography
yes
Citations
Altmetric
METADATA ONLY
Data
Rights / License
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 overcame 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 studied such developer logging practices by watching and analyzing live-streamed coding videos. Through these empirical approaches, we presented where, how, and why developers use ad-hoc logs to better understand their code and its execution. We collected 27 GB of accidental commits that removed 548,880 ad-hoc logs in JavaScript from GitHub Archive repositories to provide the first large-scale dataset and empirical studies on ad-hoc logging practices. Our results revealed several illuminating findings, including a particular propensity for developers to use ad-hoc logs in asynchronous and callback functions. Our findings provided both empirical evidence and a valuable dataset for researchers and tool developers seeking to enhance ad-hoc logging practices, and potentially deepen our understanding of developers’ practices towards understanding of software’s runtime behaviors.
Permanent link
Publication status
published
External links
Editor
Book title
2025 IEEE/ACM 22nd International Conference on Mining Software Repositories (MSR)
Journal / series
Volume
Pages / Article No.
1 - 13
Publisher
IEEE
Event
22nd International Conference on Mining Software Repositories (MSR 2025)
Edition / version
Methods
Software
Geographic location
Date collected
Date created
Subject
Empirical software engineering; Ad-hoc logs; Mining software repository
Organisational unit
09820 - Wang, April Yi / Wang, April Yi
Notes
Funding
Related publications and datasets
Is new version of: 10.48550/arXiv.2501.09892