CSC/ECE 517 Fall 2007/wiki3 2 c4

From Expertiza_Wiki
Revision as of 02:22, 19 November 2007 by Lwillia (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Problem

In class, we had some difficulty coming up with good examples of programming by contract. Find some concise ones that illustrate the principle well, and are accessible to a general audience of programmers.

Programming By Contract

Programming by contract (PBC) is also called design by contract. It is a form of progamming that deals with pre conditions, post conditions, and invariants. These are used in a client/supplier model. Pre conditions, post conditons, and invariants are specified first. After that, the code is written based on the specified conditions and invariants. It can be seen as a contract because the code needs to abide by the specifications.


References

  1. http://www.dugaldmorrow.com/index.php?option=com_content&task=view&id=19&Itemid=38