This document discusses SpecFlow and behavior-driven development (BDD). It defines BDD and explains that it is based on test-driven development (TDD) with a focus on collaborating with business stakeholders. SpecFlow is introduced as a tool for BDD using C# and the Gherkin language to describe features and scenarios in a human-readable format. Templates are provided to demonstrate how scenarios can be defined using SpecFlow.
4.
BDD IS A SECOND-GENERATION, OUTSIDEIN, PULL-
BASED, MULTIPLE-STAKEHOLDER, MULTIPLE-SCALE,
HIGH-AUTOMATION, AGILE METHODOLOGY. IT
DESCRIBES A CYCLE OF INTERACTIONS WITH WELL-
DEFINED OUTPUTS, RESULTING IN THE DELIVERY OF
WORKING, TESTED SOFTWARE THAT MATTERS.
Dan North
5. BEHAVIOR-DRIVEN DEVELOPMENT
- Based on TDD approach
- Driven by business value
- Collaborate technical and non-technical
stakeholders
- Acceptance criteria and users tory defined in
natural language in feature file
Business
Domain
driven
design
Technology
Test driven
development
8. WHY ?
Reusable
Regex based
Human Language support
Cross-framework
Describe behavior in understandable way
9. GHERKIN LANGUAGE
As a [X]
I want [Y]
so that [Z]
Given some initial context (the givens),
When an event occurs,
then ensure some outcomes.
10. TEMPLATES
Scenario: Google.Failed Registration first users
Given the browser with 'https://accounts.google.com/SignUp'
is started
When the element 'Name', 'LastName', 'Login' is filled
| Name | LastName | Login |
| Oleg1 | Z1 | Oleg1Z1 |
When the element 'SignUpSubmitButton' is clicked
Then the element 'SignUpPasswordValidationError' is present
Scenario: Google.Failed Registration second users
Given the browser with 'https://accounts.google.com/SignUp'
is started
When the element 'Name', 'LastName', 'Login' is filled
| Name | LastName | Login |
| Oleg1 | Z1 | Oleg1Z1 |
When the element 'SignUpSubmitButton' is clicked
Then the element 'SignUpPasswordValidationError' is present
Scenario Outline: Google search2x
Given the browser with
'https://accounts.google.com/SignUp' is started
When the element <Name>, <LastName>, <Login> is filled
When the element 'SignUpSubmitButton' is clicked
Then the element 'SignUpPasswordValidationError' is present
Examples:
| Name | LastName | Login |
| Oleg1 | Z1 | Oleg1Z1 |
| Oleg2 | Z2 | Oleg2Z2 |
Editor's Notes
Y is some feature,
Z is the benefit or value of the feature,
X is the person (or role) who will benefit