Executable Visual Contracts

  • Authors:
  • Marc Lohmann;Stefan Sauer;Gregor Engels

  • Affiliations:
  • University of Paderborn;University of Paderborn;University of Paderborn

  • Venue:
  • VLHCC '05 Proceedings of the 2005 IEEE Symposium on Visual Languages and Human-Centric Computing
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 Languages (OCL) supports the specification of pre- arid 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.