or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Sell Back Your Copy
For a $0.54 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Design by Contract, by Example
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Design by Contract, by Example [Paperback]

Richard Mitchell (Author), Jim McKim (Author), Bertrand Meyer (Foreword)
4.0 out of 5 stars  See all reviews (9 customer reviews)

List Price: $49.99
Price: $40.45 & this item ships for FREE with Super Saver Shipping. Details
You Save: $9.54 (19%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Only 3 left in stock--order soon (more on the way).
Want it delivered Tuesday, January 31? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for Students. Learn more


Book Description

0201634600 978-0201634600 October 22, 2001 1st
Design by Contract is a systematic approach to specifying and implementing object-oriented software elements based on precisely defined obligations between them. This is the first practical, example-centered guide to using Design by Contract. The authors introduce powerful design principles for writing good contracts and supporting guidelines -- and demonstrate those principles with real-world Java and Eiffel code examples. They review the fundamentals of Design by Contract -- preconditions, postconditions and invariants -- and presenting a real-world example. Next, drawing on their unparalleled experience with Design by Contract, they present six powerful design principles -- each with a clear statement of goals, rationale, examples in both Java and Eiffel, and supporting notes. Developers will learn how to strengthen their components' internal support for contracts; how to use contracts to specify subclasses whose objects can safely be substituted for superclass objects; how to extend contract to specify and check properties that remain unchanged; and how to use contracts in analysis-level models. The book concludes by summarizing key principles and presenting a realistic cost/benefit analysis of their use.

Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

Customers buy this book with Touch of Class: Learning to Program Well with Objects and Contracts $55.78

Design by Contract, by Example + Touch of Class: Learning to Program Well with Objects and Contracts


Editorial Reviews

From the Back Cover

Design by contract is an underused--but powerful--aspect of the object-oriented software development environment. With roots in the Eiffel programming language, it has withstood the test of time, and found utility with other programming languages. Here, by using both the Eiffel and Java languages as guidance, Design by Contract, by Example paves the way to learning this powerful concept.

Through the following six teaching principles, the authors demonstrate how to write effective contracts and supporting guidelines. Readers will learn how to:

  1. Separate queries from commands
  2. Separate basic queries from derived queries
  3. Write a postcondition for each derived query that specifies what result can be returned
  4. Write a postcondition for each command that specifies the value of every basic query
  5. Decide on a suitable precondition for every query and command
  6. Write invariants to define unchanging properties of objects

Contracts are built of assertions, which are used to express preconditions, postconditions and invariants. Using the above principles, the authors provide a frank discussion of the benefits, as well as the potential drawbacks, of this programming concept. Insightful examples from both the Eiffel and Java programming languages are included, and the book concludes with a summary of design by contract principles and a cost-benefit analysis of their applications.

Design by Contract, by Example is the first book of its kind to offer an example-based approach to learning this important paradigm. If you are a developer seeking a way to improve your craft, this book will give you the necessary understanding of the concepts of contracts in software design.



0201634600B08142001

About the Author

Richard Mitchell is a senior consultant with InferData Corporation, specializing in object-oriented analysis and design. Before joining InferData full-time in 1999, he was a Professor of Computing at the University of Brighton, UK, where he was involved in teaching and researching object technology.

Jim McKim is Clinical Professor and Chair of the Department of Engineering and Science at Rensselaer Polytechnic Institute in Hartford, Connecticut. He has been teaching and consulting in the area of object oriented software development for some 10 years. Over the same period he has authored or coauthored numerous articles on Design by Contract for such publications as the Journal of Object-Oriented Programming and IEEE Computer.



0201634600AB08142001


Product Details

  • Paperback: 256 pages
  • Publisher: Addison-Wesley Publishing Company; 1st edition (October 22, 2001)
  • Language: English
  • ISBN-10: 0201634600
  • ISBN-13: 978-0201634600
  • Product Dimensions: 9.4 x 7.1 x 0.6 inches
  • Shipping Weight: 1 pounds (View shipping rates and policies)
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (9 customer reviews)
  • Amazon Best Sellers Rank: #1,503,779 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

9 Reviews
5 star:
 (5)
4 star:
 (2)
3 star:    (0)
2 star:
 (1)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
4.0 out of 5 stars (9 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

13 of 13 people found the following review helpful:
5.0 out of 5 stars The best tutorial on design by contract, May 11, 2002
This review is from: Design by Contract, by Example (Paperback)
Despite its' power, design by contract is an underutilized software development technique. That is most likely explained by the speed of software development and the time that would be required to learn it well enough to use it. Most developers either do not, or feel that they do not have the time to stop and learn how to use design by contract effectively. Well, the former group simply cannot be helped, as not even design by contract will extend the time in a day. However, for the latter group, this book is for you.
Design by contract is not difficult to learn, as is demonstrated in this book. The examples are very easy to understand and are chosen for their combination of ease of use as well as having applicability to the kinds of programs that developers create. While Eiffel and Java are used to create the examples, it is not critical that you know them to understand the code. The only requirement is that you understand the basic principles of object-oriented programming. While some background in logic would be helpful, all that is needed is what is required for writing correct Boolean expressions in programs.
I am a big proponent of the design by contract model of software development. The writing of the contract principles forces a level of intellectual rigor that can dramatically improve the quality of your software. In this book, you can not only learn how to do it, but you will also learn how to do it well and the ways in which you can do it wrong. I have placed it in my list of the top ten books of the year.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


11 of 12 people found the following review helpful:
2.0 out of 5 stars Not enough material, March 9, 2006
This review is from: Design by Contract, by Example (Paperback)
The aim of the book is to teach readers about contracts and how to write good ones. The main points are summarized at the start of the book in a series of six guidelines (as described in the review above):

- Separate queries from commands
- Separate basic queries from derived queries
- Write a postcondition for each derived query that specifies what result can be returned
- Write a postcondition for each command that specifies the value of every basic query
- Decide on a suitable precondition for every query and command
- Write invariants to define unchanging properties of objects

This part is well written and provides good advice for people new to writing contracts. The presentation is however very academic with examples based on stacks and dictionaries.

The authors then try to present more realistic examples. Unfortunately that's where they fail badly.

The first example shows how to use contracts to write an observer pattern. The only thing that the authors show is that you can write a contract that makes sure that the observers are properly added to the list of observers. Since most modern languages implement the observer pattern in the language itself (via events), this is a contract that no-one needs to write. The problem that usually happens in real programming is that the events are wired up too early or too late. Contracts provide little help for this. The authors should have chosen an example that better demonstrates the power of contracts.

The second example is an over-extended explanation about how you can write code so that you never call a method when its precondition is false. The explanation is convoluted and offers no real insight into programming by contracts.

The final chapter discusses applying contracts to languages that do not support them natively (basically all languages other than Eiffel). I had high hopes for this chapter. Unfortunately, the authors recommend using a pre-processor (e.g., iContracts) or only implementing preconditions with assertions. Most programmers with a little experience will already be using assertions and will not learn much from the chapter.

The book is a compilation of various papers that the authors published in conferences (mainly TOOLS). The problem is that the material is suited to a 20 page paper not a 200+ page book. Even with repetitions and ample space the lack of useful information is apparent. The second half of the book is a waste of paper.

Contracts are a very useful tool when properly applied. The guidelines presented at the start of the book are very good. Unfortunately the book is marred by a lack of real world examples.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


7 of 7 people found the following review helpful:
4.0 out of 5 stars Clear and to the Point, March 7, 2002
By 
John Childs (Granby, CT USA) - See all my reviews
This review is from: Design by Contract, by Example (Paperback)
This is surely the definitive work on contracts and assertions. The title says it all, as the book makes effective use of examples to illustrate this important topic. Before I read "Design by Contract by Example" I had not a clue as to how to write assertions. Mitchell and McKim's Six Principles simplified this subject such that I was able to write a fairly reasonable contract for a small system on my first try. This work demystifies the subject.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews







Only search this product's reviews



What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(1)

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums



So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject