Skip to content
Book Open access

PyMOP: A Runtime Verification Tool for Python

Jul 2026 · SIGSOFT FSE Companion · pp. 222-226 · 2 citations · 55 references
Computer Science

TL;DR

PyMOP is presented, a generic, extensible, and more efficient Python RV tool that supports five logics, implements five monitoring algorithms, ships with 81 specs, and supports three instrumentation strategies that help find hundreds of bugs by monitoring test executions against formal specifications.

Abstract

Runtime verification (RV) now scales for testing in thousands of open-source Java projects, helping find hundreds of bugs by monitoring test executions against formal specifications (specs). The popular Python ecosystem could use such benefits. But, current Python RV tools are limited to a domain or spec logic, or they are slow. We present PyMOP, a generic, extensible, and more efficient Python RV tool. PyMOP supports five logics, implements five monitoring algorithms, ships with 81 specs, and supports three instrumentation strategies. On 48,090 unit tests in 839 GitHub projects, we find mainly that (i) PyMOP is up to 419.23x faster than two recent dynamic analysis tools; (ii) Expensive instrumentation is a main cause of RV's runtime overhead for Python; and (iii) 84 of 156 bugs that PyMOP found were confirmed or fixed by developers. PyMOP's genericness and efficiency position it well as an excellent platform for the next advances on RV for Python. PyMOP is at https://github.com/SoftEngResearch/pymop and a video demo is at https://pymop.zhuohangshen.com/demo.

Read PDF

Similar papers

Preprint Aug 2026

PyFlow: An Inter-procedural Static Analysis Framework for Python

PyFlow is presented, a generic IFDS-based static-analysis framework for Python that provides a multi-stage intermediate-representation pipeline and a generic IFDS solver parameterized by abstract domains and concludes with lessons learned from building IFDS analyses for Python.

Zinan Gu, Haoxiang Yan, Peisen Yao · 0 citations
Preprint Aug 2026

Detecting Behavioral Changes in Python Refactoring Implementations with Foundation Models

This work proposes an approach based on a foundation model oracle that analyzes git-style diffs to identify behavioral changes introduced by Python refactorings and uncovered 13 distinct bugs among the seven refactoring types studied.

Jonhnanthan Oliveira, Rohit Gheyi, Márcio Ribeiro et al. · 0 citations
Open access Aug 2026

Property-based testing in Python: empirical insights

These findings provide the largest empirical characterization of PBT in Python to date, highlight developers’ difficulties in adopting the technique, and expose limitations of current tool support.

Isadora de Oliveira, Arthur Lisboa Corgozinho, Henrique Rocha et al. · 0 citations
Preprint Aug 2026

A Comprehensive Study of Native Code Bugs in Python Applications

The impact of Python applications has been evidenced by their widespread presence in some of the most impactful software domains, such as machine learning frameworks and scientific computing platforms. These applications often integrate native code components written in a lower-level programming language like C. This multilingual construction brings various benefits such as greater performance efficiency and easier interoperability with diverse runtime environments. However, bugs in the native code (i.e., native code bugs), which are usually stealthy, also constitute a major additional challenge to the quality of the Python applications as a whole. Yet despite existing relevant studies, there remains a lack of comprehensive understanding of native code bugs in Python applications. In this paper, we aim to mitigate this knowledge gap through the first in-depth study of such bugs, dissecting their common symptoms, introducing locations, manifestation characteristics, root causes, and fixes. Based on our extensive automated and manual analyses of 216 native code bugs in real-world Python projects on GitHub, we obtained novel findings about and new insights into the occurrence mechanisms and resolution strategies of those bugs.

Haoran Yang, Haipeng Cai · 0 citations
Open access Sep 2026

Goanna: a novel approach for automated type error debugging

Statically typed languages offer many advantages in software engineering, including bug prevention, enhanced code quality, and reduced maintenance costs. However, these benefits come at the expense of a steep learning curve and a slower development pace. Although known for its expressive and strong type system, Haskell often frustrates programmers as they learn and use that type system, especially when debugging type errors. We introduce Goanna, a novel type checker for Haskell that focuses on improving error diagnostics. When a type error occurs, Goanna identifies a comprehensive list of possible causes and provides a potential course of action for each. To achieve this, Goanna uses constraint logic programming and Minimal Correction Subsets (MCSes) to support its diagnostics. We evaluated Goanna’s effectiveness on 49,750 Haskell programs, demonstrating its ability to identify root causes with higher accuracy (81.6%) than traditional tools (Helium, 65.5%; GHC, 33.7%). In our benchmark study, Goanna shows performance constraints when diagnosing large programs containing complex errors, but remains responsive enough to provide real-time debugging assistance for small to medium-sized programs.

Shuai Fu, Tim Dwyer, Peter James Stuckey et al. · 0 citations
Preprint Sep 2026

Interactive Debugger for Performance Portable Python HPC Kernels

We propose PKDB, the first interactive debugger for GPU and multithreaded low-level kernels written in Python. Python is widely used in high performance computing (HPC), with frameworks such as PyKokkos translating Python-embedded domain-specific languages to native code that runs across OpenMP-threaded CPUs and various GPUs. Yet interactive debugging support for such code is absent: developers resort to print statements, framework-specific assertions, or CPU-only execution, the last of which requires altering the program or its data and can mask device-specific bugs. PKDB enables standard interactive debugging like breakpoints, stepping, and variable inspection while preserving actual on-device execution without source modification. Beyond these fundamentals, PKDB introduces two advanced capabilities that exploit the dynamic nature of Python and PyKokkos: (i) Live code evaluation, which lets developers execute arbitrary Python expressions or entire kernels in the middle of a paused kernel without restarting the process; (ii) Kernel call site substitution, which allows an actively running kernel to be updated and reloaded on the fly, so only the kernel is recompiled and re-executed without restarting the application. Our performance evaluation on Intel, AMD, and NVIDIA CPUs, and NVIDIA and AMD GPUs shows that PKDB introduces limited overhead and is practical for everyday use while introducing critical debugging features to the Python HPC ecosystem.

Ivan Grigorik, Gabriel Kosmacher, G. Biros et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.