TDD and Refactoring

From: Harry Erwin (herwin_at_theworld.com)
Date: 12/24/03


Date: Wed, 24 Dec 2003 09:12:28 +0000

I'm running an experiment with test-driven-development and refactoring
as the development methodology for a program that makes use of the swing
GUI and does a lot of complex mathematical modeling with many special
cases in the business logic. Lessons learned so far:

1. "Duplicate observed data" took some work but simplified the design
markedly once I implemented it.

2. "Extract method" was the most common refactoring used to clean up the
GUI.

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.

-- 
Harry Erwin <http://www.theworld.com/~herwin/>


Relevant Pages

  • Re: TDD and Refactoring
    ... As complexity increases, ... intelligent systems at university and have some background in game AI), ... GUI needs them to be final), but those are obvious places to exploit ... > the refactoring approach lead you there? ...
    (comp.object)
  • Re: Vote for it: ECO Visual Studio plugin
    ... new approach to writing applications as logical tasks with GUI rather than a ... if the VCL can include natively some ... out and replaced by native code equivalents. ... Modelmaker fully integrated into the IDE and refactoring done without ...
    (borland.public.delphi.non-technical)
  • Re: Getting management to move from green screen
    ... complexity is your own, recent problem of the workstations that no ... Does this mean I'm against GUI or refuse to develop with it? ... If everyone from the users to management are happy with the existing ... but instead refactoring the areas that may benefit from ...
    (comp.databases.pick)
  • Refactoring a Swing GUI
    ... Here's a dumb question--how do you realistically go about refactoring a ... javax.swing GUI? ... and it smells to high heaven. ... Harry Erwin ...
    (comp.object)