Gherkin Language
Gherkin, often used in BDD, is a simple, domain-specific language for describing business behavior without getting into details of implementation. It provides a uniform pattern for specifying behavior, and its syntax is easily readable and understandable by business stakeholders, analysts, testers and developers. This encourages active stakeholder participation, promotes effective communication and reduces misunderstandings. Each behavior is described by a scenario, structured around a context, an event and an outcome, written in a Given, When, Then and And format. This can then be directly converted into an automated test script. As a result, the gherkin language helps in maintaining active stakeholder engagement and streamlines the delivery of the expected business values.
Exam Guide: Gherkin Language
What is Gherkin Language?
Gherkin is a business readable language that helps stakeholders without technical knowledge understand the software's behavior. It’s commonly used to write acceptance test scenarios and automate testing in Behavior Driven Development (BDD).
Why is it important?
Gherkin Language provides a uniform way of viewing scenarios, making it easier for any stakeholder to understand the software's functionality. It bridges the communication gap between tech and non-tech personnel and maintains living documentation. This makes Gherkin Language essential in an agile environment and systems development.
How it works?
Gherkin uses a set of special keywords to define and connect different parts of a scenario, including Feature, Scenario, Given, When, Then, And, But, etc. It’s usually written on a .feature file and is processed by a tool like Cucumber.
Exam Tips: Answering Questions on Gherkin Language
1. Understand the syntax: Pay close attention to the Gherkin language keywords and their sequence in a scenario.
2. Practice scenario creation: Writing practice scenarios in Gherkin can help you become familiar with the language.
3. Know when to use ‘And’ and 'But': These are mainly used for chaining multiple Given, When, Then steps.
4. Grasp the significance: Understanding the importance of why and how Gherkin language is used can guide you in answering correctly.
5. Understand its role in BDD: Understanding Gherkin’s role in BDD can help differentiate it from other types of testing methods.
PMI-ACP - Behavior Driven Development (BDD) Example Questions
Test your knowledge of Amazon Simple Storage Service (S3)
Question 1
Your team has been engaged in developing a login feature. One of the feature scenarios was written in Gherkin as: 'Given I am on the login page, When I enter valid credentials, Then I would be logged in.' The scenario lacks information around the action of login. What should you do?
Question 2
The Given-When-Then structure is not available in your Gherkin specification language. What should you do?
Question 3
You reviewed a colleague's Gherkin scenario, but it does not follow the Given-When-Then syntax structure. It is written as: 'Given there is a field to enter data, The data is entered, The database is updated with the entered data.' How would you provide feedback?
Go Premium
PMI Agile Certified Practitioner Preparation Package (2024)
- 3432 Superior-grade PMI Agile Certified Practitioner practice questions.
- Accelerated Mastery: Deep dive into critical topics to fast-track your mastery.
- Unlock Effortless PMI-ACP preparation: 5 full exams.
- 100% Satisfaction Guaranteed: Full refund with no questions if unsatisfied.
- Bonus: If you upgrade now you get upgraded access to all courses
- Risk-Free Decision: Start with a 7-day free trial - get premium features at no cost!