I just finished Part 1 working through the challenge tests at
http://xp123.com/xplor/xp0201/, and I saw myself doing something that I don't
know if is considered good or bad form. I'm posting here hoping for feedback,
postive or negative.
At one point, I had just finished making a test pass, and I didn't see any
refactoring that seemed to be needed. Then I added the next test to my test
class, and saw that it in light of -that- test, there was some refactoring
required before it would be simple to implement.
My decision, at that point was to comment out the new test, so all tests pass
again, then refactor. I refactored in the smallest chunks I could manage, and
ran tests after each change (including sometimes when I expected failures, but
wanted to see if the failures were precisely the ones I expected).
After the refactoring was complete and tests passed, I proceeded to uncomment
the new test again and implement the code to make the test pass. After some
final refactoring, the tests still passed, and I was done with Part 1.
I guess the question would be, at the point where a new test makes some
refactoring seem to be in order, was I right to hold off on the new test, and do
the refactoring first? Or should I have tried to figure out a simple way to get
the next test to pass (though none was coming to mind), then refactor afterward?
Thanks for any feedback,
- Steve Jorgensen