Mathematics I / Programming for Mathematics
Practice question · Multiple choice

Testing a program on a hundred inputs and finding no failures does not prove it correct. Why is testing nonetheless the dominant method, rather than proof?

Hints
  1. How many possible inputs does a function taking two 64-bit integers have?
  2. Ask what a test suite costs to write compared with a correctness proof.
Show the answer

B. Because tests are cheap, catch most defects, and scale to real systems.

Why

It is the counterexample asymmetry from Unit 1: a universal claim cannot be established by finite checking, and a function on two 64-bit integers has more inputs than could be tested in the lifetime of the universe. Testing dominates on economics rather than logic, and formal verification is real, with seL4 and CompCert both carrying machine-checked proofs.

Read the lesson: Programming for Mathematics →

Practise Programming for Mathematics

The app has 6 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.

More questions on Programming for Mathematics