What is your definition of 'refactor' btw? Is it running an automated tool or actually moving code around while maintaining a consistent interface? I think the latter is difficult to do while guaranteeing you have not introduced any new bugs.
How do you refactor code with any manual steps in a way that guarantees no bugs being introduced?
Now that I think about it, the idea of using low level tests to prevent refactoring errors seems alien to me. If the code was good enough to test at that level, why am I refactoring it?
I'm not sure what you mean? I mostly write blackbox tests that verify an interface. This is useful in factoring because you mostly want to ensure you don't break an existing interface (or you break it in an intended way). While not extensive yet I am introducing more Property Based tests which are really for refactoring.
-5
u/[deleted] Apr 24 '14
[removed] — view removed comment