The idea
A test needs input, action and an observable expectation. Include ordinary, boundary and error cases tied to the feature contract. An assertion that only checks no exception may miss an incorrect value. Avoid copying the implementation into the expected-result calculation when an independent expected result is available.
Worked example
A discount function turns 100 with a 10% discount into 90. A test expecting exactly 90 detects a faulty result of 95; a test merely checking that a number was returned does not. A negative discount requires the contract to specify rejection or another deliberate behavior.
Try it
Write four tests for a fictional total function: normal values, empty input, zero and invalid input. Supply independent expected results. Introduce one plausible defect and identify the test that would fail rather than merely execute the function.
