CS 228 meeting -*- Outline -*- * testing (HR 1.4, 1.5) ** strategies ------------------------- TESTING STRATEGIES top-down: make stubs for each function test main, then functions bottom-up: write test harness for each function test functions, then main ------------------------- we've written test harnesses before (e.g., for logistic diff) you can do both: in a team programming enviroment, one person can test main with stubs, others can test functions, then integrate this applies recursively, at each level of design advantages: top-down testing best if unsure of top logic may involve extra work if top logic is easy bottom-up may waste effort if top logic changes ** test oracles to test carefully, you need a plan for testing, not haphazard ------------------------------- TEST ORACLE Input values Predicted Output ================================ 4 9 7^D 4 7 9 87^D 87 99 100^D 99 100 ^D ------------------------------- actually need to have the format correct too ------------------------------- EVALUATING TEST ORACLES Correct outputs predicted? Covers boundary conditions? Covers error cases? Covers all code in the program? Covers all meaningful kinds of input? Covers some "average" cases? ------------------------------- Philosophy: try to break it people get paid for being good testers.