Unit test examples

Changjune Kim juneaftn at REMOVETHIShanmail.net
Sat Dec 21 20:40:38 EST 2002


"Greg Brunet" <gbrunet at nospamsempersoft.com> wrote in message
news:3e05082a$0$1432$272ea4a1 at news.execpc.com...
> I'm trying to get into the Pythonic & Extreme Programming way of doing
> things by adopting the practice of writing some good unit test routines
> along with (or before) writing my modules, and could use some good
> examples to learn from.
>

I developed a proteomics research workbench with (almost) pure python and
Extreme Programming. They are fantastic pairs. We shortened the due-date
almost as half as the firstly expected period of time. Everyone in the
company was amazed at the result -- there were five of us and we used a
separate warroom in the company.

> I've been reading Bruce Eckel's excellent "Thinking in Python"
> (http://www.mindview.net/Books/TIPython/), and am in chapter 2 (Unit
> Testing).  He notes, however, that this chapter hasn't had any
> significant translation yet, and a number of the examples still have
> Java or C++ keywords present (static, protected, void, etc.), so it's
> confusing me more than helping me.  Can anyone recommend another source
> of Python code and/or documentation that I could learn from?  Thanks,

I encourage you read TDDBE by Kent Beck(book or the pdf of the draft) and
JUnit source codes, including test codes. Don't worry too much about "the
right way". Just think about keeping small principles on the way. Such as
"Red, Green, Refactor", and "Short Green Bar Cycle"(which I coined). Then
you'll see something desirable, wonderful emerge from the system, as well
as from your mind and fingers.

June




More information about the Python-list mailing list