Back to Search Start Over

Mitigating the Uncertainty and Imprecision of Log-Based Code Coverage Without Requiring Additional Logging Statements

Authors :
Xu, Xiaoyan
Cogo, Filipe R.
McIntosh, Shane
Source :
IEEE Transactions on Software Engineering; September 2024, Vol. 50 Issue: 9 p2350-2362, 13p
Publication Year :
2024

Abstract

Understanding code coverage is an important precursor to software maintenance activities (e.g., better testing). Although modern code coverage tools provide key insights, they typically rely on code instrumentation, resulting in significant performance overhead. An alternative approach to code instrumentation is to process an application's source code and the associated log traces in tandem. This so-called “log-based code coverage” approach does not impose the same performance overhead as code instrumentation. Chen et al. proposed <sc>LogCoCo</sc> — a tool that implements log-based code coverage for <sc>Java</sc>. While <sc>LogCoCo</sc> breaks important new ground, it has fundamental limitations, namely: uncertainty due to the lack of logging statements in conditional branches, and imprecision caused by dependency injection. In this study, we propose <sc>Log2Cov</sc>, a tool that generates log-based code coverage for programs written in <sc>Python</sc> and addresses uncertainty and imprecision issues. We evaluate <sc>Log2Cov</sc> on three large and active open-source systems. More specifically, we compare the performance of <sc>Log2Cov</sc> to that of <sc>Coverage.py</sc>, an instrumentation-based coverage tool for <sc>Python</sc>. Our results indicate that 1) <sc>Log2Cov</sc> achieves high precision without introducing runtime overhead; and 2) uncertainty and imprecision can be reduced by up to 11% by statically analyzing the program's source code and execution logs, without requiring additional logging instrumentation from developers. While our enhancements make substantial improvements, we find that future work is needed to handle conditional statements and exception handling blocks to achieve parity with instrumentation-based approaches. We conclude the paper by drawing attention to these promising directions for future work.

Details

Language :
English
ISSN :
00985589
Volume :
50
Issue :
9
Database :
Supplemental Index
Journal :
IEEE Transactions on Software Engineering
Publication Type :
Periodical
Accession number :
ejs67450636
Full Text :
https://doi.org/10.1109/TSE.2024.3435067