Faster Explicit-Trace Monitoring-Oriented Programming for Runtime Verification of Software Tests
Kevin Guan, Marcelo d'Amorim, Owolabi Legunsen
Abstract
Runtime verification (RV) monitors program executions for conformance with formal specifications (specs). This paper concerns Monitoring-Oriented Programming (MOP), the only RV approach shown to scale to thousands of open-source GitHub projects when simultaneously monitoring passing unit tests against dozens of specs. Explicitly storing traces-sequences of spec-related program events-can make it easier to debug spec violations or to monitor tests against hyperproperties, which requires reasoning about sets of traces. But, most online MOP algorithms are implicit trace, i.e. they work event by event to avoid the time and space costs of storing traces. Yet, TraceMOP, the only explicit-trace online MOP algorithm, is often too slow and often fails.
We propose LazyMOP, a faster explicit-trace online MOP algorithm for RV of tests that is enabled by three simple optimizations. First, whereas all existing online MOP algorithms eagerly monitor all events as they occur, LazyMOP lazily stores only unique traces at runtime and monitors them just before the test run ends. Lazy monitoring is inspired by a recent finding: 99.87% of traces during RV of tests are duplicates. Second, to speed up trace storage, LazyMOP encodes events and their locations as integers, and amortizes the cost of looking up locations across events. Lastly, LazyMOP only synchronizes accesses to its trace store after detecting multi-threading, unlike TraceMOP's eager and wasteful synchronization of all accesses.
On 179 Java open-source projects, LazyMOP is up to 4.9x faster and uses 4.8x less memory than TraceMOP, finding the same traces (modulo test non-determinism) and violations. We show LazyMOP's usefulness in the context of software evolution, where tests are re-run after each code change. LazyMOP ๐ optimizes LazyMOP in this context by generating fewer duplicate traces. Using unique traces from one code version, LazyMOP ๐ finds all pairs of method ๐ and spec ๐ , where all traces for ๐ in ๐ are identical. Then, in a future version, LazyMOP ๐ generates and monitors only one trace of ๐ in ๐. LazyMOP ๐ is up to 3.9x faster than LazyMOP and it speeds up two recent techniques that speed up RV during evolution by up to 4.6x with no loss in violations.
CCS Concepts: โข Software and its engineering โ Software testing and debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 99906ebe-4a24-4740-b65c-a1b818f8ad6fCited by top-tier papers3
- Faster Runtime Verification during Testing via Feedback-Guided Selective MonitoringShinhae Kim, Saikat Dutta, Owolabi LegunsenASE 2025 ยท 3 citations
- Fine-Grained Analyses for Evolution-Aware Runtime VerificationPengyue Jiang, Kevin Guan, Mahdi Khosravi, Moustafa Ismail et al.ICSE 2026 ยท 1 citation
- A Closer Look at the Use of Reinforcement Learning for Speeding Up Runtime Verification of Software Tests (Experience Paper)Shinhae Kim, Saikat Dutta, Owolabi LegunsenISSTA 2026
Builds on5
- More Precise Regression Test Selection via Reasoning about Semantics-Modifying ChangesYu Liu, Jiyang Zhang, Pengyu Nie, Milos Gligoric et al.ISSTA 2023 ยท 19 citations
- An In-Depth Study of Runtime Verification Overheads during Software TestingKevin Guan, Owolabi LegunsenISSTA 2024 ยท 7 citations
- Instrumentation-Driven Evolution-Aware Runtime VerificationKevin Guan, Owolabi LegunsenICSE 2025 ยท 4 citations
- IronSpec: Increasing the Reliability of Formal SpecificationsEli Goldweber, Weixin Yu, Seyed Armin Vakil-Ghahani, Manos KapritsosOSDI 2024 ยท 4 citations
- Hybrid Regression Test Selection by Integrating File and Method DependencesGuofeng Zhang, Luyao Liu, Zhenbang Chen, Ji WangASE 2024 ยท 2 citations
Related papers
- Predictive Monitoring against Pattern Regular LanguagesZhendong Ang, Umang MathurPOPL 2024 ยท 12 citations
- Quantitative and Approximate MonitoringThomas A. Henzinger, N. Ege SaraรงLICS 2021 ยท 15 citations
- Zeror: Speed Up Fuzzing with Coverage-sensitive Tracing and SchedulingChijin Zhou, Mingzhe Wang, Jie Liang, Zhe Liu et al.ASE 2020 ยท 35 citations
- Detecting JVM JIT Compiler Bugs via Exploring Two-Dimensional Input SpacesHaoxiang Jia, Ming Wen, Zifan Xie, Xiaochen Guo et al.ICSE 2023 ยท 21 citations
- Context-Free Property Oriented FuzzingJiaqiang Yao, Meixi Liu, Zhenbang Chen, Yongchao Xing et al.ICSE 2026
