bdd crash course for testers (qa fest kiev, 31/10/2015)
TRANSCRIPT
BDD Crash Course for Testers
Gaspar Nagycoach • trainer • bdd addict • creator of specflow
@gasparnagy • [email protected]
QA Fest Kiev • 31/10/2015
Copyright © Gaspar Nagy
What is BDD?
Copyright © Gaspar Nagy
BDD?
BDD is a second-generation,
outside-in, 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, Agile Testing, Specifications and BDD Exchange 2009
Copyright © Gaspar Nagy
BDDBehavior Driven
Development
TDDTest Driven
Development
DDDDomain Driven Design
ATDDAcceptance Test
Driven Development
User Stories
Specification
by Example
Definition of
Done
Outside-In
Development
DSLDomain Specific
Language
Copyright © Gaspar Nagy
FEAR
My Story
Agile
Engineering(XP, TDD,
pairing)
Agile
Project
Mgmt.(Scrum, Kanban)
Agile
Requirement
Analysis(User Story,
Acceptance
Criteria)
Agile
Testing(bug prevention,
exploratory
testing, context-
driven)
Bug Hunting → Bug Prevention
Copyright © Gaspar Nagy
Requirements vs. Tests
As formality increases, tests and
requirements become indistinguishable.
At the limit, tests and requirements are
equivalent.
Equivalence Hypothesis (Martin, Melnik)
Pic: Martin/Melnik: Requirements and Tests
Copyright © Gaspar Nagy
Specification-By-Example
Example Tests
Specifications
consist of
describe validate fulfillment
Source: Gojko Adzic – Bridging the Communication Gap
My Story
Agile
Engineering(XP, TDD,
pairing)
Agile
Project
Mgmt.(Scrum, Kanban)
Agile
Requirement
Analysis(User Story,
Acceptance
Criteria)
Agile
Testing(bug prevention,
exploratory
testing, context-
driven)
BDD
Copyright © Gaspar Nagy
BDD
BDD =
Product Ownership +
Collaboration +
Automationon the product
of requirements
real
Team Foundation Server Version Control
TeamFoundation Server Workitems
SpecLog
Story Maps
Product Backlog
SprintBacklog
Task Board
SpecFlow ScenariosTest-auto-mation
Product
LivingDocumen-
tation
Our Process
Source: TechTalk (www.techtalk.at)
Planning a story with acceptance
criteria
“Imagine this story is
already implemented:
How would you verify
it?”
“I would try to put a book
into the shopping cart …”
“I would try to remove a
book from the shopping
cart…”
“I’d check whether the shopping
cart is empty, when I enter the
shop …”
Shopping cart should be
empty when entering the
shop
Source: TechTalk (www.techtalk.at)
Gherkin Scenarios
Scenario: Books can be added to the shopping basket
Given the following books
|Author |Title |
|Martin Fowler |Analysis Patterns |
|Gojko Adzic |Bridging the Communication Gap |
And my shopping basket is empty
When I add the book “Analysis Patterns” to my shopping basket
Then my shopping basket should contain 1 copy of “Analysis Patterns”
Copyright © Gaspar Nagy
DEMOSpecFlow in
Action
Copyright © Gaspar Nagy
Test automation is hard
Approach and Landing Tests
Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
An example of using stubs…
Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
Copyright © Gaspar Nagy
Test-first thinking in designing
complex applications helps a lot for
test automation efficiency
Copyright © Gaspar Nagy
Test-first is hard
• When we exploring new areas/technologies
• When we need to work with legacy systems
• When …
But this should not be an excuse but a source of
inspiration!
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
SpecFlow
Course
Kiev
9-11 November
Thank you!
See you at on scrummaster.com.ua's booth!
Gaspar Nagycoach • trainer • bdd addict • creator of specflow
@gasparnagy • [email protected]