Risk is the possibility of harm or loss. In software delivery, assess it by considering a failure’s likelihood and impact, and how long a defect may remain undetected. Late detection lets correction costs grow, so safeguards should reduce risk without adding needless friction. section 2.3.4 section 5.3
Use risk to decide where testing should contain defects:
- Use unit tests for business rules, calculations, and invariants. section 5.3
- Use integration tests for boundary behavior such as persistence, API contracts, and authentication. section 5.3
- Reserve end-to-end tests for critical user journeys; they are more expensive and fragile. section 5.3
Different failures, different exposure
A broken logging formatter may inconvenience a developer; broken authentication can lock out customers, while a faulty payment calculation can lose money. Their different impacts call for different testing priorities. section 5.3
Table 5.1 Activity ratio analysis of a simple workflow
|
System area
|
Risk assessment
|
First line testing layer
|
What should it protect?
|
|
User login/Authentication
|
High impact, medium likelihood
|
Integration
|
Correct authentication outcome and session handling
|
|
Database retrieval/Queries
|
Medium impact, high likelihood
|
Integration
|
Correct boundary behavior and data mapping
|
|
Business calculations logic
|
High likelihood, high financial impact
|
Unit
|
Deterministic correctness of rules and edge cases
|
|
Critical
user journey (Login → Retrieve → Calculate)
|
High impact, low likelihood
|
Small, stable set of E2E
|
End-to-end customer-visible behavior
|
|
Logging/Formatting utilities
|
Low impact, high likelihood
|
Minimal, if any.
|
Core invariant only, avoid overtesting
|
Compare failure likelihood and impact with the suggested first-line test layer and the behavior it should protect. section 5.3












