A Generalized Model-based Test Generation Method