Move testcase generator to helper