{"id":5003186,"date":"2015-12-16T22:02:29","date_gmt":"2015-12-17T06:02:29","guid":{"rendered":"https:\/\/aadev22.local\/?post_type=aa_glossary&#038;p=5003186"},"modified":"2023-10-18T12:31:39","modified_gmt":"2023-10-18T19:31:39","slug":"given-when-then","status":"publish","type":"aa_glossary","link":"https:\/\/agilealliance.org\/glossary\/given-when-then\/","title":{"rendered":"Given &#8211; When &#8211; Then"},"content":{"rendered":"<p>The Given-When-Then formula is a template intended to guide the writing of\u00a0<a href=\"https:\/\/agilealliance.org\/glossary\/acceptance\/\">acceptance tests<\/a>\u00a0for a\u00a0<a href=\"https:\/\/agilealliance.org\/glossary\/user-story-template\/\">User Story<\/a>:<\/p>\n<ul>\n<li>(Given) some context<\/li>\n<li>(When) some action is carried out<\/li>\n<li>(Then) a particular set of observable consequences should obtain<\/li>\n<\/ul>\n<p>An example:<\/p>\n<ul>\n<li>Given my bank account is in credit, and I made no withdrawals recently,<\/li>\n<li>When I attempt to withdraw an amount less than my card\u2019s limit,<\/li>\n<li>Then the withdrawal should be complete without errors or warnings<\/li>\n<\/ul>\n<p>Tools such as JBehave, RSpec, or Cucumber encourage the use of this template, though it can also be used purely as a heuristic irrespective of any tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.<\/p>\n","protected":false},"author":6000331,"featured_media":8067461,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","categories":[904],"tags":[],"class_list":["post-5003186","aa_glossary","type-aa_glossary","status-publish","has-post-thumbnail","hentry","category-business"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Agile Alliance\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/agilealliance.org\/glossary\/given-when-then\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\n\t\t<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=UA-17319182-1\"><\/script>\n<script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', 'UA-17319182-1');\n<\/script>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Agile Alliance | Promoting a more effective, humane, and sustainable way of working\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"What is &quot;Given - When - Then&quot;?\" \/>\n\t\t<meta property=\"og:description\" content=\"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/agilealliance.org\/glossary\/given-when-then\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"726\" \/>\n\t\t<meta property=\"og:image:height\" content=\"380\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2015-12-17T06:02:29+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-10-18T19:31:39+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/agileallianceofficial\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@AgileAlliance\" \/>\n\t\t<meta name=\"twitter:title\" content=\"What is &quot;Given - When - Then&quot;?\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/agilealliance.org\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/category\\\/business\\\/#listItem\",\"name\":\"Business\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/category\\\/business\\\/#listItem\",\"position\":2,\"name\":\"Business\",\"item\":\"https:\\\/\\\/agilealliance.org\\\/category\\\/business\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#listItem\",\"name\":\"Given &#8211; When &#8211; Then\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#listItem\",\"position\":3,\"name\":\"Given &#8211; When &#8211; Then\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/category\\\/business\\\/#listItem\",\"name\":\"Business\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/#organization\",\"name\":\"Agile Alliance\",\"description\":\"Promoting a more effective, humane, and sustainable way of working\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/pmi-aa-logo-temp.png\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#organizationLogo\",\"width\":798,\"height\":252,\"caption\":\"NOT FINAL\"},\"image\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/agileallianceofficial\\\/\",\"https:\\\/\\\/www.pinterest.com\\\/agilealliance\\\/_created\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/4860067\\\/admin\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/author\\\/6000331#author\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/author\\\/6000331\",\"name\":\"Agile Alliance\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6bcf4ab09b16c1463bc4f72064fcfc0d9c53fa76d9b63c193eb30cf55bd5c021?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Agile Alliance\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#webpage\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/\",\"name\":\"What is \\\"Given - When - Then\\\"? | Agile Alliance\",\"description\":\"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/author\\\/6000331#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/author\\\/6000331#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/glossary-featured-banner.jpg\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#mainImage\",\"width\":972,\"height\":380,\"caption\":\"Agile Essentials Glossary\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/glossary\\\/given-when-then\\\/#mainImage\"},\"datePublished\":\"2015-12-16T22:02:29-08:00\",\"dateModified\":\"2023-10-18T12:31:39-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/agilealliance.org\\\/#website\",\"url\":\"https:\\\/\\\/agilealliance.org\\\/\",\"name\":\"Agile Alliance\",\"description\":\"Promoting a more effective, humane, and sustainable way of working\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/agilealliance.org\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"What is \"Given - When - Then\"? | Agile Alliance","description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story.","canonical_url":"https:\/\/agilealliance.org\/glossary\/given-when-then\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":"&lt;!-- Global site tag (gtag.js) - Google Analytics --&gt;\n&lt;script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=UA-17319182-1\"&gt;&lt;\/script&gt;\n&lt;script&gt;\n&nbsp;window.dataLayer = window.dataLayer || [];\n&nbsp;function gtag(){dataLayer.push(arguments);}\n&nbsp;gtag('js', new Date());\n\n&nbsp;gtag('config', 'UA-17319182-1');\n&lt;\/script&gt;"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/agilealliance.org#listItem","position":1,"name":"Home","item":"https:\/\/agilealliance.org","nextItem":{"@type":"ListItem","@id":"https:\/\/agilealliance.org\/category\/business\/#listItem","name":"Business"}},{"@type":"ListItem","@id":"https:\/\/agilealliance.org\/category\/business\/#listItem","position":2,"name":"Business","item":"https:\/\/agilealliance.org\/category\/business\/","nextItem":{"@type":"ListItem","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#listItem","name":"Given &#8211; When &#8211; Then"},"previousItem":{"@type":"ListItem","@id":"https:\/\/agilealliance.org#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#listItem","position":3,"name":"Given &#8211; When &#8211; Then","previousItem":{"@type":"ListItem","@id":"https:\/\/agilealliance.org\/category\/business\/#listItem","name":"Business"}}]},{"@type":"Organization","@id":"https:\/\/agilealliance.org\/#organization","name":"Agile Alliance","description":"Promoting a more effective, humane, and sustainable way of working","url":"https:\/\/agilealliance.org\/","logo":{"@type":"ImageObject","url":"https:\/\/agilealliance.org\/wp-content\/uploads\/2025\/02\/pmi-aa-logo-temp.png","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#organizationLogo","width":798,"height":252,"caption":"NOT FINAL"},"image":{"@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/agileallianceofficial\/","https:\/\/www.pinterest.com\/agilealliance\/_created\/","https:\/\/www.linkedin.com\/company\/4860067\/admin\/"]},{"@type":"Person","@id":"https:\/\/agilealliance.org\/author\/6000331#author","url":"https:\/\/agilealliance.org\/author\/6000331","name":"Agile Alliance","image":{"@type":"ImageObject","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/6bcf4ab09b16c1463bc4f72064fcfc0d9c53fa76d9b63c193eb30cf55bd5c021?s=96&d=mm&r=g","width":96,"height":96,"caption":"Agile Alliance"}},{"@type":"WebPage","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#webpage","url":"https:\/\/agilealliance.org\/glossary\/given-when-then\/","name":"What is \"Given - When - Then\"? | Agile Alliance","description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/agilealliance.org\/#website"},"breadcrumb":{"@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#breadcrumblist"},"author":{"@id":"https:\/\/agilealliance.org\/author\/6000331#author"},"creator":{"@id":"https:\/\/agilealliance.org\/author\/6000331#author"},"image":{"@type":"ImageObject","url":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner.jpg","@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#mainImage","width":972,"height":380,"caption":"Agile Essentials Glossary"},"primaryImageOfPage":{"@id":"https:\/\/agilealliance.org\/glossary\/given-when-then\/#mainImage"},"datePublished":"2015-12-16T22:02:29-08:00","dateModified":"2023-10-18T12:31:39-07:00"},{"@type":"WebSite","@id":"https:\/\/agilealliance.org\/#website","url":"https:\/\/agilealliance.org\/","name":"Agile Alliance","description":"Promoting a more effective, humane, and sustainable way of working","inLanguage":"en-US","publisher":{"@id":"https:\/\/agilealliance.org\/#organization"}}]},"og:locale":"en_US","og:site_name":"Agile Alliance | Promoting a more effective, humane, and sustainable way of working","og:type":"article","og:title":"What is &quot;Given - When - Then&quot;?","og:description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.","og:url":"https:\/\/agilealliance.org\/glossary\/given-when-then\/","og:image":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg","og:image:secure_url":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg","og:image:width":726,"og:image:height":380,"article:published_time":"2015-12-17T06:02:29+00:00","article:modified_time":"2023-10-18T19:31:39+00:00","article:publisher":"https:\/\/www.facebook.com\/agileallianceofficial\/","twitter:card":"summary_large_image","twitter:site":"@AgileAlliance","twitter:title":"What is &quot;Given - When - Then&quot;?","twitter:description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.","twitter:image":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner.jpg"},"aioseo_meta_data":{"post_id":"5003186","title":"What is &quot;Given - When - Then&quot;? #separator_sa #site_title","description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story.","keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":"What is &quot;Given - When - Then&quot;?","og_description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.","og_object_type":"article","og_image_type":"custom_image","og_image_url":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg","og_image_width":"0","og_image_height":"0","og_image_custom_url":"https:\/\/agilealliance.org\/wp-content\/uploads\/2017\/06\/glossary-featured-banner-social.jpg","og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"summary_large_image","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":"What is \"Given - When - Then\"?","twitter_description":"The Given-When-Then formula is a template intended to guide the writing of acceptance tests for a User Story: (Given) some context, (When) some action is carried out, (Then) a particular set of observable consequences should obtain.","schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"WebPage","isEnabled":true},"graphs":[],"defaultGraph":null,"defaultPostTypeGraph":""},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"},\"blockGraphs\":[]}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-02-02 19:56:16","updated":"2025-06-23 09:22:54","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/agilealliance.org\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/agilealliance.org\/category\/business\/\" title=\"Business\">Business<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGiven \u2013 When \u2013 Then\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/agilealliance.org"},{"label":"Business","link":"https:\/\/agilealliance.org\/category\/business\/"},{"label":"Given &#8211; When &#8211; Then","link":"https:\/\/agilealliance.org\/glossary\/given-when-then\/"}],"_links":{"self":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary\/5003186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary"}],"about":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/types\/aa_glossary"}],"author":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/users\/6000331"}],"replies":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/comments?post=5003186"}],"version-history":[{"count":0,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary\/5003186\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/media\/8067461"}],"wp:attachment":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/media?parent=5003186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/categories?post=5003186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/tags?post=5003186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}