Chapter 5 of 6

Check that the tests can catch a fault

How can you tell whether a passing test would catch the bug you care about?

Choose a specific wrong behaviour and introduce it temporarily in an isolated copy. Run the relevant test, check that it fails for the expected reason, then run the original build again. Keep both results with the rule they demonstrate.

Try to disprove one claim

Pick a meaningful claim, such as ‘the expiry rule rejects confirmation at the deadline’. A failure to compile or start the app tells you little about the assertion for that rule.

  1. Establish that the unchanged build passes with the planned fixture.
  2. Make a small, reversible change that violates the agreed rule. Run the same case and inspect the failure message and observed value.
  3. If the test still passes, check whether it reached the decision, whether the input distinguishes the two outcomes and whether the assertion observes the effect. Repair the gap and compare both versions again.

Keep the conclusion narrow

Record the behaviour change and the check that detected it. If two implementations agree for every allowed input, document the reason that particular change cannot be distinguished. Other plausible faults still deserve their own evidence.

Worked example

One second that exposes a weak test

Temporarily allow a confirmation when its timestamp equals the expiry time. A case that tries only 09:11 passes against both versions. Add the owner-approved 09:10:00 example. The altered version now records a booking where the test expects a rejection. The original version passes the same case.

Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

Try Cue April on your repository