問題文
A test calls the function under test, stores the result in a variable and then ends. The suite reports it as passing. What is the main defect of this test?
選択肢
- It contains no assertion, so it passes for any result and only proves that the call did not throw.
- It lacks a teardown step, so state left behind by the call makes the next test unreliable and that is the reason the suite cannot be trusted.
- It stores the result in a variable, and a test has to compare the return value inline for the runner to observe the comparison and record it as an assertion.
- It calls the function only once, and a single call reaches just one point in the range of possible inputs.