the fastest bdd crash-course ever
TRANSCRIPT
@gil_zilberfeld
Hello!
I AM GIL ZILBERFELD
www.gilzilberfeld.com
www.everydayunittesting.com
@gil_zilberfeld
@gil_zilberfeld
BDD“Combines the general techniques and
principles of TDD with ideas from
DDD and OOAD to provide software
development and management teams with
shared tools and a shared process to
collaborate on software development..”
@gil_zilberfeld
A story
◉ Who – Stakeholder
◉ Why – Goals
◉ What - Capabilities
◉ How - Implementation
@gil_zilberfeld
Stakeholder“An individual, group, or
organization, who may affect, be
affected by, or perceive itself to be
affected by a decision, activity, or
outcome of a project.”
@gil_zilberfeld
Categorizing stakeholders
◉ Roles
◉ Jobs to be done (JTBD)
◉ What’s important for them?
◉ How does the product impact their lives?
@gil_zilberfeld
Testicorn – A killer app
The ghost of the
testing unicorn
that terrorizes the
city of Stockholm
@gil_zilberfeld
Goal“A goal is a desired result that a person or a system envisions, plans and commits to achieve.”
@gil_zilberfeld
Capability“An ability to perform or achieve certain actions or outcomes through a set of controllable and measurable faculties, features, functions, processes, or services.”
@gil_zilberfeld
Exercise: Stakeholders goals and capabilities
◉ What is important to our stakeholders?
◉ What do they want to achieve?
◉ What options do we have to meet the goals?
◉ Prioritize them
@gil_zilberfeld
Exercise: Stakeholder’s risks
◉ What can go wrong?
◉ What happens when things go wrong?
◉ Think about how risks relate to capabilities
◉ Prioritize them
@gil_zilberfeld
Questions about stories
◉ Are the stories ready for work?
◉ Do they fit in a sprint?
◉ How complex are they?
◉ What will we learn?
◉ What options do we have for implementation?
◉ Do we need to do a POC?
◉
@gil_zilberfeld
The template
As a killer unicorn
I need to be at least 12 steps
from a victim
In order to kill it
@gil_zilberfeld
Good user stories
Independent
Negotiable
Valuable
Estimable
Small
Testable
Bill Wake, 2003
@gil_zilberfeld
Good user stories
Independent
Negotiable
Valuable
Estimable
Small
Testable
Bill Wake, 2003
@gil_zilberfeld
Exercise
◉ Write stories for the capabilities and risks
◉ Remember who the stake holder is
@gil_zilberfeld
The scenario
Given the Testicorn is 12 steps
from the victim
When it tries to kill the victim
Then it succeeds
@gil_zilberfeld
The other scenario
Given the Testicorn is 50 steps
from the victim
When it tries to kill the victim
Then it fails
@gil_zilberfeld
Setting up Eclipse with Cucumber
◉ “Help”->”Add new software” from: Cucumber.io
◉ Create simple maven project
◉ Add the Cucumber dependencies
◉ Add to src/test/java a new .feature file
◉ Run and copy the generated errors to create
functions
@gil_zilberfeld
Setting up VS with SpecFlow
◉ Add the SpecFlow extenstion
◉ Create a unit test project
◉ Get SpecFlow.MsTest from NuGet
◉ Add New Item -> SpecFlow Feature file
◉ Write scenarios
◉ Right click -> Generate Step Definitions
@gil_zilberfeld
Summary
◉ It’s all about the shared understanding
◉ Shared language between users, product
people, developers and testers
◉ Gherkin tests help when there is code that is not
a shared language
◉ Part of the professional tool belt
@gil_zilberfeld
Thanks!
ANY QUESTIONS?
You can find me at:
@gil_zilberfeld
http://www.GilZilberfeld.com
http://www.EverydayUnitTesting.com