Word of the day: Re-fuck-toring
My informal definition of refactoring: The process of changing / re-organizing / re-structuring code without breaking public interfaces or changing runtime behavior.
So you’re at work busy refactoring some code, breaking the occasional test here and there in the process of doing so. Then my friend, you’re doing a refucktoring, not a refactoring! And, you know that you’re really refucktoring when the tests you’re breaking aren’t even related to the piece of code you’re working on.
Refucktoring tends to happen when the tests knows too much about the internals of the code that you're testing. The more you’re able to test through public interfaces the less are the chances of your well-meant (we all know what the road to hell is paved with...) refactoring efforts regressing into refucktoring. Try to avoid testing how a result is being produced when what you're really interested in testing is that the code under test produces the expected result for any given input! Doing this buys you the freedom to refactor the implementation or even swap it out for a completely different one without changing the tests!
I haven't been able to track down who invented the word "refucktoring", but I love it! Please post a comment if you know the origin of this expression.








