Design by contract, by example / Richard Mitchell and Jim McKim.
By: Mitchell, R. (Richard).
Contributor(s): McKim, Jim.
Material type:
BookPublisher: Harlow : Addison-Wesley, c.2002Description: xv, 238 p. ; 24 cm.ISBN: 0201634600; 9780201634600.Subject(s): Component software| Item type | Current library | Call number | Copy number | Status | Barcode | |
|---|---|---|---|---|---|---|
| General lending | MTU Kerry North Campus Library Ground Floor Main | 005.117 MIT (Browse shelf(Opens below)) | 1 | Available | 38888000544688 |
Enhanced descriptions from Syndetics:
Programming by contract is a powerful object-oriented technique that provides a disciplined and effective means of documenting the public interface of a class. This text provides a detailed description of programming by contract and demonstrates how to exploit its full power. The core of the text consists of a collection of design principles that the author has developed, and an array of examples from the Eiffel Library Kernal Standard (ELKS) is included.
Includes bibliographical references (p. 227-230) and index.
Design by Contract is a general approach to software design that dramatically improves the quality of the resulting products. This book provides an example-based approach to learning the powerful concept of Design by Contract.
Table of contents provided by Syndetics
- Foreword (p. ix)
- Preface (p. xi)
- Chapter 1 A First Taste of Design by Contract (p. 1)
- 1.1 About This Chapter (p. 1)
- 1.2 The Customer Manager Example (p. 2)
- 1.3 Some Questions (p. 5)
- 1.4 A Contract for CUSTOMER_MANAGER (p. 6)
- 1.5 The Story So Far (p. 9)
- 1.6 Runtime Checking (p. 11)
- 1.7 Trustworthy Documentation (p. 13)
- 1.8 Summary (p. 15)
- 1.9 An Aide Memoire (p. 15)
- 1.10 Things to Do (p. 15)
- Chapter 2 Elementary Principles of Design by Contract (p. 17)
- 2.1 About This Chapter (p. 17)
- 2.2 Stacks (p. 18)
- 2.3 Separate Commands and Queries (p. 19)
- 2.4 Naming Conventions (p. 22)
- 2.5 Separate Basic Queries and Derived Queries (p. 23)
- 2.6 Specify How Commands Affect Basic Queries (p. 26)
- 2.7 Capture Unchanging Properties in Invariants (p. 34)
- 2.8 The Class and Its Contract (p. 36)
- 2.9 The Basic Queries Are a Conceptual Model of Stacks (p. 38)
- 2.10 The Six Principles (p. 42)
- 2.11 Things to Do (p. 43)
- Chapter 3 Applying the Six Principles (p. 47)
- 3.1 About This Chapter (p. 47)
- 3.2 Dictionaries (p. 47)
- 3.3 Separating and Categorizing Features (p. 48)
- 3.4 Postconditions (p. 50)
- 3.5 Preconditions (p. 56)
- 3.6 Invariant (p. 62)
- 3.7 A Complete, Contract-Level View of DICTIONARY (p. 63)
- 3.8 Summary (p. 65)
- 3.9 Things to Do (p. 66)
- Chapter 4 Building Support for Contracts--Immutable Lists (p. 69)
- 4.1 About This Chapter (p. 69)
- 4.2 Support for Linear Structures (p. 69)
- 4.3 Contracts Involve Expressions (p. 70)
- 4.4 Immutable Lists (p. 71)
- 4.5 A Contract for Immutable Lists (p. 72)
- 4.5.1 The Basic Queries (p. 72)
- 4.5.2 The Creation Command (p. 74)
- 4.5.3 The Derived Query count (p. 74)
- 4.5.4 The Derived Query preceded_by (p. 74)
- 4.5.5 The Derived Query item (p. 75)
- 4.5.6 The Derived Query is_equal (p. 77)
- 4.5.7 The Derived Query sublist (p. 79)
- 4.6 Summary (p. 81)
- 4.7 Things to Do (p. 81)
- Chapter 5 Applying the Six Principles to QUEUE (p. 83)
- 5.1 About This Chapter (p. 83)
- 5.2 Queues (p. 83)
- 5.3 A Contract for the remove Feature (p. 84)
- 5.4 Making count a Derived Feature (p. 88)
- 5.5 A Contract for the Initialize Feature (p. 91)
- 5.6 A Contract for the head Feature (p. 93)
- 5.7 A Contract for the put Feature (p. 94)
- 5.8 More Derived Queries (p. 94)
- 5.9 Summary (p. 95)
- 5.10 Things to Do (p. 96)
- Chapter 6 Design by Contract and Inheritance (p. 99)
- 6.1 About This Chapter (p. 99)
- 6.2 Superclasses and Subclasses (p. 99)
- 6.3 Redefining Contracts (p. 100)
- 6.3.1 Eiffel Syntax (p. 104)
- 6.3.2 Summary (p. 107)
- 6.4 Invariants and Inheritance (p. 108)
- 6.5 Designing Superclasses with Guarded Postconditions (p. 109)
- 6.6 Two Kinds of Inheritance (p. 116)
- 6.7 Summary (p. 117)
- 6.8 Things to Do (p. 117)
- Chapter 7 Frame Rules (p. 119)
- 7.1 About This Chapter (p. 119)
- 7.2 Change Specifications and Frame Rules (p. 119)
- 7.3 Frame Rules for put Using Immutable Lists (p. 121)
- 7.4 Frame Rules for put Using "Forall" (p. 128)
- 7.5 Kinds of Frame Rules (p. 130)
- 7.6 Things to Do (p. 132)
- 7.7 Appendix: More About the Preprocessor (p. 132)
- Chapter 8 Benefits of Design by Contract (p. 137)
- 8.1 About This Chapter (p. 137)
- 8.2 Kinds of Benefits (p. 137)
- 8.3 Better Designs (p. 138)
- 8.4 Improved Reliability (p. 140)
- 8.5 Better Documentation (p. 140)
- 8.6 Easier Debugging (p. 142)
- 8.7 Support for Reuse (p. 142)
- 8.8 Design by Contract and Defensive Programming (p. 143)
- 8.8.1 Defending a Program Against Unwanted Input (p. 143)
- 8.8.2 Bulletproofing a Routine (p. 144)
- 8.8.3 Defensive Programming (p. 145)
- 8.9 Some Costs and Limitations of Contracts (p. 146)
- Chapter 9 Contracts for an Observer Framework (p. 149)
- 9.1 About This Chapter (p. 149)
- 9.2 The Observer Framework (p. 150)
- 9.3 Immutable Sets (p. 152)
- 9.4 Attaching and Detaching Observers (p. 155)
- 9.5 Notification (For One Observer) (p. 156)
- 9.6 Notification (For All Observers) (p. 158)
- 9.7 A Performance Issue (p. 160)
- 9.8 Frame Rules (p. 161)
- 9.9 Privacy (p. 164)
- 9.10 Things to Do (p. 166)
- Chapter 10 Fulfilling a Precondition (p. 169)
- 10.1 About This Chapter (p. 169)
- 10.2 The Examples (p. 170)
- 10.3 Fulfilling and Testing a Precondition (p. 170)
- 10.4 Testing Versus Checking (p. 172)
- 10.5 A Simple Counter Class (p. 173)
- 10.6 The User's View of the Program (p. 174)
- 10.7 The Internal Structure of the Program (p. 176)
- 10.8 The Program's Behavior (p. 178)
- 10.9 A Minor Detail (p. 184)
- 10.10 Summary (p. 186)
- 10.11 Things to Do (p. 187)
- Chapter 11 Java Examples (p. 189)
- 11.1 About This Chapter (p. 189)
- 11.2 Why Java? (p. 190)
- 11.3 Queues (p. 190)
- 11.3.1 The Basic Query size() (p. 192)
- 11.3.2 The Basic Query get() (p. 193)
- 11.3.3 The Derived Query head() (p. 193)
- 11.3.4 The Derived Query isEmpty() (p. 194)
- 11.3.5 The Derived Query shallowCopy() (p. 194)
- 11.3.6 The Constructor Queue (p. 195)
- 11.3.7 The Command put (p. 196)
- 11.3.8 The Command remove (p. 196)
- 11.3.9 Summary (p. 198)
- 11.4 Dictionaries (p. 198)
- 11.4.1 Names (p. 199)
- 11.4.2 The Invariant (p. 200)
- 11.4.3 The Basic Queries (p. 200)
- 11.4.4 A Derived Query (p. 201)
- 11.4.5 The Commands (p. 201)
- 11.4.6 The Constructor (p. 202)
- 11.4.7 A Possible Set of Classes (p. 203)
- 11.5 Java Without iContract (p. 203)
- 11.6 Precondition Testing (p. 207)
- 11.7 Things to Do (p. 212)
- Chapter 12 Analysis by Contract (p. 215)
- 12.1 About This Chapter (p. 215)
- 12.2 A Use Case (p. 215)
- 12.3 Contracts in Analysis Models (p. 217)
- 12.4 A Contract for the withdrawCash Use Case (p. 217)
- 12.5 From Analysis to Design (p. 220)
- 12.6 Problem Domain and System Models (p. 221)
- 12.7 The Object Constraint Language (p. 224)
- 12.8 Summary (p. 225)
- Bibliography (p. 227)
- Index (p. 231)
Excerpt provided by Syndetics
Author notes provided by Syndetics
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