[TIP] Beginner Resources

Nate Lowrie solodex2151 at gmail.com
Mon Mar 5 17:27:29 PST 2007

On 3/5/07, Grig Gheorghiu <grig at gheorghiu.net> wrote:
> --- Nate Lowrie <solodex2151 at gmail.com> wrote:
> > Ok, let me start off and say congrats for becoming a TDD convert.
> > Next, your first order of business is NOT to try to add tests to your
> > existing code.  I say that because this is one of the hardest things
> > to do and as a beginner you will probably frustrate yourself to no
> > end
> > (I am currently and I have done several TDD projects).
> I disagree with this approach. I found that writing unit tests for code
> that I didn't even write (Titus did) was an excellent way for me to
> learn the code. It also had the fortunate side-effect of shoring up our
> test coverage.
> I'd say go ahead and write tests for your code. You'll be frustrated,
> no doubt about it, until you get the hang of it. But it will be a
> worthwhile exercise.

I would agree with you that it is good, especially for learning which
designs are bad and how to write good code in addition to good tests.
All I was trying to say is to do some simple examples to get the hang
of it before jumping right into a bioinformatics library.

> > I would strongly recommend reading everything on
> > http://xunitpatterns.com/  It goes into in depth detail on the
> > different aspects of TDD, test smell, code smells, refactoring, etc.
> That site can be overwhelming to a newcomer. It goes into way too much
> detail and hairsplitting in many cases.

Ok, I'll give that it is overwhelming.  However, it did have alot of
good info and the info was all in one place.

Maybe the book TDD: By Example would be better?

Also, while I remember, if you want to see unit tests for a large
framework, check out the Twisted source code.  There are many examples
of tests in there.

> Grig

More information about the testing-in-python mailing list