3 ms·
The logic of refactoring test code is very interesting: IMO one can't just do that, because it tosses out the guarantee that it still tests what one thinks it d
by dogweather 6y ago
The logic of refactoring test code is very interesting: IMO one can't just do that, because it tosses out the guarantee that it still tests what one thinks it does.
So I actually break my application first to make the tests fail, and then refactor them while failing to ensure that they still fail. Finally, I undo my changes to the app code, and the tests should all pass again. I guess this is essentially a manually performed mutation test.
- DylanSp 6y agoI do the same thing, either when refactoring test code or when I'm adding tests after writing the implementation. I've heard the manual approach referred to as "refactoring against the red bar"; see https://corgibytes.com/blog/2016/09/20/refactoring-against-the-red-bar/ https://corgibytes.com/blog/2016/09/20/refactoring-against-t....