Specification-Driven Design with Eiffel and Agents for Teaching Lightweight Formal Methods [chapter]

Richard F. Paige, Jonathan S. Ostroff
2004 Lecture Notes in Computer Science  
We report on our experiences in teaching lightweight formal methods with Eiffel. In particular, we discuss how we introduce formal methods via Eiffel's design-by-contract and agent technologies, and how we integrate these techniques with test-driven development, in an approach called specification-driven design. This approach demonstrates how formal methods techniques fit with industrial software engineering practice. Eiffel is an object-oriented programming language and method [12] ; it
more » ... s constructs typical of the object-oriented paradigm, including classes, objects, inheritance, associations, composite ("expanded") types, generic (parameterised) types, polymorphism and dynamic binding, and automatic memory management. It has a comprehensive set of libraries -including data structures, GUI widgets, and database management system bindings -and the language is integrated with .NET. A short example of an Eiffel class is shown in Fig. 1 . The class CITIZEN inherits from PERSON (thus defining a subtyping relationship). It provides several attributes, e.g., spouse, children which are of reference type (in other words, spouse refers to an object of type CITIZEN ); these features are publicly accessible (i.e., are exported to ANY client). Attributes are by default of reference type; a reference attribute either points at an object on the heap, or is Void . The class provides one expanded attribute, blood type. Expanded attributes are also known as composite attributes; they are not references, and memory is allocated for expanded attributes when memory is allocated for the enclosing object.
doi:10.1007/978-3-540-30472-2_7 fatcat:j33knyxssvdnvbfafomayubi7q