Concept: Given-When-Then
Question
In BDD, the 'Given' clause describes:
Hint
Given = starting state, When = action, Then = result.
Explanation
In BDD's Given-When-Then structure, 'Given' describes the initial context or preconditions (the starting state of the system). 'When' describes the action or event that occurs. 'Then' describes the expected outcome or result. For example: 'Given a user is logged in, When they click logout, Then they should see the login page.'
Related Resources
Related Lessons
- BDD
Behavior-driven development.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.