1. 1. Introduction
  2. 2. It passes all tests
    1. 2.1. Test pyramid
    2. 2.2. If testing is hard, inject what you need to verify
    3. 2.3. Test doubles
    4. 2.4. Test driven development
    5. 2.5. Test coverage is not enough
    6. 2.6. Tests must be reproducible
    7. 2.7. No production code constants in tests
    8. 2.8. Expand and contract
    9. 2.9. Test for production
    10. 2.10. Tests for distributed systems
    11. 2.11. Performance tests
    12. 2.12. Do not test external libraries 🏗️
    13. 2.13. How to test UI 🏗️
    14. 2.14. Linting 🏗️
    15. 2.15. Test infrastructure 🏗️
  3. 3. It expresses intent
    1. 3.1. Naming
    2. 3.2. Deep and narrow classes
    3. 3.3. Immutability
    4. 3.4. Generalise edge cases️
    5. 3.5. Usually composition is better than inheritance
    6. 3.6. Small classes and short methods 🏗️
    7. 3.7. Homogeneity 🏗️
    8. 3.8. Test naming 🏗️
    9. 3.9. Comment the why 🏗️
    10. 3.10. Visual indentation 🏗️
    11. 3.11. Folder structure 🏗️
    12. 3.12. Wishful thinking 🏗️
  4. 4. It does not repeat itself
    1. 4.1. One single authoritative knowledge representation
    2. 4.2. Do not abstract by visual pattern matching
    3. 4.3. Open-closed principle️
    4. 4.4. Dependency inversion principle
    5. 4.5. Information hiding️
    6. 4.6. Wrap external libraries into custom classes️
    7. 4.7. Polymorphism 🏗️
    8. 4.8. Single responsibility principle 🏗️
  5. 5. It does not contain superfluous parts
    1. 5.1. Does not contain superfluous parts
    2. 5.2. Clarify what is superfluous
    3. 5.3. Do not abuse design patterns

A Compendium of Software Design

Polymorphism

Recommended reads

  • The 3 different kinds of polymorphism - Wikipedia