Firmware · Program structure and state machines
Reliable device behavior depends on deciding what happens for every event in every state, including the awkward combinations people tend to forget.