Re: TDD and Refactoring
From: Ron Jeffries (ronjeffries_at_REMOVEacm.org)
Date: 12/24/03
- Next message: Tsolak Petrosian: "Re: AOP: Prayer or Promise?"
- Previous message: Phlip: "Re: TDD and Refactoring"
- In reply to: Harry Erwin: "TDD and Refactoring"
- Next in thread: Harry Erwin: "Re: TDD and Refactoring"
- Reply: Harry Erwin: "Re: TDD and Refactoring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Dec 2003 10:49:43 -0500
On Wed, 24 Dec 2003 09:12:28 +0000, herwin@theworld.com (Harry Erwin) wrote:
>3. The class instances that are displayed in the GUI needed to hang
>around, so many of the polymorphism strategies had to be implemented
>using State/Strategy patterns. This produced an inheritance hierarchy
>explosion.
>
>4. Unit testing the math turned into a serious headache, especially with
>all the special cases. The business logic test case suite looks like
>it's headed for 100+ individual test cases. This is for a single use
>case.
>
>5. Replacing temps with queries produced method explosions in the key
>classes of the business logic.
>
>6. I was hoping careful refactoring would reveal some different ways of
>organizing the design. The complexity explosions made it very difficult
>to see the forest for the trees.
It would be very interesting to see more about this, especially as the system
evolved. As complexity increases, I'd expect that there is something to do about
it early on, so that one doesn't get an explosion. So I'm wondering whether
certain code smells were not detected in time. There are many more refactorings
besides Extract Method, as you know, and Extract Method alone does tend to add
trees to the forest.
I'm also wondering why there were special cases in the math. I ask because good
math seems to always be quite general, with very few special cases. On the other
hand, 100 test cases might be a perfectly reasonable number, depending on what
the app is. Even a thousand might be reasonable.
Replacing temp with query, I would say, does not increase complexity: there's
exactly one query per temp. Perhaps I'm missing something.
Also, if there are a lot of temps wanting to be around, there might be some
classes wanting to be extracted. Did you observe that need, and respond to it?
It's entirely possible that you have ended up with the best possible system, but
it sounds like your intuition says otherwise. Your intuition is probably right.
So what would make the system better, and why didn't the refactoring approach
lead you there?
You have had an interesting experience -- it would be great to read the article
or book that explains it all. What more have you the time to tell us?
-- Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.
- Next message: Tsolak Petrosian: "Re: AOP: Prayer or Promise?"
- Previous message: Phlip: "Re: TDD and Refactoring"
- In reply to: Harry Erwin: "TDD and Refactoring"
- Next in thread: Harry Erwin: "Re: TDD and Refactoring"
- Reply: Harry Erwin: "Re: TDD and Refactoring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|