CSC151.01 2006S, Class 19: Unit Testing Admin: * I'll leave time at the start of class to discuss questions on exam 1. * Reminder: No CS extra today. * Reading for tomorrow "Local Bindings" * I have no data about the Math study break Overview: * Exam 1 * An Overview of Testing. * Using Our Test Environment. * Lab. /Questions on Exam 1/ * See the exam. Now revised. /What Did You Learn From The Reading?/ * It's good to test. * It's good to do a lot of tests. * Testing by hand is tedious. * Testing by hand can discourage programmers from changing their code, since looking at the test results is tedious. * Code that passes a test is not necessarily "good" (correct) * Testing can be adversarial. /How To Test/ (load "/home/rebelsky/Web/Courses/CS151/2006F/Examples/unit-test.ss") (begin-test!) (test! exp expected) (test! (+ 2 3) 5) (test! (+ 2 -2) 0) /Lab/ One goal of testing: If all the tests succeed, you should be relatively confident that the procedure works Another goal: Writing tests helps you write the procedure (or at least think about what it should do).