{
  "id": 22455416,
  "title": "Write Given/When/Then criteria a test can actually check",
  "url": "https://urgent.news/2026/11/28/write-given-when-then-criteria-a-test-can-actually-check",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-28T21:57:57.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/acceptpack/write-givenwhenthen-criteria-a-test-can-actually-check-38dl"
  },
  "original_language": null,
  "account": "Testing criteria for Given/When/Then criteria in Gherkin can be determined by ensuring the following points:\n\n- Every Then statement must describe an observable outcome, such as a message, status code, stored record, or redirect.\n- The values mentioned should be concrete, such as specific strings, numbers with units, or examples.\n- Each scenario should be self-contained and not rely on any setup that is not described within the scenario itself.\n- There should only be one action per scenario, represented by a single When step.\n- At least one scenario should cover a failure case, such as a declined card, invalid input, an empty list, or a limit.\n- The use of modal verbs like \"should\" or \"may\" should be replaced with specific outcomes that can be measured, like \"the page shows\" or \"the request returns.\"\n- Avoid vague terms and replace them with evidence that can be checked, like numbers, status codes, messages, or state changes.\n\nThese guidelines serve as a set of heuristics to identify common gaps in test criteria. However, it is important to note that they are not a complete method and still require human review to determine if the behavior meets the desired requirements.",
  "summary": "Coding agents, and the tests we later write, only see what we put on the page. If a Then says the payment \"should work properly,\" there is nothing for a test to assert and nothing for an agent to build against. It has to invent a meaning. This article is about making Given/When/Then (Gherkin) criteria testable. The checks below are from a free, rule-based linter called acceptpack-lint. It is not…",
  "summary_source": "publisher",
  "key_points": [],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}