Defensive programming against state guarantees