Test professionalism (was: count items in generator)

Timothy Grant timothy.grant at gmail.com
Mon May 15 17:02:16 EDT 2006


On 5/15/06, Cameron Laird <claird at lairds.us> wrote:
> In article <mailman.5692.1147660541.27775.python-list at python.org>,
> Delaney, Timothy (Tim) <tdelaney at avaya.com> wrote:
>                         .
>                         .
>                         .
> >That's exactly my point. Assuming your test coverage is good, such an
> >error would be caught by the MemoryError. An infinite loop should also
> >be caught by timing out the tests, but that's much more dependent on the
> >test harness.
> >
> >Tim Delaney
>
> Gulp.  OK, you've got me curious:  how many people habitually frame
> their unit tests with resource constraints?  I think I take testing
> seriously, and certainly also am involved with resource limits often,
> but I confess I've never aimed to write all my tests in terms of
> bounds on time (and presumably memory and ...).  You've got me
> thinking, Tim.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I'm a huge proponent of unittest and believe I take them very
seriously also. I try never to write a line of code unless I have a
test to prove I need it.

I have written tests that take into account resource constraints, but
ONLY when I've written code that, while passing all tests, shows
resource consumption problems.

Creating resource contstraint tests out of the gate *may* fall into
the category of premature optimization.

-- 
Stand Fast,
    tjg.



More information about the Python-list mailing list