Abstract
AbstractContract systems have come to play a vital role in many aspects of software engineering. This has resulted in a wide variety of approaches to enforcing contracts—ranging from the straightforward pre-condition and post-condition checking of Eiffel to lazy, optional, and parallel enforcement strategies. Each of these approaches has its merits, but each has required ground-up development of an entire contract monitoring system. We present a unified approach to understanding this variety, while also opening the door to as-yet-undiscovered strategies. By observing that contracts are fundamentally about communication between a program and a monitor, we reframe contract checking as communication between concurrent processes. This brings out the underlying relations between widely studied enforcement strategies, including strict and lazy enforcement as well as concurrent approaches, including new contracts and strategies. We show how each of these can be embedded into a core calculus, and demonstrate a proof (via simulation) of correctness for one such encoding. Finally, we show that our approach suggests new monitoring approaches and contracts not previously expressible.
Highlights
Behavioral software contracts, originally introduced by Meyer (1992), have become an integral part of modern programming practice, where they are used to specify and ensure program correctness
The paper proceeds as follows: we describe and discuss previous contract verification variants (Section 2); describe how these variations may be verified by viewing contract monitors as separate evaluators (Section 3); present a concurrent process calculus as a unified system encoding multiple contract verification strategies (Section 5); encode a number of modern verification strategies in this framework (Section 6); demonstrate the multi-strategy approach to contract monitoring (Section 7); present a simulation of Findler & Felleisen (2002) as eager verification (Section 8); and present related works and conclude
\ In the conventional study of software contracts, a language designer extends a core calculus with monitoring facilities that adhere to a specific monitoring strategy, describing how contract verification interacts with the user program in precise semantics
Summary
Behavioral software contracts, originally introduced by Meyer (1992), have become an integral part of modern programming practice, where they are used to specify and ensure program correctness. Researchers have proposed myriad contract enforcement strategies in response to these rising complexities, including lazy monitors (Degen et al, 2009; Chitil, 2012), concurrent monitoring systems (Dimoulas et al, 2009), optional enforcement (Dimoulas et al, 2013), and probabilistic contract verification (Moore et al, 2016; Hickey, 2018) While many of these systems initially appear incompatible, each of these approaches to contract enforcement share a common core: checking that a given program fragment satisfies a contract requires executing some verification code, and this execution is fundamentally distinct from the original program fragment. The paper proceeds as follows: we describe and discuss previous contract verification variants (Section 2); describe how these variations may be verified by viewing contract monitors as separate evaluators (Section 3); present a concurrent process calculus as a unified system encoding multiple contract verification strategies (Section 5); encode a number of modern verification strategies in this framework (Section 6); demonstrate the multi-strategy approach to contract monitoring (Section 7); present a simulation of Findler & Felleisen (2002) as eager verification (Section 8); and present related works and conclude
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.