liveBook · Manning

Fix-prevent-detect test

As explained in Build High Value Software Systems

A completeness pattern for addressing a problem by fixing its immediate effects, preventing recurrence, and detecting conditions that still arise.

The fix-prevent-detect pattern checks whether a countermeasure addresses the immediate defect, reduces the chance of recurrence, and surfaces conditions that still arise. Detection alone is insufficient if it only creates a manual response. section 8.5

Check which job each change performs:

  • Fix the current defect in code or data. section 8.5
  • Prevent recurrence by changing standard work or adding automated checks. section 8.5
  • Detect remaining failures with checks, health signals, or alerts—and avoid relying on alerts that require repeated manual recovery. section 8.5

A migration causes API latency

If a migration adds an index without running ANALYZE, run ANALYZE to restore query performance, add it to the migration template to prevent recurrence, and add a query-plan assertion to CI to catch future regressions. section 8.6

Table 8.3 Countermeasure versus quick-fix evaluation
Change
Type
How to tell
Schema migration prevents invalid data
Countermeasure
The invalid state cannot exist — the database enforces it
Rate limiter caps request volume
Countermeasure
Overload is structurally blocked before it reaches the service
Retry loop hides intermittent failures
Quick fix
The failure still happens; the retry just hides it
Input sanitization works around bad upstream data
Quick fix
The upstream service still sends bad data every time
Updated deployment template with correct defaults
Countermeasure
The standard work changed, future engineers get the right config without thinking about it
Circuit breaker with fallback mode
Countermeasure
The system handles the failure by design, not by luck

Compare structural countermeasures with symptom-masking quick fixes, such as a retry loop that leaves the underlying failure in place. section 8.5

How Build High Value Software Systems covers it

How deep it goes
Distinguishes code, standard-work, automation, and observability changes, and warns that alerting alone may leave toil.
Examples
Uses an API latency incident caused by a migration without ANALYZE and an asynchronous test bug masked by retries.
What it assumes
Assumes root-cause diagnosis before selecting a fix and does not treat an AI-generated patch as diagnosis.
What you can do after
Evaluate proposed fixes by asking whether they address the cause, prevent recurrence, or merely hide symptoms.
How it connects
Connects root cause analysis, 5 Whys, A3 reports, CI checks, and observability.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.