Introduction
In modern mobile development, logging has evolved beyond local text files used for debugging. Developers increasingly rely on remote analytics services like Firebase to monitor application behavior in the wild. While traditional logging practices are well-documented, the specific characteristics of mobile analytics logging—how often it occurs, what it tracks, and how it is maintained—remain under-explored. This study provides an empirical characterization of these practices across 57 open-source Android projects.
Methodology
The researchers analyzed a dataset derived from GHTorrent, specifically targeting Android applications that utilize the Firebase Analytics library. A key challenge identified was the "Wrapper Pattern": developers rarely call Firebase APIs directly, instead opting for custom utility classes. By manually identifying these wrappers, the authors were able to accurately quantify logging statements. The study combined quantitative metrics, such as Source Lines of Code (SLOC) per log and code churn, with a qualitative analysis of 300 sampled logging statements.
Characterizing Logging Density
A primary finding of the study is that analytics logging is significantly "sparser" than traditional logging. The median density for analytics logs is 1,148 SLOC per statement, nearly eight times less frequent than the 145 SLOC median observed in traditional local logging.
As shown in the distribution above, the vast majority of projects maintain a high SLOC-to-log ratio. This selectivity is likely driven by concerns over resource consumption (battery and data) and the need to minimize noise in cloud-based dashboards.
Usage and Maintenance Patterns
The study also revealed that analytics logs are remarkably stable. Only 1.35% of commits involved modifications to analytics code, compared to approximately 10% for traditional logs. This suggests a "set it and forget it" mentality, where analytics are tied to stable business requirements rather than the evolving needs of active debugging.
Furthermore, the number of unique logging statements per project is generally low, with most applications implementing fewer than five distinct events. This reinforces the idea that developers are highly intentional about what they choose to track remotely.
Content Analysis and Implications
Qualitative labeling of logging statements showed a clear shift in audience from developers to stakeholders:
- Domain/Business Events (51.3%): Tracking core value actions like purchases or downloads.
- UI Events (38.7%): Monitoring user interaction patterns such as button clicks.
- Failures (6.3%): Surprisingly, analytics are rarely used for error reporting, which is likely offloaded to dedicated crash-reporting tools.
Conclusion
Mobile analytics logging represents a distinct engineering practice focused on user behavior and business logic rather than execution flow. For tool builders, the prevalence of the wrapper pattern suggests that current APIs may be too verbose. For researchers, the stability and sparsity of these logs highlight a different lifecycle compared to traditional diagnostic logging.
Summary updated