[TIP] Column questions.

Andrew Dalke dalke at dalkescientific.com
Wed Jul 23 14:17:42 PDT 2008


Laura Creighton:
> Should I really write my tests first?  Why?

Sub-question:

   Does writing the tests first discourage API modification?

I've noticed when I try to write tests-first it's very
annoying because after I have an idea of how the system
should hang together, I rewrite the API to fit that more
appropriately, which means I spend time rewriting my tests.
I tend to iterate API changes, which means I spend a lot
of time updating test code.  I end up not wanting to make
changes because there's already code which depends on
the API.

The agile approach seems to say "spike the solution then
throw it away and rewrite based on the knowledge." But
by the time I figure out a good API it's easier to fill
in the details and add the tests then than it is to start
from scratch.



				Andrew
				dalke at dalkescientific.com





More information about the testing-in-python mailing list