Software Development and Project Management

The specification says 'issue a warning if the temperature is 85 °C or higher', but the firmware mistakenly contains 'if (t > 85)'. The temperature t is an integer. Which of the following test values can detect this error?

  1. A84 °C
  2. B85 °C
  3. C86 °C
Show answer and explanation

Answer: B. 85 °C

According to the specification a warning should be issued at 85 °C, but t > 85 is false when t = 85, so the specification and the implementation disagree only when 85 °C is given. At 84 °C neither issues a warning and at 86 °C both do, so the error is not visible. Testing values that include the boundary itself in this way is the idea of boundary value analysis. Confusing comparison operators is a common error in threshold checks in firmware.

  • A. Neither the specification nor the implementation issues a warning, so the results match and the error is not visible.
  • B. Correct. The specification issues a warning and the implementation does not, so the error is detected.
  • C. Both the specification and the implementation issue a warning, so the results match and the error is not visible.
Practice this topic Back to topic

Related calculators

Books on Software Development and Project Management Ad

As an Amazon Associate I earn from qualifying purchases.

More Software Development and Project Management questions

  1. The values of temp and err can be chosen independently of each other. For the code 'if (temp > 80) { fan = HIGH; } else { fan = LOW; } if (err) { log(); }', what is the minimum number of test cases needed to achieve statement coverage (executing every statement at least once)?
  2. The truth values of a, b and c can be chosen independently of each other. For the code 'if (a) { S1; } if (b) { S2; } if (c) { S3; }', what is the minimum number of test cases needed to achieve branch coverage (executing both the true and false outcomes of every decision at least once)?
  3. For the decision 'A and B' (A and B are conditions whose truth values can be set independently), two test cases were run: (A = true, B = false) and (A = false, B = true). Which statement about coverage criteria is correct?
  4. In bottom-up testing, what is built to stand in for a higher-level module that does not exist yet, so that it calls the lower-level module under test, passes it test data and receives the results?
  5. During testing, a reliability growth curve was plotted with the test time (or the number of test cases executed) on the horizontal axis and the cumulative number of defects found on the vertical axis. The curve is still rising, with no sign of saturating (leveling off). Which judgment is most appropriate?