Formal Verification
- Suppose we limit foo to non-negative
integer arguments.
- Does showing that foo works for
arguments 0, 1, 2, 3, and 4 guarantee that
it works for all positive integers?
- No. A famous computer scientist said, "Testing can only prove the
presence, and never the absence, of bugs."
- A formal proof of the correctness of foo
does not proceed by testing it, but by analyzing it mathematically.
- A mathematical proof that foo always
squares its argument would proceed by the
method of mathematical induction