complete fsm & its test