Refactoring does not work

gabor on 2003-10-13T21:43:55

I have just read this very good article of Michael Schwern about Refactoring

The only problem I see is that usually code that looks like what he had in the example won't come with a test suit. So before you start refactoring you have to write that, but it is quite hard to write a test suit for something that you don't know what it is supposed to do.

I am looking forward to read the next article about how to write test suit to such code.


Output regression

jplindstrom on 2003-10-14T20:51:02

The first step is to treat it as a black box and feed it controlled input, checking that the output doesn't change.