This article, authored by Bertrand Meyer, discusses the importance of reliability in object-oriented software development and introduces a methodology called "Design by Contract" to improve software reliability. The main goal is to enhance the correctness and robustness of software systems. The article emphasizes that reliability is crucial in object-oriented programming due to the reuse of components and the strong claims made about the quality of object-oriented methods.
The key contributions of the article include:
1. **Methodological Principles**: Guidelines to produce correct and robust software.
2. **Exception Handling**: A systematic approach to handling abnormal cases.
3. **Understanding Inheritance**: Better understanding of inheritance and associated techniques through the concept of subcontracting.
The article revisits defensive programming, which involves writing redundant checks to protect against potential errors. However, it argues that this approach often introduces unnecessary complexity and can defeat its own purpose. Instead, the article proposes a more systematic approach using assertions, which are conditions that must be met for a routine to work correctly. Assertions include preconditions (requirements before a call) and postconditions (properties ensured after a call).
The article also discusses class invariants, which are properties that apply to all instances of a class and must be preserved by exported routines. These invariants help maintain consistency and can be used to enforce constraints on object states.
The use of assertions in object-oriented languages like Eiffel is detailed, including how they can be monitored at runtime to detect bugs. The article emphasizes that assertion violations are not special cases but manifestations of bugs and should be used to debug and test software.
Finally, the article explores the implications of inheritance and dynamic binding on reliability, highlighting the importance of ensuring that redeclarations do not introduce incompatible changes. It also discusses the role of invariants in maintaining consistency across inheritance hierarchies.
Overall, the article provides a comprehensive framework for improving the reliability of object-oriented software through the use of Design by Contract principles and techniques.This article, authored by Bertrand Meyer, discusses the importance of reliability in object-oriented software development and introduces a methodology called "Design by Contract" to improve software reliability. The main goal is to enhance the correctness and robustness of software systems. The article emphasizes that reliability is crucial in object-oriented programming due to the reuse of components and the strong claims made about the quality of object-oriented methods.
The key contributions of the article include:
1. **Methodological Principles**: Guidelines to produce correct and robust software.
2. **Exception Handling**: A systematic approach to handling abnormal cases.
3. **Understanding Inheritance**: Better understanding of inheritance and associated techniques through the concept of subcontracting.
The article revisits defensive programming, which involves writing redundant checks to protect against potential errors. However, it argues that this approach often introduces unnecessary complexity and can defeat its own purpose. Instead, the article proposes a more systematic approach using assertions, which are conditions that must be met for a routine to work correctly. Assertions include preconditions (requirements before a call) and postconditions (properties ensured after a call).
The article also discusses class invariants, which are properties that apply to all instances of a class and must be preserved by exported routines. These invariants help maintain consistency and can be used to enforce constraints on object states.
The use of assertions in object-oriented languages like Eiffel is detailed, including how they can be monitored at runtime to detect bugs. The article emphasizes that assertion violations are not special cases but manifestations of bugs and should be used to debug and test software.
Finally, the article explores the implications of inheritance and dynamic binding on reliability, highlighting the importance of ensuring that redeclarations do not introduce incompatible changes. It also discusses the role of invariants in maintaining consistency across inheritance hierarchies.
Overall, the article provides a comprehensive framework for improving the reliability of object-oriented software through the use of Design by Contract principles and techniques.