State machine engine for running model based tests