Should Test-Driven Development be in the beginners tutorial?

Jason Rogers jacaetevha at gmail.com
Sat Sep 23 22:34:19 UTC 2006


As a TDD practictioner for almost 8 years, I can say from experience
that it doesn't double the work.  Doing TDD makes you think about the
design from the perspective of a real client (the test) as Ralph said.
 Chances are that you will get the interface you wanted through
testing much easier than without because you have the client there
telling you what you need as an interface.

I don't claim that TDD is the silver bullet, dogmatically forcing it
down the throats of others.  But I can easily say that I am much more
productive using TDD than without using it, just as I am much more
productive using Smalltalk than Java or C++ or Perl or Ruby or...

On 9/23/06, J J <azreal1977 at hotmail.com> wrote:
>
> Well, that is valid.  The alternative to what I said is:  if your going to
> train someone, train them right from the start.
>
> I guess I don't do it the way you described because I make my classes with
> an interface, then part way through I determine my first cut was wrong.  If
> I started with the tests I would have to change all the tests along with my
> class changes (right?), effectively doubling the work I do now.
>
> Has any work been done to integrate testing into the browser?  It seems like
> some of the things you would write tests for are pretty predictable and
> could be automated or semi-automated.
>
> >From: "Ralph Johnson" <johnson at cs.uiuc.edu>
> >Reply-To: The general-purpose Squeak developers
> >list<squeak-dev at lists.squeakfoundation.org>
> >To: "The general-purpose Squeak developers
> >list"<squeak-dev at lists.squeakfoundation.org>
> >Subject: Re: Should Test-Driven Development be in the beginners tutorial?
> >Date: Sat, 23 Sep 2006 10:00:01 -0500
> >
> >>A possible way is to make a theme like they did in Dolphin.  In Dolphin
> >>the
> >>tutorial is about making a minimal bank account program.  Someone wrote
> >>tutorials about how to extend these later.  I think that could work.  You
> >>make your simple Morhpic app, then in the next installment you explain the
> >>features your application doesn't have but needs and so you explain that
> >>you
> >>want to first make unit tests to ensure you don't break anything.
> >
> >Matthew asked about unit tests, but he really should have asked about
> >test-first.
> >
> >This isn't test-first.  Unit tests have many purposes.  Only one is to
> >ensure that changes don't break anything.  A more important purpose is
> >to ensure that you know what you are programming.  Test-first lets you
> >think about the interface to your classes from the users point of
> >view.  It provides documenation to how to use your classes, and
> >provides a kind of specification.  Test-first is about design even
> >more than testing.
> >
> >-Ralph Johnson
> >
>
>
>
>


-- 
Jason Rogers

"Where there is no vision, the people perish..."
    Proverbs 29:18



More information about the Squeak-dev mailing list