Where did you learn to unit test? How did you learn?

John Roth johnroth at ameritech.net
Mon May 5 20:17:10 EDT 2003


"Greg Ewing (using news.cis.dfn.de)" <ckea25d02 at sneakemail.com> wrote in
message news:b96s64$fjf4g$1 at ID-169208.news.dfncis.de...
> Roy Smith wrote:
> >
> > A unit test is something which tests an atomic unit of code for
correct
> > operation.  This is opposed to system testing, where you test a
whole
> > application at one time.  Not everybody agrees on what an "atomic
unit"
> > is.  Some people think of a function as a unit, some people think of
a
> > class as a unit.  I don't think there's any one correct answer to
that.
>
> I think the important thing about what we're discussing
> here is that the tests are automated, not whether they're
> testing identifiable code units or not.
>
> My test suite for Pyrex runs the whole compiler for each
> test, because the parts are so interdependent that it
> doesn't really make sense to test any part in isolation --
> all the interesting things happen in the way the various
> parts interact.
>
> What I do have is a bunch of tiny Pyrex source files
> that each exercise some part of the Pyrex language. So the
> "units" being tested are pieces of functionality rather
> than pieces of code. Maybe it doesn't strictly qualify
> as unit testing, but it seems to work!

If I wanted to be strictly XP, I'd call them acceptance
tests. And yes, they need to be there and they need to
be automated.

If I didn't care about being XP, I'd simply admire them
for getting the job done.

John Roth
>
> --
> Greg Ewing, Computer Science Dept,
> University of Canterbury,
> Christchurch, New Zealand
> http://www.cosc.canterbury.ac.nz/~greg
>






More information about the Python-list mailing list