[TIP] testing: why bother?

Jonathan Lange jml at mumak.net
Wed Mar 23 08:59:01 PDT 2011


On Wed, Mar 23, 2011 at 3:37 PM, C. Titus Brown <ctb at msu.edu> wrote:
> On Wed, Mar 23, 2011 at 02:22:06PM +0000, Jonathan Lange wrote:
>> On Wed, Mar 23, 2011 at 2:09 PM, C. Titus Brown <ctb at msu.edu> wrote:
>> ...
>> > (Since I like to argue with Michael...)
>> >
>> > IMO, TDD is too big a leap for people without a fair amount of
>> > programming experience. ?However, once you have a bit of testing
>> > under your belt, TDD becomes much easier to justify.
>> >
>>
>> What makes you say that, other than an entirely understandable desire
>> to argue with Michael?
>
> I'll just whip out the "I teach undergrads for (part of) a living" card here...
>

By all means. If I were playing to win, I would have bluffed and
pretended to have a similar card. :)

> It may be that we get our students off to a bad start somehow, but my
> experience with our 2nd and 3rd year students is that they are so
> immature as programmers that they often don't get what to test for,
> they have no idea what a "specification" is, and, as a result, their
> tests are not clear expressions of anything.
>

Your reference to other methods of specification makes me think that I
should be considering the properties of TDD that I believe would help:
clear goals; an obvious next step; avoidance of regressions and
feelings of incremental success. Perhaps there are things that provide
these properties but avoid the difficulties for immature programmers.

> Or, to put it another way, learning how to test is just as hard as learning
> how to program. Since we don't know how to teach the latter, it's not
> clear to me why we would know how to teach the former :)
>

I agree that learning how to test is just as hard as learning how to
program. I'd also contend that learning how to program well is at
least as hard as knowing how to test. Being clear on what exactly you
are trying to do is harder than it sounds and is a vital element of
both.

Also, if we don't know how to teach either, then our know-how ought
not factor into our decision.

> Also I don't know of any actual evidence that TDD or agile actually improves
> programming speed, ability, thought, or anything else, over other methods of
> specification (more formal ones, for example).  Anecdotes need not apply.
>

I also don't know of any such evidence.

...
>> My hypotheses are that if they were taught to do TDD, this would be
>> much less of a problem, and that the relatively rigid discipline of
>> TDD makes it teachable even to programming novices.
>>
>> I guess this is wandering rather far off topic, but I would be very
>> interested to hear from anyone who has tried this.
>
> I'm not a big fan of TDD so I may not be doing this with conviction, but
> I have at least tried a little bit ;).
>
> Lest anyone think I'm negative on the whole concept, I'm not!  I am just
> confused about how to do a good job of inculcating testing; coming from my
> background, I thought it would be easier to put into effect, but it hasn't
> been so far.  I'd love to figure out how to do it.  And how to measure the
> effect so that I can prove I've done it.
>

Me too. Please keep me informed if you learn anything new. Thank you
for replying.

jml



More information about the testing-in-python mailing list