Use accepted and rejected temperature changes as evidence when revising the Wildcats application. Fix the behavior the evidence identifies, then check that other required behavior remains intact.
Use the validated TrainingArea implementation as the intended contract.
| Action | Expected temperature |
|---|---|
| Create area | 20.0 |
| Increase once | 20.5 |
| Decrease once | 19.5 |
| Increase ten times | 25.0 |
| Increase eleven times | 25.0 |
| Decrease eleven times | 15.0 |
Recreate the area before each table row. Otherwise earlier actions change the starting state and make the expected result inappropriate.
Suppose the setter accidentally uses strict comparisons. This fragment is intentionally faulty; it would replace the correct setter condition.
if (value > 15.0 && value < 25.0)
{
this.temperature = value;
}After nine increases the value is 24.5. The tenth proposes 25.0 but is rejected. That observation points to excluding the endpoint. Change the comparisons to >= and <= to match the inclusive contract.