Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today, we will discuss Gherkin language, which is essential for writing acceptance criteria in a clear and manageable format. Can anyone tell me what acceptance criteria are?
Acceptance criteria are the conditions that must be met for a user story to be considered complete.
Exactly! Now, Gherkin aids in outlining these criteria in a structured way. Remember the keywords: Given, When, Then, and And. These help in framing our thoughts clearly.
So, does that mean each user story can have multiple Gherkin scenarios?
Yes! Multiple scenarios can help capture different aspects of a user story. Who can summarize the purpose of the Given, When, and Then keywords?
Given sets up the context, When describes the action, and Then defines the expected outcome.
Great summary! Remember how each keyword plays a role in ensuring clarity in communication among the team and stakeholders.
Let's look at an example of Gherkin syntax related to a password reset feature. Who can read this example for us?
"Feature: Password Reset, Scenario: Successful password reset request, Given the user is on the login page, And the user clicks on 'Forgot Password', When the user submits their registered email address, Then a reset link should be sent to that email, And the link should expire in 24 hours."
Well done! This scenario clearly outlines the process for the user and expectations. Why do we use phrases like 'should be sent' in the Then part?
To show the expected result of the action taken.
Correct! Using clear language helps everyone understand what the feature should deliver. Let's practice writing another scenario together!
Gherkin helps in ensuring that everyone has a shared understanding of the acceptance criteria. Why is this important?
It's important because it minimizes misunderstandings between the development team and stakeholders.
Exactly! And when everyone agrees on the criteria, it streamlines the development process. What happens if we don’t have clear acceptance criteria?
It could lead to misinterpretations of what needs to be developed.
Right! Let's summarize by throwing out a quick definition of Gherkin for our notes.
Gherkin is a structured language for writing acceptance tests in a readable format focused on Given, When, and Then.
Given is the state where you start, When is the action playing its part, Then is the end, a goal you impart.
Imagine a user who wants to reset a password; they log in, click a link, enter their email, and receive a reset link—this sequence illustrates the Gherkin process.
GWT: Get When Then—this reminds you of the three Gherkin components.
GWT stands for Given, When, Then, encapsulating the primary structure of Gherkin.
Term
What does the Given keyword indicate?
Click to flip
Term
What is the function of the Then keyword?
Click to flip
A structured language used in Behavior-Driven Development (BDD) for writing acceptance scenarios in a clear, readable format.
Conditions that must be met for a user story to be considered complete and acceptable.
An Agile software development technique that encourages collaboration among developers, QA, and non-technical or business participants.
The structure used in Gherkin to outline scenarios, where 'Given' provides context, 'When' describes the action, and 'Then' defines the outcome.
Gherkin is a structured language used in Behavior-Driven Development (BDD) to write acceptance criteria for user stories in an easily understandable format.
This section introduces Gherkin language, which helps in defining acceptance criteria using a Given–When–Then format. It emphasizes the importance of clear, readable criteria for successful acceptance testing and project communication.
Gherkin is a domain-specific language designed for Behavior-Driven Development (BDD) to write acceptance tests in a structured format. It follows a simple syntax that consists of keywords such as Given, When, Then, and And, which lay out scenarios regarding how the end user will interact with a feature.
Feature: Password Reset
Scenario: Successful password reset request
Given the user is on the login page
And the user clicks on "Forgot Password"
When the user submits their registered email address
Then a reset link should be sent to that email
And the link should expire in 24 hours
This structured approach improves the clarity of acceptance criteria, aids communication among stakeholders, and ensures that every user story can be effectively validated against these criteria, promoting alignment between business needs and development output.