[TIP] Testing in General

Marius Gedminas marius at gedmin.as
Tue Mar 31 23:14:47 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.

I was rather disappointed with my formal CS education when I realized it
did not mention testing at all.

> 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?

_Dive_into_Python_ has a couple of chapters on unit testing:

 * http://diveintopython.org/unit_testing/index.html
 * http://diveintopython.org/unit_testing/stage_1.html

_Test_Driven_Development_by_Example_ has examples of unit tests too
(although I found the Python code in it to be a bit unPythonic at

 * http://www.amazon.com/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530

I'm still coming to grips with functional/integration/acceptance/system
testing myself -- there are many good blog posts about those, but I
cannot point to a single good complete resource.

> 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.

The traditional piece of advice here is "just remember that 100% line
coverage doesn't mean the code is tested".  Coverage is a great tool for
pointing out code that is not tested.

Marius Gedminas
(mental note: stop installing red hat. everytime i do so, it takes ages to fix
my system again.)
                -- from the sig of Martin Högman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090401/e0db5832/attachment.pgp 

More information about the testing-in-python mailing list