Download presentation
Presentation is loading. Please wait.
Published byMark Blair Modified over 9 years ago
1
Introduction to Testing CSIS 1595: Fundamentals of Programming and Problem Solving 1
2
What is Program Correctness? Program produces correct output for all possible inputs Requires you to know what correct output is Impossible to assure in practice – Cannot test program with all possible input in all possible situations
3
Types of Errors Syntax errors: Code that cannot be understood by interpreter/compiler Run time errors: Code that causes program to “crash” when run Logic errors: Code runs, but does not produce correct output for some input – Hardest to find and fix!
4
Program Testing Done with test cases – Input to program – Expected output of program – If actual output ≠ expected output, logic error Example: – Input: 3.6, 9.2 – Expected output: 6.4
5
Program Testing 1.Design input of case – What are you testing? 2.Compute expected output – Know what program should do before performing the test 3.Perform test – Compare actual result to expected result 4.Debug program – Modify program so actual result = expected result
6
Good Testing Attitude: running program with goal of finding errors – Successful test finds error Test cases created in advance – Done before writing program Testing done continuously – Test during program after new code added – Test after each change to program as part of debugging
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.