John Maxwell | 10 Feb 02:51
Favicon

Question about a habit/practice

I have a habit (Might even rise to the status of a practice. At the 
very least, it's a pattern, or perhaps anti-pattern) that I'd like to 
hear thoughts on.

Fairly often (say, a few times per week), when I'm working on making a 
unit test pass, I find that a change elsewhere in the code is necessary 
in order to implement what I'm working on.

I'm not talking about noticing something unrelated that needs doing; in 
that case, it just goes onto my ToDo list, and I proceed with the task 
at hand.

I mean that a previously implemented piece of code that relates to the 
one I'm working on needs to behave differently than I thought when I 
wrote its unit test and implemented it.

Further, I'm talking about a change that's significant enough to 
warrant writing a new unit test (or sometimes even a few).

My habit, in such cases, is to mark the current tests "pending" (Or 
just comment it out, if the test framework I'm using doesn't have that 
capability. Boo on test frameworks that don't.), go and make the 
change in the related code in a TDD fashion, then return to my original 
task.

Thoughts? Comments? Flames?

-John

--
John Maxwell  KB3VLL  jmax <at> toad.net

Microsoft is a cross between The Borg and the Ferengi. Unfortunately
they use Borg to do their marketing and Ferengi to do their
programming.
    -Simon Slavin


Gmane