Generating tests code