Description:
<jats:p>Computer science students need to learn how to write high-quality software. An important methodology for achieving quality is design-by-contract, in which code is developed together with its specification, which is given as class invariants and method pre- and postconditions. This paper describes practical experience in teaching design-by-contract and other principles of object-oriented programming and design by a comprehensive set of programming exercises. These are implemented in Java, augmented with a design-by-contract tool. The conceptual gap between the theoretical principles taught in the course and the capabilities of this programming environment causes pedagogical problems; these problems and some solutions are discussed in this paper.</jats:p>