Skip to search.
testdrivendevelopment · Test-driven Development

Group Information

  • Members: 3502
  • Category: Software
  • Founded: Feb 7, 2002
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

  Messages Help
Advanced
TDD & Refactoring   Message List  
Reply Message #33121 of 34997 |
Re: [TDD] TDD & Refactoring

yahya.rafique wrote:

> My intent is figuring out if there is any impact on the evolution of
> design if we put of refactoring until dedicated refactoring sessions
> that are spaced apart in time as opposed to immediately addressing needs
> as "code smells" are detected. Intuitively the technical debt is larger
> but I was wondering if there are any other adverse effects on design

I don't think one can answer this question meaningfully in general, as
the tradeoff depends on so many variables: the strength of the design,
the programming language, the skill of the programmers, the technology
domain of the project, and 1000 other things.

Some say that if you ever want to have "a refactoring session" then
you're not refactoring enough. For many teams, I find that to be a
useful rule of thumb, but I like to distinguish two kinds of
refactoring: cleaning the kitchen and cleaning the garage.

Cleaning the kitchen happens when you refactor as you go. This is like
cleaning a pot just after you use it, because you have 30 seconds before
you have to turn the chicken in the pan on the stove. Most programmers
need to clean the kitchen more, although some programmers (including me
at times) clean the kitchen too much. In programming, we don't have
chicken burning in the pan to remind us to stop polishing the pot. For
that, we need to rely on our own judgment and pair partners. When I
clean the kitchen (in refactoring), I expect my pair partner to keep
asking me "Why are you doing this right now?" If I can't answer her,
then I know I'm just polishing the pot, and have to move on to the next
part of the task.

Cleaning the garage happens when progress grinds to a halt because some
part of the system has been left to rot too long. This is like cleaning
the garage because your car doesn't fit in it any more. You take a
weekend and move all the boxes, fit in your car, figure out what to
throw away and what to keep, then reorganize what you decided to keep. I
usually don't like to clean the garage, because it's a big job, so I
tend not to do it. On the other hand, if I don't see patterns in the
things in the garage, then I don't know how to organize it all. A mess
of things is the same mess as a mess of boxes, each with one thing in
it. Just because things are in boxes, that doesn't mean we've organized
them.

I find that I follow a simple pattern:

1. Assume that I don't clean the kitchen enough, so clean it more.
2. Someone notices that I'm cleaning the kitchen too much, so I clean it
less.
3. By not cleaning the kitchen enough, I end up with a miniature
garage-like mess, which takes hours or a day or two to clean up.
4. Not liking the experience of cleaning a small garage, I pay more
attention to cleaning the kitchen. Goto 1.

I not only find this pattern natural, but I suspect one can't really
avoid it. Over time, each team settles into a rhythm where they clean
the kitchen just enough and clean a garage every so often.
--
J. B. Rainsberger :: http://www.jbrains.ca ::
http://www.thecodewhisperer.com



Thu Jul 15, 2010 9:29 pm

nails762
Offline Offline
Send Email Send Email

Message #33121 of 34997 |
Expand Messages Author Sort by Date

Hi all, I am currently studying test driven development. I was wondering whether there is an advantage on design complexity of running small, fast & frequent...
yahya.rafique Offline Send Email Jul 14, 2010
12:03 am

... I'd love to provide you with an answer however I'm a bit confused by "an advantage of design complexity"? We favor design simplicity over design ...
Joshua Kerievsky
jlk112067 Offline Send Email
Jul 14, 2010
12:14 am

Hi Joshua, ... I read the question as, "Which has the most advantageous effect on design complexity: Fast, frequent refactoring cycles, or larger, periodic...
Dale Emery
dalehemery Offline Send Email
Jul 14, 2010
12:22 am

I am sorry for a wrong phrasing of the question. My intent is figuring out if there is any impact on the evolution of design if we put of refactoring until...
yahya.rafique Offline Send Email Jul 14, 2010
1:02 am

As far as I am able to determine, there appears to be an inverse relationship between the size of Red-Green-Refactor TDD cycles and the period for which you...
Adam Sroka
adamjaph Offline Send Email
Jul 14, 2010
1:59 am

Yahya, I cant give you any metrics I'm afraid. Indeed that will be a question you need to answer: "how do I measure this so I can tell whether one approach or...
Donaldson, John (GEO)
geo_johnfr Offline Send Email
Jul 14, 2010
6:50 am

Hi, Is it me or does anyone else noticed that the general guideline for most things related to software is "Smaller is better". Specifically, I think that like...
Lior Friedman
friedmanlior Offline Send Email
Jul 14, 2010
7:09 am

My response to that is vanishingly small. However, for emphasis, my response is "no" ... [Non-text portions of this message have been removed]...
Adam Sroka
adamjaph Offline Send Email
Jul 14, 2010
8:20 am

Hi, Adam, Am I misreading somethingg? I think Lior just agreed with what you had said and you then disagreed? scott...
sep
sepreece Offline Send Email
Jul 14, 2010
7:07 pm

I'm not sure what happened there. I think I was responding to a different message, because the response doesn't make any sense in context. Please ignore it :-#...
Adam Sroka
adamjaph Offline Send Email
Jul 15, 2010
2:29 am

P.S. I am on the wrong Coast and operating on very little sleep and maybe too much whiskey. That is why I am not sure of what I wrote (I need to attach some...
Adam Sroka
adamjaph Offline Send Email
Jul 15, 2010
2:40 am

I believe that the work is not linear with the size of debt (Lior) and the perceived risc is higher (Adam). Other thing is that you ensure that the activity is...
Josue Barbosa dos San...
josuebsantos Offline Send Email
Jul 15, 2010
1:21 pm

... The sloppier the design, the harder it is to evolve. Yet we can refactor while we work (continuous refactoring) and still not get to the design...
Joshua Kerievsky
jlk112067 Offline Send Email
Jul 15, 2010
1:28 pm

Hi jk, ... get ... reflecting ... us ... I think you are right. Theres comes a point that you need to take a step back and take a look at the bigger picture. I...
Lior Friedman
friedmanlior Offline Send Email
Jul 15, 2010
2:00 pm

... I don't think one can answer this question meaningfully in general, as the tradeoff depends on so many variables: the strength of the design, the...
J. B. Rainsberger
nails762 Offline Send Email
Jul 15, 2010
9:29 pm

... I find that developing software in a commercial context presents all kinds of signs (+/- revenue, learning opportunities, happy/sad users, bugs, ...
Joshua Kerievsky
jlk112067 Offline Send Email
Jul 15, 2010
10:02 pm

Thank you all for the timely feedback :-) Yahya...
yahya.rafique Offline Send Email Jul 15, 2010
12:21 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help