Gherkin is one of the most popular languages for writing formal behavior specifications – it captures behaviors as “Given-When-Then” scenarios.
With the help of automation tools, scenarios can easily be turned into automated test cases.
Quick Points
BDD is specification by example.
When someone says “BDD”, immediately think of “Given-When-Then”.
BDD focuses on behavior first.
Behavior scenarios are the cornerstone of BDD.
BDD is a refinement of the Agile process, not an overhaul.
It formalizes acceptance criteria and test coverage.
BDD is a paradigm shift.
Behaviors become the team’s main focus.
12 Awesome Benefits
Inclusion
Clarity
Streamlining
Artifacts
Shift-Left
Automation
Test-Driven
Code Reuse
Parameterization
Variation
Momentum
Adaptability
behavior-driven development
Testing Recommendations
Since BDD focuses on actual feature behavior, behavior specs are best for higher-level, functional, black box tests. For example, BDD is great for testing APIs and web UIs.
Gherkin excels for acceptance testing
However, behavior specs would be overkill for unit tests, and it is also not a good choice for performance tests
to support the ability for systems to change, we should be able to safely make big changes (supported by automated scenarios), as well as the small ones (supported by automated object specifications).
business goal, one or more actors, one or more impacts and one or more ways to support or prevent these impacts
You always start with the business goal; it is your map’s root node. You then grow the map out from the goal by first identifying all the actors (e.g. the customer or the team) that could help or prevent the project from achieving the goal. Each actor could have multiple ways to help or hinder achieving the goal, we call these impacts.
The last layer of an impact map defines what the project or delivery team can do in order to support or prevent particular impacts from happening, and this is the layer where your software options come into play.
In BDD we use Cynefin to identify which features require the most attention
Value and complexity analysis
reuse
outsource
Cynefin to make strategic planning decisions based on value/complexity analysis
Planning in examples
Usage-centered design
Ubiquitous language
eliminate the cost of translation
borrowed from DDD (Domain Driven Design)
'Given, describes the initial context for the example'When' describes the action that the actor in the system or stakeholder performs'Then' describes the expected outcome of that action
Introducing the three amigos
no single person has the full answer to the problem