Modal
Modal
3 Contract-Based Specifications 2
3.1 Key Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.2 Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Conclusion 3
B Glossary 3
1
Introduction to Software Specifications and Design
Definitions & Objectives
• Specification: Defines what the system should do (external behavior, functionalities).
Key Roles
• Specifications act as contractual agreements between clients and developers.
– What: Users can browse products, add to cart, and pay via credit card.
– Not Included : Database schema or API endpoints (design elements).
3. SOLID Principles:
Contract-Based Specifications
Key Components
• Precondition: Requirements before execution (e.g., n ≥ 0 for F actorial(n)).
2
Code Examples
Conclusion
• Specifications define what, design defines how.
Glossary
Invariant Condition that remains true during execution.
Overload Multiple functions with the same name but different parameters.