[TIP] Testing in General

C. Titus Brown ctb at msu.edu
Tue Mar 31 20:47:05 PDT 2009

On Tue, Mar 31, 2009 at 06:20:21PM -0400, David Blewett wrote:
-> This is rather embarrassing to admit, but I have yet to add any kind
-> of testing to my burgeoning application. I don't have formal CS
-> training, having just picked up what I need to get the job done.
-> Python has been a joy to learn, and I think I've done a pretty good
-> job of writing "Pythonic" code. Does anyone have pointers to good
-> books or resources that address the theory behind the different types
-> of testing?
-> I was going to start by putting in coverage testing, so that I can
-> start adding tests to the most active sections of my codebase. Any
-> advice is appreciated.

In addition to the other excellent advice given here, I often suggest
starting by testing the bejeezus out of existing bugs -- that is, when
you find a bug, write a test to exercise it first, then fix the bug,
then run the test again.

It's a good way to justify your behavior to a manager, in particular.

This is also a good way to figure out where the ugliest parts of your
codebase lie in wait ;).

C. Titus Brown, ctb at msu.edu

More information about the testing-in-python mailing list