Given – When – Then
- (Given) some context
- (When) some action is carried out
- (Then) a particular set of observable consequences should obtain
- 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.