Executable Visual Contracts
Marc Lohmann, Stefan Sauer, Gregor Engels · Proceedings/Proceedings -- IEEE Symposium on Visual Languages and Human-Centric Computing · 2005
Design by contract (DbC) is widely acknowledged to be a powerful technique for creating reliable software. DbC allows developers to specify the behavior of an operation precisely by pre- and post-conditions. Existing DbC approaches predominantly use textual representations of contracts to annotate the actual program code with assertions. In the unified modeling language (UML), the textual object constraint language (OCL) supports the specification of preand post-conditions by constraining the model elements that occur in UML diagrams. However, textual specifications in OCL can become complex and cumbersome, especially for software developers who are typically not used to OCL. In this paper, we propose to specify the pre-and post-conditions of an operation visually by a pair of UML object diagrams (visual contract). We define a mapping of visual contracts into Java classes that are annotated with behavioral interface specifications in the Java modeling language (JML). The mapping supports testing the correctness of the implementation against the specification using JML tools, which include a runtime assertion checker. Thus we make the visual contracts executable.
Cited by 29 works. doi:10.1109/vlhcc.2005.35
Authors
References
- The Unified Software Development Process
- Applying 'design by contract'
- Preliminary design of JML
- An overview of JML tools and applications
- A Simple and Practical Approach to Unit Testing: The JML and JUnit Way
- Automatically checking an implementation against its formal specification
- Using test oracles generated from program documentation
- Graph pattern matching in PROGRES
- Modular architecture for a toolset supporting OCL
- Spider Diagrams: A Diagrammatic Reasoning System