[TIP] best strategy for retrofitting code with unit tests

Nate Lowrie solodex2151 at gmail.com
Mon Mar 5 14:17:44 PST 2007

Ok, I have done a couple of small - medium sized projects through a
TDD cycle and have been successful at it.  Now, we are trying to
retrofit a large framework (Dabo) with unit tests.  It's a 3 tier
framework with an agnostic db layer, business object/logic layer, and
a UI layer that currently wraps WxPython.

What is the best strategy for this?  Should we just adopt a TDD for
all new code and do a refactor/red/green cycle on the existing code as
the new code comes in?  Should we unit test the business layer only
and resign to acceptance testing on the other 2?

The good news is that the design is somewhat designed for testability.
 There are several mixin classes subclassed by multiple objects.  I
guess that it just seems daunting to me as I've haven't retrofitted
existing code before and this framework is over 15k LOC.  Any
suggestions are appreciated.


Nate L.

More information about the testing-in-python mailing list