{ Prompts4All }

Write a test plan for a change

Workflow

Write a test plan for the change described below. The goal is the smallest set of tests that would catch a real failure, not the largest number of tests.

  • The change: {change}
  • The code or its public interface: {code}
  • How the project tests today (framework and existing coverage, if known): {test_setup}

Steps:

  1. List the behaviors that this change adds or alters, from the point of view of a caller or user. One line each.
  2. For each behavior, list the cases that are worth a test: the normal case, the boundaries (empty, one, many, maximum, invalid), the error paths, and any interaction with existing behavior that could break.
  3. Rank the cases by the cost of a failure: loss of data or money, wrong access, a broken contract with other code, then everything else.
  4. Mark each case as an automated test, a manual check, or not worth a test, with a reason of one line.

Rules for the automated tests:

  • Test through the public interface. Do not assert on private details, on the order of internal calls, or on values that a mock was told to return.
  • Each test must be able to fail. Say which line of the change would break it.
  • Do not repeat coverage that exists.

Output: a table with the columns Behavior, Case, Why it matters, Type, and Priority. Then write the code for the top-priority automated tests only, in the test framework of the project.