A useful regression test can distinguish the original failure from the intended behaviour. Review that distinction before treating a green test as sufficient.

State the behavioural contract

Describe the initial widget state, the user action and the visible result. Include a boundary case that is likely to expose the problem: an empty list, the last remaining item, a repeated action or keyboard focus after dismissal.

Flutter’s widget-testing tools provide a test environment for building and interacting with widgets. A finder identifies a widget; an assertion checks an expectation. The result remains a widget-environment result and does not establish native platform behaviour.

Review the test in four passes

  1. Read the test’s setup and identify what state it creates.
  2. Check that its actions reproduce the reported sequence.
  3. Read each assertion as a user-visible promise.
  4. Ask whether the original implementation would fail that assertion.
Review examples — no framework bug or passing test is claimed
Synthetic scenarioBehaviour to assertWeak substitute
Remove the focused rowFocus reaches a surviving controlOnly checking that a method ran
Close an unchanged dialogFocus returns to the openerOnly checking that no exception was caught
Remove the last itemA usable empty state appearsOnly checking the item count variable

Separate missing evidence from a failure

If the test never ran against the original implementation, mark that comparison as missing. If it passes before and after, it might cover a useful adjacent behaviour, but it has not demonstrated the reported regression. Review the reproduction and the assertion together.

When the issue depends on a real keyboard, native view or platform permission flow, add the relevant target-level evidence separately. Keep the test name, command, exit result and SDK identity in the review record. A passing test should support a stated claim, not replace the explanation of what changed.

Name the behaviour → Reproduce the sequence → Assert the visible result → Check the original failure
Original explanatory diagram by Flock editorial. It summarises this guide’s procedure.

Name the behaviour → Reproduce the sequence → Assert the visible result → Check the original failure.

Primary sources

Continue with the next step

Resolve the next specific question

Find your next step

Browse the full sitemap