Data-driven testing

andrew cooke andrew at acooke.org
Thu Apr 24 10:43:59 EDT 2003


i'm not a great testing enthusiast (it's just another tool, not a magic
bullet), but sometimes you can write tests during exploratory coding.  in
general, for example, you can have a spearation between "invoking" the
code and the implementation - then i'd put code for running the program
and printing the output (or whatevere) in a "test" (even if it doesn't
actually test anything).  then i play with the implementation, running the
"test" to see what teh results are.  once i like the way things are going,
the test can be extended to include some assertions.

this isn't always possible - it works for the classes where you can add a
main method to play around from the command line.  the test simple
replaces that main method...

andrew

Max M said:
> While I do understand the principles of tdd, testing first and all that,
> I have a hard seing why it should be an advantage to do it in the early
> stages of a project.
[...]

-- 
http://www.acooke.org/andrew





More information about the Python-list mailing list