Agile Glossary

Given – When – Then

What is Given – When – Then?

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

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 be complete without errors or warnings

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.

Thank you to our Annual Partners​

Join us today!

Agile Alliance offers many online and in-person events and workshops for our members. If you’re not currently a member, you can join now to take advantage of our many members-only resources and programs.

Get the latest Agile news!

  • This field is for validation purposes and should be left unchanged.

By subscribing, you acknowledge the Agile Alliance Privacy Policy, and agree to receive our emails.

Additional Agile Glossary Terms

The definition of done is an agreed upon list of the activities deemed necessary to get a product increment, usually represented by a user story, to a done state by the end of a sprint.
A technique to scale Scrum up to large groups (over a dozen people), consisting of dividing the groups into Agile teams of 5-10.
A Minimum Viable Product is the "version of a new product which allows a team to collect the maximum amount of validated learning about customers with the least effort."
Velocity is the total effort estimates associated with user stories that were completed during an iteration.
Sprint planning is an event that occurs at the beginning of a sprint where the team determines the product backlog items they will work on during that sprint and discusses their initial plan for completing those product backlog items.
The "role-feature-reason" template is one of the most commonly recommended aids to write user stories: As a ... I want ... So that ...

Help us keep the definitions updated

Ready to join Agile Alliance?

Unlock members-only access to online learning sessions, Agile resources, annual conference discounts, and more! And when you join, you’ll be supporting our member initiatives, regional events, and global community groups.

Privacy Preference Center

IMPORTANT: We have transitioned to a new membership platform. If you have not already done so, you will need to SET UP AN ACCOUNT on the new platform to establish your user profile. Your previous login credentials will not work until you do this set up.

When you see the login screen, choose “Set up Account” and follow the prompts to create your new account. You can choose to log in using your social credentials for either Google or Linkedin (recommended), or you can set up your account using an email address.