Practice question · Select all that apply
A program computes the mass of a car and reports 1500000 kilograms. Select every check that would have caught this before the number was published.
Hints
- The wrong answer is positive, finite, and produced without any error, so some checks are blind to it.
- The ones that work all compare the result against something known from outside the program.
Show the answer
- A. An order-of-magnitude sanity check against a known car mass
- D. A cross-check against an independent calculation
- E. A comparison of the result against a published value within a tolerance
Why
A thousandfold error passes a positivity check and any test that only asks whether the program ran. It is caught by comparing against outside knowledge: the right order of magnitude, an independent method, or a published value. This is why a sanity check is a distinct discipline from validation, one asks whether the answer is legal, the other whether it is believable.
Practise Program Design for Scientific or Engineering Tasks
The app has 8 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.