What is BDD Testing?
BDD is Behavior Driven Development Testing.
It's an Agile way where testers write cases in a simple way for anyone to understand.
Gherkin language is used for BDD to describe scenarios and outcomes using Given, When, and Then statements.
Frameworks
Cucumber is a framework that outlines the scenarios in a feature file, and formulates the tests with Java code in another file.
Advantages to Cucumber
We can use parameterized tests for code reusability using Scenario Outlines and Examples.
Scenario Outline:
Given any day of the week
When it is <time> o'clock
Then I should eat <dish> for <meal>
Examples:
| time | dish | meal |
| 8 AM | pancakes | breakfast |
| 1 PM | sandwich | lunch |
| 6 PM | pasta | dinner |
This allows us to reuse the scenario outline for all of these different cases without having to copy and paste the Scenario, Given, and Then statements.
Top comments (0)