Show solutionHide solution
Question 10
A conversion bug can preserve changes while corrupting temperatures
A program should calculate Celsius values using . Instead it uses . Treat these as numerical scale equations with exact constants.
Diagram shown in the original SVG worksheet.
For inputs and , calculate the correct and faulty Celsius outputs. Report faulty outputs to two decimal places.
Derive the difference for any input and explain why it is constant.
Would a test that checks only the temperature rise from 32 to detect the bug? Propose a better test.
Question 10 - Solution
A conversion bug can preserve changes while corrupting temperatures
Diagram shown in the original SVG worksheet.
(a) Evaluate two reference inputs
Correct outputs are and . Faulty outputs areThe subtraction must occur before multiplication in the correct equation.
(b) Subtract the equations
Every faulty output is about too low. The input-dependent terms cancel because the slopes match.
(c) Test both slope and offset
No. Both formulas give a rise of between those inputs; the constant error cancels in the difference. Test at least one absolute reference output, such as , and also test a second point to check the slope.
Check and interpretation
A correct interval conversion does not prove a correct temperature conversion. An offset error can pass every difference-only test.