
The Crux of BDD is... Gherkin!
Tests for the Whole Team!
Feature: Some terse yet descriptive text of what is desired In order to realize a named business value As an explicit system actor I want to gain some beneficial outcome which furthers the goal Scenario: Some determinable business situation Given some precondition And some other precondition When some action by the actor And some other action And yet another action Then some testable outcome is achieved And something else we can check happens too Scenario: A different situation ...
Single Source of Truth
Living Documentation
A Focus on Business Value
Given..., When..., Then... Structure
Scenario: wrote my first scenario Given a variable set to 1 ....
this.Given(/^a variable set to (\d+)$/, function(number, next) { this.givenNumber = parseInt(number); next(); });
Now hopefully you can see how we can have these very high level, easy to understand Gherkin tests while still allowing them to get deep into the nitty gritty parts of the code and truly test the codebase the way unit testing always has. I think most unit tests already follow the given, when, then pattern in some form. They don't explicitly use those words, and they are usually all thrown into a single method, but it shouldn't be too difficult to see how your unit tests can fit into this pattern.