Behavioral state machine is specialization of behavior can be used to model the behavior of individual component of the system through finite state transitions. Behavior represented as a traversal of stat nodes with transitions. Transitions are the change of state occurred by series of events. Behavioral state machine clearly defines the transitions between states and several activities or events occurred during the traversal.
Behavioral state diagrams are usually needed to check behavioral problems with the individual component. It is much easier to identify the possible edge conditions by drawing state diagrams on paper. Which will helps to make sure that the system will have less bugs and unidentified behavior. Sometimes, state machines could also executes some events to improvise the system behavior.
Let’s consider state machine bank ATM includes three states like Idle, Out of Service and Active. Usually ATM is in idle state changed to active state whenever you insert the card. There might be some activities occurs between Idle and Active states like card-in, cancel-transaction, transaction-done, etc., ATM changes from Idle to Out-of-Service state whenever the machine is Inactive. Service is an activity performed in order to fix the machine in Out-of-Service state. Response from machine whenever it is fixed also considered as activity.