Following Breadcrumbs in Code: What Accidentally Committed Ad-Hoc Logs Reveal about Developer Comprehension

πŸ“… 2026-10-07
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This study addresses the ephemeral nature of temporary debugging logs and the lack of systematic research on how developers leverage them to comprehend runtime code behavior. To bridge this gap, we pioneer an approach that captures transient logs by mining accidental commits and live programming sessions, correlating static and dynamic features to construct a cross-language empirical dataset. Our analysis reveals that logging statements are densely concentrated within highly complex functions and identifies language-specific patterns, such as Java threading and JavaScript asynchronous constructs. Ultimately, this work provides novel perspectives and robust empirical evidence for understanding the challenges developers face when utilizing logs to facilitate code cognition.
πŸ“ Abstract
Developers frequently insert temporary print or log statements, known as **ad-hoc logs**, to better understand program behavior at runtime, particularly when facing unexpected issues or complex control flows. Despite being a nearly universal practice, systematic study has been limited because these logs are ephemeral: they usually remain only in local environments and are removed before code is committed, making them difficult to capture. In this work, we addressed this challenge by mining accidental commits where developers unintentionally left ad-hoc logs and later deleted them, and by analyzing live-streamed programming sessions to observe their use in practice. Using these methods, we constructed a large dataset across three major programming languages (Java, JavaScript, and Python), enabling the large-scale investigation of logging practices. Our analysis reveals both common and language-specific patterns in where and how developers rely on ad-hoc logs. Across languages, ad-hoc logs tend to appear in program regions that are harder to reason about at runtime. We also identify distinctive language-level patterns, such as frequent use in asynchronous and callback functions in JavaScript and in thread-related classes in Java. In addition, functions containing ad-hoc logs generally have higher cyclomatic complexity than the overall function population. Production logs show a similar association, consistent with logging serving as a means of observing runtime behavior in structurally complex functions. Together, these findings provide empirical insight into developers' runtime comprehension practices and offer a valuable dataset for researchers and tool builders seeking to better support debugging and logging.
Problem

Research questions and friction points this paper is trying to address.

ad-hoc logs
developer comprehension
logging practices
runtime behavior
code complexity
Innovation

Methods, ideas, or system contributions that make the work stand out.

Ad-hoc Logs
Mining Accidental Commits
Live-streamed Programming
Cyclomatic Complexity
Developer Comprehension
πŸ”Ž Similar Papers