Behaviour-driven development
Behaviour-driven development: three amigos workshop, example mapping, Gherkin scenarios tied to code by step definitions (Cucumber), declarative style and living documentation.
- 25 cards
- 4 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Scenarios
A few cards from the deck
Behaviour-driven development: what is it?
Show the answer
A method where business, development and testing describe the expected behaviour together through concrete examples, which become automated tests.
The starting point is the conversation, not the tool: examples are first a shared language, only then executable code.
A four-step scenario is run and the second step fails. What is the state of steps 1 to 4 in the report?
- Passed, failed, skipped, skipped
- Passed, failed, failed, failed
- Passed, failed, passed, passed
- Failed, failed, failed, failed
Show the answer
Passed, failed, skipped, skipped
After a failure, Cucumber no longer runs the scenario's following steps: it marks them skipped. They are neither passed nor failed.
The three amigos workshop brings together three viewpoints: …, … and ….
Show the answer
The three amigos workshop brings together three viewpoints: business, development and testing.
Business says what it wants, the developer what is feasible, the tester what can go wrong. Misunderstandings surface before the code.
Gherkin: what is it?
Show the answer
A near-natural language for writing scenarios with the keywords Given, When and Then.
A scenario describes a context, an action, an expected outcome. Non-programmers can read and validate it.
A scenario contains "When I enter 80 in field 2" and "And I click the green button". What is wrong with this wording?
- It chains two steps with And instead of repeating When
- It is not written in English
- It describes actions on the screen rather than the intent
- It gives a concrete number instead of a general example
Show the answer
It describes actions on the screen rather than the intent
This is imperative style, which breaks with the slightest screen change. It would be rewritten "When I withdraw €80": the exact gesture goes in the step definition. And normally extends the previous step, and concrete numbers are intended: they are the examples.