Despite the potential of Design-by-Contract (DbC) for increasing the reliability and robustness of software, it has to date experienced only limited use. One reason for this, is that each DbC solution targets a single language (or language run-time) and thus employs different syntax and implementations for specifying contracts for each. Given that modern applications increasingly employ multiple components, each written in multiple programming languages, writing contracts imposes significant burden on programmers.
To reduce this overhead and to encourage greater use of DbC as part of both testing and production systems, we present a new DbC framework called SuperContra that implements and enforces lightweight contracts across different programming systems, as-a-service. SuperContra is unique in that developers employ a familiar, high-level language to write contracts regardless of the programming language used to implement the component under test. Moreover, contract evaluation occurs as-a-service, as opposed to at each client, simplifying clients and facilitating multi-client contract auditing. We evaluate SuperContra using widely used, open-source software and compare its performance against existing DbC frameworks. Our results show that SuperContra performs on par with non-service-based DbC approaches and in some cases similarly to code running without contracts.