Defensive Programming
Defensive programming is a software technique recommended by IEC 61508-3 to detect anomalous control flow, data flow, or invalid values during execution. It prevents systematic failures by ensuring every anomaly triggers a predefined safe reaction, such as discarding input, holding the last safe value, or entering a safe state. It is applied during software implementation in safety-critical domains, improving robustness and reducing residual risk.