Member-only story
The Swiss Cheese Model: How Layers of Defense Improve Swift Code Resilience
Testing is important!
There’s a secret. Testing your Swift is a good thing in your App, and I’ll tell you why. However human systems are fallible and in steps The Swiss Cheese Model of accident causation where we should be aware of the holes in our layers of testing defenses.
The Swiss Cheese Model
In any organisation, defenses against failure are a series of imperfect barriers with “holes” that represent weaknesses in each layer. When a system failures these “holes” align temporarily so the issue passes through all of the holes in the layers leading to a failure.
The Testing Layers
Defensive programming
Defensive programming is an approach to writing code where potential issues are tackled proactively. Swift coders should avoid bad practice such as force unwrapping and use language and compiler features to create great code.
Input validation