Refactoring of tests