9 Testing
Software testing is a process in which you execute your program using data that simulate user inputs. You observe your program’s behavior to see whether or not it is doing what it’s supposed to do. Tests pass if the behavior is what you expect; tests fail if the behavior differs from that expected.
If your program does what you expect, then for the inputs used, the program behaves correctly. If these inputs are representative of a larger set of inputs, you can infer that the program will behave correctly for all members of this larger input set. This is especially true if you test it with several inputs from this larger set and it behaves as you expect for all of them.
If the behavior of the program does not match the behavior that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access