Saturday, July 15, 2006, at 4:16:51 AM, William Pietri wrote:
Ron Jeffries wrote:
But in the short and possibly
the medium term, cutting back on refactoring may not be an insane
business decision -- if you can and will pay the debt later, and the
business win can pay for the increased cost in delayed cleanup.
>>
>I don't recall ever seeing that actually happen have you?
>
Sure. I have personally deferred big refactorings until after
time-critical releases.
I can see that a sufficiently expert, and sufficiently "quality"
oriented person might do such a thing. But did you do that by
putting quality "on the table", or by making the determination
somehow internally?
Now I'm not a fan of big refactorings in general, and usually think
that they are in fact evidence that we haven't been keeping up on
quality, and probably also evidence that we haven't figured out how
to do refactorings more incrementally. But certainly I wouldn't go
so far as to reduce productivity by taking on massive rework or
testing efforts.
I don't think that sort of behavior is uncommon or necessarily bad. When
evaluating one team of my acquaintance I asked each developer about
their behaviors relating to debt and cleanup. They said that whenever
their managers asked them to rush something, once the deadline was past
the developers could happily ask for a couple of days to tidy things up
properly, and they felt that was enough to keep things on an even keel.
That would be a very unusual organization in my experience. And even
with those guys, I kind of wish there was a magical metric that we
could use to see whether they're really keeping up. My best is that
they're falling behind.
However, I still generally advise people to avoid that. Taking on debt
is a risky thing, and a lot of businesses are run as a continuous series
of crises, each one of which seems like a reasonable cause for taking on
a bit more debt.
Yep. That's my view as well.
>More importantly, I can tell within two days that poorly designed
>code is slowing me down. My somewhat educated guess is that it's
>harmful even in the near term.
I don't think whether it's slowing you down is the exact issue. It's
whether the cost of cleanup is greater than the cost of not cleaning up
over some period of time. For any cleanup, there's a sufficiently short
time horizon that makes the cleanup the wrong choice. And given infinite
time, all cleanups make sense.
True, but the trend is what's important. We'll surely go in some
kind of pulsing mode, sometimes catching up on cleanup, sometimes
falling behind. Falling behind as a matter of policy, by offering up
our technical quality concerns to people who can't really understand
them, troubles me.
I do think, and maybe this is all that Jef meant, that we should
discuss any extra investments we're making in "quality". If we have
been doing some extra refactoring, or extra testing, I can see
dialing that back down a bit. I think that not testing what we write
right now, for example, would likely be a Bad Idea.
I also think the situation can be different when the existing design is
hard to test. I have certainly worked on projects on large legacy code
bases where getting any useful test coverage was slow and arduous, and
at first didn't even make much impact on bug rates, as the bugs were
mainly from legacy code. In that case the right long-term thing to do is
to suck it up and clean up or rewrite existing code. But I think it's a
legitimate business choice to say, "Now is not the right time to cut our
productivity in half, even though the long-term gains will be substantial."
I don't favor the big refactoring or rewrite, with rare exceptions.
I think that it encourages the behavior of building up big debt, and
that a team that got itself into such a situation got there by what
they did every day, not by something they should have done for one
week a quarter.
I'm not suggesting cutting productivity. I'm suggesting that a very
strong focus on quality in the current work is a key part of being
productive, and that putting that on the table for tradeoff simply
does not work.
It's becoming clear that we need to deal here with more specific
examples, because some of us are envisioning being asked to drop
TDD, while others are envisioning being asked not to do some huge
productivity-killing refactoring.
>>
>I'm not sure how this fits into the tradeoff against quality
>question. Are you saying that in this situation you would not try to
>hold quality at least steady?
I'd try to hold quality steady, but I don't believe that can really be
done without automated tests. I'd do what automated testing I could. But
when dealing with large, poorly factored, highly coupled code bases,
I've been in situations where usefully testing new code was very
expensive, far more expensive than the short-term benefit. If money in
the future is significantly cheaper than money today, the rational
response is to add new code within the existing infrastructure, thus
increasing debt.
Before we take a salary advance, we should consider very seriously
whether we will pay it back. I think the same is true when we
consider taking out an advance on our refactoring.
I firmly believe that in the long run, getting the code base under test
is the right choice, though.
Yup. And I'm talking more about steady state than you are.
course, I still will vigorously question the desire to delay paying
down code debt. When people say "later", they often mean "let's ignore
that". But sometimes they really mean it and really have the discipline
to pull it off.
>>
>Really? Tell me of the times you've seen this, please.
>
If you look at people dealing with their finances, it happens all the
time. People get into debt then slowly dig their way out later. I see it
happen in software, too. Not often enough, but I see it happen.
I suppose that it does happen. I don't think it's the way to bet. I
see teams who don't even understand how to tell that they are deep
in debt. They think it's normal to have to eat like a raccoon in the
city.
In this case, I'm pretty sure they'll stick with it. The brush with
death scared them, sort of like a major health problem can scare
somebody into getting in shape.
I hope so. They're lucky to have someone they trust to advise them.
Even so, it'll be hard to stick with the regimen.
Ron Jeffries
www.XProgramming.com
Logic is overrated as a system of thought.
To Post a message, send it to: extremeprogramming (AT) eGroups (DOT) com
To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe (AT) eGroups (DOT) com
ad-free courtesy of objectmentor.com
Yahoo! Groups Links
<*To visit your group on the web, go to:
<*To unsubscribe from this group, send an email to:
extremeprogramming-unsubscribe (AT) yahoogroups (DOT) com
<*Your use of Yahoo! Groups is subject to: