test state machin factori model implement state machin factori 