[plt-scheme] thanks, but help again

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Mar 30 21:08:26 EST 2004

On Mar 30, 2004, at 8:09 PM, Connor Ferguson wrote:

> Aren't tests just thinking up an example input for the program, 
> figuring
> out what the expected result should be, running the program and then
> comparing the expected result with the actual output of the program?

Yes, that's the case. *BUT*, if your programs consists of three 
functions,
then you must have tests for each and every function in your program. 
That
way the overall program is more likely to work.

> What Matthias said worked and the shot registered as hit when it passed
> through the UFO. However, if the shot missed the UFO and the UFO moved 
> in
> line with where the shot was, it registered as hit.

Please send me a test case that represents this situation and the 
expected
results. I will then use the stepper through your program and determine
where it fails. (Please include the structs and function again.)

> I’m really getting frustrated with this.

I understand that. You need to understand that your frustration is at 
least
to a great portion caused by your divergence from the basic design 
recipe.
It is really critical that you imagine/create a proper suite of 
examples for
every function in a program. Otherwise you will get into far more 
unpleasant
situations with programs and other products.

Imagine the following. Say you write an entire book. But you don't 
spell check
each page and chapter. After 300 or 400 pages, you decide to spell 
check. I
promise you that the frustration of finding hundreds of bugs will make 
the
task much more unpleasant, frustrating and error-prone than if you had 
run a
check for every page. (Now in this day and age, tools check every word 
as you
go. So imagine yourself 10 years back.) Or imagine a car factory that 
doesn't
check at every stage in the process but only at the very end. They will 
have
a much harder time finding problems with the car than a factory that 
checked
at every stage.

Always keep in mind that we're here to help -- Matthias



Posted on the users mailing list.