This repository contains some of the code samples, diagrams and materials of the book "Practical Defensive Design, Defensive Programming and Quality Assurance principles"
Defensive Design, Defensive Programming and Quality Assurance are vast, multi-faceted, complex topics with deep historical roots and significant ramifications across multiple aspects of IT.
Defensive Programming is a software development technique designed to improve the robustness and reliability of code. It’s about anticipating potential problems and implementing safeguards to prevent them, in order to improve, and potentially guarantee, User Safety, Cybersecurity, System Integrity, Privacy and Data Confidentiality.
Defensive Design is its counterpart at a higher abstraction level, and involves creating infrastructures and architectures able to host and run code created with the Defensive Programming principles. As the two faces of the same medal, they both involve many different aspects of programming and different strategies, depending on the kind of application, and the technologies used to create it.
Quality Assurance is the means by which a consistent and unified work methodology is achieved for all its principles. Defensive Design, Defensive Programming and Quality Assurance are practically inseparable; one cannot be effectively maintained long-term without the other.
If you are interested, you can buy the book on Amazon
The topics treated in the book are the following:
Section 1: General principles and landscape
- Defensive Design and Defensive Programming core principles
- KPIs (Key Performance Indicators)
- System health
- Cybersecurity misconceptions
- The “Defense in Depth” principle
Section 2: Defensive Design & Defensive Programming
- Anticipating errors and anomalies
- Graceful error handling
- Enhancing robustness and resilience
- Input validation
- Automated testing
- Assertions
Section 3: Cybersecurity
- Cybersecurity is a first-class citizen
- Cybersecurity posture
- Cybersecurity rules of thumb
- Software Bill Of Materials (SBOM)
- SemVer 2.0
- Knowledge bases and data formats
- IEC 62443
- Authentication vs Authorization
- Security models, schemas, domains
- Notable laws and regulations
- Cyber Resilience Act (CRA)
Section 4: Quality Assurance
- Quality Assurance principles
- VCS and code branch management
- Structured commits messages
- SAST & DAST
- The STRIDE and DREAD-D frameworks
- Software Development Lifecycle (SDLC)
- Secure Software Development Lifecycle
- CI/CD
Section 5: Good practices, Bad practices, and everything in-between
- Adopting the proper mindset
- Embrace the power of D.D.D.
- Architecture and high-level design
- Low-level modeling and coding best practices
- Your data is sacred
- Evolving the system
- Thinking like a defender
- All Hands, Safe and Sound