State machine diagram is a critical design model for event-driven systems. Well-designed state machine shows accurately the essential states of objects as well as the triggers of state change, which facilitates the development of error-free state machine.