Tuesday 17 September 2013

What are test cases in scheme and how do I use them?

What are test cases in scheme and how do I use them?

I'm a complete beginner at scheme, and want to know what test cases are,
or even do. For example, if I wanted to write a test case for the negative
root quadratic function I already coded and tested, how would I do it?
(define (quadnegative a b c)
(* (/ (+ (sqrt (-(square b) (* 4 a c))) b) 2 a) -1))
;Value: quadnegative
(quadnegative 1 3 -4)
;Value: -4
Thank you in advance.

No comments:

Post a Comment