This is the code for constructing test model in PAT