unit test rewriting