« Steve Vinoski's comments on the WS* standardisation track | Main | Holding out for Hero »

Design By Contract in C

Charlie Mills creates a Design-By-Contract library for C (which could equally be used for C++ with minor changes) in his most recent OnLamp article. DBC views functions and methods as contractual agreements between the functional caller and the object/module providing the function. Charlie's implementation is a really neat idea using Object Constraint Language (OCL)to describe:


  • function preconditions

  • function postconditions

  • type and function invariants


The implementation is hacked up using Ruby and Racc and is available here.. I'm currently playing around with DBC for Java using iContracts and I'll post the inevitable success stories here soon...

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on November 5, 2004 6:19 PM.

The previous post in this blog was Steve Vinoski's comments on the WS* standardisation track.

The next post in this blog is Holding out for Hero.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33