SLIPCOVER: Near Zero-Overhead Code Coverage for Python

PROCEEDINGS OF THE 32ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2023(2023)

引用 0|浏览19
暂无评分
摘要
Coverage analysis is widely used but can suffer from high overhead. This overhead is especially acute in the context of Python, which is already notoriously slow (a recent study observes a roughly 30x slowdown vs. native code). We find that the state-of-the-art coverage tool for Python, coverage.py, introduces a median overhead of 180% with the standard Python interpreter. Slowdowns are even more extreme when using PyPy, a JIT-compiled Python implementation, with coverage.py imposing a median overhead of 1,300%. This performance degradation reduces the utility of coverage analysis in most use cases, including testing and fuzzing, and precludes its use in deployment. This paper presents SLIPCOVER, a novel, near-zero overhead coverage analyzer for Python. SLIPCOVER works without modifications to either the Python interpreter or PyPy. It first processes a program's AST to accurately identify all branches and lines. SLIPCOVER then dynamically rewrites Python bytecodes to add lightweight instrumentation to each identified branch and line. At run time, SLIPCOVER periodically de-instruments already-covered lines and branches. The result is extremely low overheads-a median of just 5%-making SLIPCOVER suitable for use in deployment. We show its efficiency can translate to significant increases in the speed of coverage-based clients. As a proof of concept, we integrate SLIPCOVER into TPBT, a targeted property-based testing system, and observe a 22x speedup.
更多
查看译文
关键词
Testing,Code Coverage,Dynamic Code Instrumentation,Python
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要