[plt-scheme] testing modules
At 9:15 AM -0400 6/6/06, Matthias Felleisen wrote:
>I can easily imagine teaching that
>
> (= (f 10) 11)
>
>should really read
>
> (check = (f x) 11)
>
>which should really read
>
> (test-equal = (f x) 11)
>
>and so on. I can't imagine doing this in a course that starts with
>writeln("hello world").
I'm always amazed when students who haven't started with a
testing-heavy methodology like HtDP or XP come into my upper-level
courses and turn in programs with MAYBE one test case (or more
likely, just an interactive UI so I can type in my own and check the
answers by eye).
Of course, the reason they only wrote one test case is because, to
run more than one test case, they would need to copy and paste the
whole program again, because they didn't break it down into
parameterized functions that return results. Which they didn't do
because they weren't thinking about testing from the beginning.
--
Stephen Bloch
Math/CS Dept
Adelphi University
sbloch at adelphi.edu