Definition

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

Learn Agile principles and techniques for beginners

 

An example:

  • Given my bank account is in credit, and I made no withdrawals recently,
  • When I attempt to withdraw an amount less than my card’s limit,
  • Then the withdrawal should complete without errors or warnings

Tools such as JBehave, RSpec or Cucumber encourage use of this template, though it can also be used purely as a heuristic irrespective of any tool.

  • Join Agile Alliance and Support Our Mission

  • Agile2023 Registration

  • Agile MiniCon Basics

  • Game On – Applied Learning with Agile Games

Agile Alliance Resources

Help Us Keep Definitions Updated

Let us know if we need to revise this Glossary Term.