CSC104H1 Lecture Notes - Lecture 6: Test-Driven Development, Software Engineering, Data Type
Document Summary
> ; a check expect tests our expectation that two expressions produce the same value. When we run the file, racket reports the resulte of all the tests. #;(check-expect (+ 1 2 3 4 5 6 7 8 (/ (* 8 (+ 1 8)) Document for us and other readers, the intended behavior of a function. Documentour design process. (check-expect (+ 1 2 3 4 5 6 7 8) (/ (* 8 9) 2)) (define (add-up-1-to _) (/ (* _ (+ 1 _)) 2)) ;design for the function : (check-expect (add-up-1-to 8) (/ (* 8 (+ 8 1)) ;normally we will not use a definitio before a definition, but it is good software engineering practice to write our expections and document our design. So check-expect works until the test of the file executes. Writing tests to documents and design functions is called. ;heres a boundary/edge/extreme (check-expect (add-up-1-to 1) 1 )