[TIP] testing: why bother?
lac at openend.se
Wed Mar 23 08:14:53 PDT 2011
In a message of Wed, 23 Mar 2011 14:22:06 GMT, Jonathan Lange writes:
>I have actually been thinking recently that if I were to have the
>opportunity to teach programming to a beginner then I would like to
>try starting with TDD (& probably also VCS) from the very beginning. I
>have recently watched a couple of novice programmers suffer through
>their formal instruction, largely because they were always piling
>uncertainty upon uncertainty. When doing assignments, they would add
>some code that they thought worked, then some more code that they
>thought worked, then some more, and then after a few hours of
>difficult thinking and coding they would try to run the code and then
>see that it doesn't work and then be very upset.
>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.
It's working here for the teaching of children. And the other very
useful thing is that the kids always have more ideas than they can
handle. So they tend to write messes like the one you described
because they cannot think about one thing at a time. If every time
they have an idea, instead of trying to write code, they just write
a test that expresses what they want the idea to do ... they can
get back to finishing what they were working on. Works better than
other things I have tried.
More information about the testing-in-python