refine the test code.