[TIP] Testing a daemon with coverage (nose)

Ben Finney ben+python at benfinney.id.au
Fri May 8 06:22:57 PDT 2009


Marius Gedminas <marius at gedmin.as> writes:

> I've got a 135000-line application (not counting size of 3rd-party
> libraries we rely on) with 2753 unit tests. The tests use stubs where
> convenient and don't rely on external resources. The unit test suite
> takes 8 and a half minutes to run, not counting module imports
> (additional 40 seconds) from cold cache on a 1.8 GHz Core 2 Duo CPU.
> When everything's in disk cache the import time drops to 6 seconds,
> but the test run is still over 8 minutes.

That's quite a large amount of code to be treating all as a single
homogeneous code base. Attempting to treat it all as a big lump called
“the application” seems like a design smell that needs addressing.

Such a large amount would prompt me to try to find natural
coarse-grained sections, to be de-coupled into libraries to the rest of
the system and have well-defined interfaces. That would mean that at any
time you're developing on a significantly smaller code base, with a
correspondingly smaller set of interdependent code and smaller suite of
unit tests.

-- 
 \        “If you have the facts on your side, pound the facts. If you |
  `\     have the law on your side, pound the law. If you have neither |
_o__)                       on your side, pound the table.” —anonymous |
Ben Finney
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090508/ede8f933/attachment.pgp 


More information about the testing-in-python mailing list