一句话:大规模实证研究测试中运行时验证的开销分布、组成与浪费来源,并揭示离线插桩与跨版本摊销两类加速机会。
运行时验证(RV)在程序执行时对照形式规约进行监控,能增强测试的找 bug 能力,但其运行时开销被视为广泛采用的障碍;此前缺乏对测试场景下 RV 开销的普遍程度、找 bug 价值与组成的深入研究。本文监控 1,544 个开源项目的开发者单元测试,使用 160 条 JDK API 正确使用规约,发现:(1) 40.9% 的项目开销低于 12.48 秒,其余最高达 5,002.9 倍(28.7 小时);(2) RV 生成的监控器 99.87% 是浪费的,只能发现另外 0.13% 也能发现的 bug;(3) 与传统认知相反,多数项目开销由插桩而非监控主导;(4) 36.74% 的监控时间花在测试代码或库上。实验还表明,离线插桩(可行时)能大幅降低开销,而跨多个程序版本摊销高插桩成本比近期演化感知 RV 技术最高快 4.53 倍。
Runtime verification (RV) monitors program executions against formal specifications (specs). Researchers showed that RV during software testing amplifies the bug-finding ability of tests, and found hundreds of new bugs by using RV to monitor passing tests in open-source projects. But, RV’s runtime overhead is widely seen as a hindrance to its broad adoption, especially during continuous integration. Yet, there is no in-depth study of the prevalence, usefulness for bug finding, and components of these overheads during testing, so that researchers can better understand how to speed up RV. We study RV overhead during testing, monitoring developer-written unit tests in 1,544 open-source projects against 160 specs of correct JDK API usage. We make four main findings. (1) RV overhead is below 12.48 seconds, which others considered acceptable, in 40.9% of projects, but up to 5,002.9x (or, 28.7 hours) in the other projects. (2) 99.87% of monitors that RV generates to dynamically check program traces are wasted; they can only find bugs that the other 0.13% find. (3) Contrary to conventional wisdom, RV overhead in most projects is dominated by instrumentation, not monitoring. (4) 36.74% of monitoring time is spent in test code or libraries. As evidence that our study provides a new basis that future work can exploit, we perform two more experiments. First, we show that offline instrumentation (when possible) greatly reduces RV runtime overhead for single versions of many projects. Second, we show that simply amortizing high instrumentation costs across multiple program versions can outperform, by up to 4.53x, a recent evolution-aware RV technique that uses complex program analysis.
DOI 原文 ·
@inproceedings{paperbot8478,
title = {An In-Depth Study of Runtime Verification Overheads during Software Testing},
author = {Kevin Guan and Owolabi Legunsen},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3680400}
}