REVIEW - Design by Contract, by Example


Title:

Design by Contract, by Example

Author:

Richard Mitchell, Jim McKim

ISBN:

Publisher:

Addison-Wesley Professional (2002)

Pages:

238pp

Reviewer:

Francis Glassborow

Reviewed:

February 2002

Rating:

★★☆☆☆


I first came across Design by Contract when reading about Eiffel. Support for DbC is one of the main features of that language. The idea being that each function should start with a set or pre-conditions (things that had to be true for the function call to go ahead) and end with a set of post-conditions, things to be enforced before successful return (failure of either group causes failure). It is very difficult to bolt DbC support onto a language. Of course when you understand the ideas, you can implement them manually. But if you understand OOP you can do it manually in C or even, if you are a real masochist, in assembler. But C++, Smalltalk etc. provide you the tools to do OOP without too much pain and tedious repetition.

In the same way Eiffel provides the tools for DbC. I believe there is a tool that allows you to bolt on a kind of DbC to Java (iContract, seewww.reliable-systems.com).

The authors claim to have distilled DbC down to six principles, listed on pages 42-3 (and discussed in the preceding text.) The problem is that to get much value from this book you need to have suitable software tools. In the light of this, I decided to tell readers that this book exists and invite someone to volunteer to do a complete review. Of course a precondition for volunteering is that you have tools that provide adequate support for DbC (either Eiffel or Java + iContract). I would also like someone to volunteer to have a look at iContract and write about it for our Members' Experiences column. Lastly, if it can be done as a bolt on to Java, can it be done for C++?Professional Development


Book cover image courtesy of Open Library.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.