SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
Seb  Rose  
seb@cucumber.io
@sebrose                                                                                                                                                                                                                                                                                                                                                                h0p://cucumber.io
An  Introduc9on  to    
Behaviour  Driven  Development  
with  
Cucumber  for  Java
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Agenda
-­‐ What  is  BDD?  
-­‐ What  is  Cucumber?  
-­‐ Demo  Cucumber  for  Java  
-­‐ Cucumber  variants  
-­‐ Pu@ng  it  all  together
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
What  is  BDD?
Behaviour Driven DevelopmentDesign
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
BDD   is   a   second-­‐generaBon,   outside-­‐in,   pull-­‐based,  
mulBple-­‐stakeholder,   mulBple-­‐scale,   high-­‐automaBon,  
agile  methodology.    
It   describes   a   cycle   of   interacBons   with   well-­‐defined  
outputs,   resulBng   in   the   delivery   of   working,   tested  
soJware  that  ma)ers.  
Dan  North
h)p://skillsma)er.com/podcast/java-­‐jee/how-­‐to-­‐sell-­‐bdd-­‐to-­‐the-­‐business
BDD  defined
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
The  power  of  “should”
-­‐Diverts  developers  from  their  distaste  for  tesBng  
-­‐Encourages  people  to  ask  “Should  it  really?”
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Deliberate  discovery
“…  during  an  incepBon,  when  we  are  most  
ignorant  about  most  aspects  of  the  project,  
the  best  use  we  can  possibly  make  of  the  Bme  
available  is  to  a)empt  to  idenBfy  and  reduce  
our  ignorance  …”  
Dan  North
h)p://dannorth.net/2010/08/30/introducing-­‐deliberate-­‐discovery/
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Ubiquitous  language
“The  pracBce  of  building  
up  a  common,  rigorous  
language  between  
developers  and  users”  
MarBn  Fowler
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
The  3  Amigos
The one where...
User  stories  &  
acceptance  
criteria
Examples
Open  
quesBons
Domain  
learning
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Example  mapping
Acceptance
Criterion
(Rule)
User Story
Example
Open
Question
Acceptance
Criterion
(Rule)
Acceptance
Criterion
(Rule)
Example
Example
Example
Example
Example
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Important  conversaBons
having  conversaBons    
is  more  important  than    
capturing  conversaBons    
is  more  important  than    
automa.ng  conversaBons  
Liz  Keogh
h)p://lizkeogh.com/2014/01/22/using-­‐bdd-­‐with-­‐legacy-­‐systems/
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Living  documentaBon
a.k.a  Executable  specificaBon
Living  documentaBon  is  a  reliable  and  
authoritaBve  source  of  informaBon  on  system  
funcBonality,  which  anyone  can  easily  access.    
It  is  as  reliable  as  the  code,  but  much  easier  to  
read  and  understand.  
Gojko  Adzic
h)p://specificaBonbyexample.com/key_ideas.html
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
What  BDD  is  not….
-­‐ Using  “Given/When/Then”  
-­‐ The  responsibility  of  testers  
-­‐ An  alternaBve  to  manual  tesBng
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
What  is  Cucumber?
Features
-Scenarios  
-­‐Steps
-Gherkin
Glue  code
-Step  definiBons
-Ruby  
-Java  
-C#  &  others
ApplicaBon
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: New teams should not have scored yet
Given I register a team
Then my score is 0
Scenario: Correctly answering a question scores points
Given I register a team
When I submit a correct answer
Then my score is 10
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Feature:  Feature  name  
Descrip8on  of  feature  goes  here  
Scenario:  Scenario  name  
Descrip8on  of  scenario  goes  here  
Given  a  certain  context  
When  something  happens  
Then  an  outcome  
And  something  else  
But  not  this  though  
Scenario:  Another  scenario  name  
...
Gherkin  fundamentals
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Given(/^I register a team$/) do
# Glue code goes here
end
Ruby
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
import cucumber.api.java.en.*;
public class MyStepDefinitions {
@Given("^I register a team$")
public void iRegisterATeam() throws Throwable {
// Glue code goes here
}
}
Java
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Cucumber  variants
• Ruby  
• C#  (Specflow)  
• Java  (&  other  JVM  languages)  
• Javascript  
• PHP  
• Python  
• C++
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Given/When/Then  namespaces
Global  namespace    
-­‐  Given/When/Then  interchangeable
Separate  namespaces    
-­‐  Given/When/Then  disBnct  
-­‐  And/But  bind  to  preceding  namespace  
-­‐  [StepDefiniBon]  for  compaBbility
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Binding  &  test  frameworks
Behind  the  scenes  
-­‐  may  need  to  specify  paths  
-­‐  select  required  plugin(s)
Some  magic  code  generaBon  
-­‐  NUnit  by  default  
-­‐  configuraBon  changes  for  others  
-­‐  several  output  opBons
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Sharing  data  between  steps
Varies  by  implementaBon  
-­‐  Ruby,  Javascript:  World  object  
-­‐  Java:  Dependency  InjecBon
Context  object(s)  
-­‐  Injected  
-­‐  Scenario  
-­‐  Feature
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Hooks
Before  &  AJer  
Ruby:  Around,  AJerStep
Before  &  AJer  
BeforeStep  &  AJerStep  
BeforeFeature  &  AJerFeature  
BeforeTestRun  &  AJerTestRun  
BeforeScenarioBlock  &  
AJerScenarioBlock
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Pu@ng  it  all  together
SoJware  development  is  hard.  
Understanding  what  your    
methods  and  tools    
are  good  for  
can  make  it  easier.
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Tools  are  not  essenBal
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
BDD   is   a   second-­‐generaBon,   outside-­‐in,   pull-­‐based,  
mulBple-­‐stakeholder,   mulBple-­‐scale,   high-­‐automaBon,  
agile  methodology.    
It   describes   a   cycle   of   interacBons   with   well-­‐defined  
outputs,   resulBng   in   the   delivery   of   working,   tested  
soJware  that  ma)ers.  
Dan  North
h)p://skillsma)er.com/podcast/java-­‐jee/how-­‐to-­‐sell-­‐bdd-­‐to-­‐the-­‐business
BDD  redefined
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
h)ps://cucumber.pro/blog/2014/03/03/the-­‐worlds-­‐most-­‐misunderstood-­‐collaboraBon-­‐tool.html
When  you  do  BDD/SpecificaBon  by  Example  and  Outside-­‐in,  
regression   tests   fall   out   at   the   other   end.   They   are   a   by-­‐
product  of  those  acBviBes.  TesBng  isn't  the  acBvity  itself.  
Cucumber  is  first  a  foremost  a  collaboraBon  tool  that  aims  to  
bring   a   common   understanding   to   soJware   teams   -­‐   across  
roles.  
Aslak  Hellesøy
It’s  about  collaboraBon
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
We  sBll  need  testers
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
h)p://claysnow.co.uk/architectural-­‐alignment-­‐and-­‐test-­‐induced-­‐design-­‐damage-­‐fallacy/
Test  =  check  +  explore
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
So  much  can  go  wrong!
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
h)p://1.bp.blogspot.com/_YzKCMr-­‐tcMM/TFLIGeqTJfI/AAAAAAAAARQ/AhNW62KX5EA/s1600/cartoon6.jpg
AutomaBon  is  development
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Understand  designs
Features
-Scenarios  
-­‐Steps
-Gherkin
Glue  code
-Step  definiBons
-Ruby  
-Java  
-C#  &  others ApplicaBon
Support  
code
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
This  page  intenBonally  blank.
<role>  will  write  scenarios
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
More  does  not  mean  be)er
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
“I  get  paid  for  code  that  works,  not  for  tests,  so  my  philosophy  is  
to  test  as  li)le  as  possible  to  reach  a  given  level  of  confidence  ...
“I  suspect  this  level  of  confidence  is  high  compared  to  industry  
standards”
h)p://stackoverflow.com/quesBons/153234/how-­‐deep-­‐are-­‐your-­‐unit-­‐tests/153565#153565
Kent  Beck
It’s  about  confidence
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
How  many  guy  ropes?
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Clarity  over  detail
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
ImperaBve DeclaraBve
Avoid  incidental  details
Keep  it  focussed
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
TDD,  ATDD,  BDD,  SBE  …
h)p://lizkeogh.com/2011/06/27/atdd-­‐vs-­‐bdd-­‐and-­‐a-­‐po)ed-­‐history-­‐of-­‐some-­‐related-­‐stuff/
What’s  the  
difference  
between  TDD,  
ATDD,  BDD  
and  SbE?
They’re  
called  
different  
things
The  best  TDD  pracBBoners...
• Work  from  the  outside-­‐in,  i.e.  test-­‐first  
• Use  examples  to  clarify  their  requirements  
• Develop  and  use  a  ubiquitous  language
The  best  BDD  pracBBoners...
• Focus  on  value  
• Discover  examples  collabora7vely  
• Create  living  documenta7on
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
JUnit  or  Cucumber?
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
Take  aways
• BDD  is  about  collaboraBon  
• You  need  a  ubiquitous  language  
• Cucumber  can  power  conversaBon  
• and  produce  living  documentaBon  
• but  it’s  no  subsBtute  for  tesBng!
Seb  Rose  


Twi)er:     @sebrose  
Blog:        www.claysnow.co.uk  
E-­‐mail:     seb@cucumber.io
QuesBons?
Discount code at
pragprog.com
Java_One_25%_Off_Cuke
Valid for 1 month
@sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
h)ps://cemarking.net/wp-­‐content/uploads/2014/01/User-­‐Manual_featured.jpg
DocumentaBon
Acceptance
criteria
User Story
Examples
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
Step outcome
!Passed
" No exception thrown
!Pending
" Pending exception thrown
!Undefined
" No matching step definition found
!Failed
" Any other exception thrown
!Skipped
" Steps that follow a Pending, Undefined or Failed step
!Duplicate
" Step matches more than one step definition
@sebrose http://claysnow.co.uk
Scenario outcome
!Passed
" All steps passed
!Failed
" Any step failed
!Undefined
" No failed steps
" At least one undefined step
!Pending
" No failed or undefined steps
" At least one pending step
@sebrose http://claysnow.co.uk

Contenu connexe

Tendances

Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Mindfire Solutions
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVMAlan Parkinson
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)Suman Guha
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentationAkhila B
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...KMS Technology
 
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaIntroduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaJawad Khan
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)Peter Thomas
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Indonesia
 

Tendances (20)

Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentation
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
 
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaIntroduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
 

Similaire à Introduction to BDD with Cucumber for Java

#NoEstimates does not mean "No estimates!" - Agile Cambridge 2015
#NoEstimates does not mean "No estimates!"  - Agile Cambridge 2015#NoEstimates does not mean "No estimates!"  - Agile Cambridge 2015
#NoEstimates does not mean "No estimates!" - Agile Cambridge 2015Seb Rose
 
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 201610 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 2016Seb Rose
 
CouchDB - Local Web Platform
CouchDB - Local Web PlatformCouchDB - Local Web Platform
CouchDB - Local Web PlatformChris Anderson
 
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)Darshan Karandikar
 
Open innovation in software means Open Source (2011 remix)
Open innovation in software means Open Source (2011 remix)Open innovation in software means Open Source (2011 remix)
Open innovation in software means Open Source (2011 remix)Bertrand Delacretaz
 
Evaluating Methods to Rediscover Missing Web Pages from the Web Infrastructure
Evaluating Methods to Rediscover Missing Web Pages from the Web InfrastructureEvaluating Methods to Rediscover Missing Web Pages from the Web Infrastructure
Evaluating Methods to Rediscover Missing Web Pages from the Web InfrastructureMartin Klein
 
JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudHiro Asari
 
What I Learned at Open Hack Naperville
What I Learned at Open Hack NapervilleWhat I Learned at Open Hack Naperville
What I Learned at Open Hack NapervilleKevin Davis
 
Real world continuous delivery
Real world continuous deliveryReal world continuous delivery
Real world continuous deliverySeb Rose
 
Hybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkHybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkBramus Van Damme
 
Building collaborative workflows for scientific data
Building collaborative workflows for scientific dataBuilding collaborative workflows for scientific data
Building collaborative workflows for scientific dataBruno Vieira
 
What would your own version of Ruby look like?
What would your own version of Ruby look like?What would your own version of Ruby look like?
What would your own version of Ruby look like?Hung Wu Lo
 
Collaborations in the Extreme: 
The rise of open code development in the scie...
Collaborations in the Extreme: 
The rise of open code development in the scie...Collaborations in the Extreme: 
The rise of open code development in the scie...
Collaborations in the Extreme: 
The rise of open code development in the scie...Kelle Cruz
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesEric Bottard
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupKirill Zonov
 

Similaire à Introduction to BDD with Cucumber for Java (20)

#NoEstimates does not mean "No estimates!" - Agile Cambridge 2015
#NoEstimates does not mean "No estimates!"  - Agile Cambridge 2015#NoEstimates does not mean "No estimates!"  - Agile Cambridge 2015
#NoEstimates does not mean "No estimates!" - Agile Cambridge 2015
 
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 201610 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
 
CouchDB - Local Web Platform
CouchDB - Local Web PlatformCouchDB - Local Web Platform
CouchDB - Local Web Platform
 
CouchDB Google
CouchDB GoogleCouchDB Google
CouchDB Google
 
Ruboto
RubotoRuboto
Ruboto
 
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)
 
Open innovation in software means Open Source (2011 remix)
Open innovation in software means Open Source (2011 remix)Open innovation in software means Open Source (2011 remix)
Open innovation in software means Open Source (2011 remix)
 
Evaluating Methods to Rediscover Missing Web Pages from the Web Infrastructure
Evaluating Methods to Rediscover Missing Web Pages from the Web InfrastructureEvaluating Methods to Rediscover Missing Web Pages from the Web Infrastructure
Evaluating Methods to Rediscover Missing Web Pages from the Web Infrastructure
 
JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the Cloud
 
Practice of Android Reverse Engineering
Practice of Android Reverse EngineeringPractice of Android Reverse Engineering
Practice of Android Reverse Engineering
 
What I Learned at Open Hack Naperville
What I Learned at Open Hack NapervilleWhat I Learned at Open Hack Naperville
What I Learned at Open Hack Naperville
 
Real world continuous delivery
Real world continuous deliveryReal world continuous delivery
Real world continuous delivery
 
Hybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkHybrid Apps with Ionic Framework
Hybrid Apps with Ionic Framework
 
儲かるドキュメント
儲かるドキュメント儲かるドキュメント
儲かるドキュメント
 
Building collaborative workflows for scientific data
Building collaborative workflows for scientific dataBuilding collaborative workflows for scientific data
Building collaborative workflows for scientific data
 
What would your own version of Ruby look like?
What would your own version of Ruby look like?What would your own version of Ruby look like?
What would your own version of Ruby look like?
 
Collaborations in the Extreme: 
The rise of open code development in the scie...
Collaborations in the Extreme: 
The rise of open code development in the scie...Collaborations in the Extreme: 
The rise of open code development in the scie...
Collaborations in the Extreme: 
The rise of open code development in the scie...
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
 

Plus de Seb Rose

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSeb Rose
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsSeb Rose
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfSeb Rose
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfSeb Rose
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfSeb Rose
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Seb Rose
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021Seb Rose
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022Seb Rose
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022Seb Rose
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021Seb Rose
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021Seb Rose
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Seb Rose
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021Seb Rose
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020Seb Rose
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019Seb Rose
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019Seb Rose
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
 

Plus de Seb Rose (20)

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfalls
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdf
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdf
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 

Dernier

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Dernier (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 

Introduction to BDD with Cucumber for Java

  • 1. Seb  Rose   seb@cucumber.io @sebrose                                                                                                                                                                                                                                                                                                                                                                h0p://cucumber.io An  Introduc9on  to     Behaviour  Driven  Development   with   Cucumber  for  Java
  • 2. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Agenda -­‐ What  is  BDD?   -­‐ What  is  Cucumber?   -­‐ Demo  Cucumber  for  Java   -­‐ Cucumber  variants   -­‐ Pu@ng  it  all  together
  • 3. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io What  is  BDD? Behaviour Driven DevelopmentDesign
  • 4. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io BDD   is   a   second-­‐generaBon,   outside-­‐in,   pull-­‐based,   mulBple-­‐stakeholder,   mulBple-­‐scale,   high-­‐automaBon,   agile  methodology.     It   describes   a   cycle   of   interacBons   with   well-­‐defined   outputs,   resulBng   in   the   delivery   of   working,   tested   soJware  that  ma)ers.   Dan  North h)p://skillsma)er.com/podcast/java-­‐jee/how-­‐to-­‐sell-­‐bdd-­‐to-­‐the-­‐business BDD  defined
  • 5. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io The  power  of  “should” -­‐Diverts  developers  from  their  distaste  for  tesBng   -­‐Encourages  people  to  ask  “Should  it  really?”
  • 6. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Deliberate  discovery “…  during  an  incepBon,  when  we  are  most   ignorant  about  most  aspects  of  the  project,   the  best  use  we  can  possibly  make  of  the  Bme   available  is  to  a)empt  to  idenBfy  and  reduce   our  ignorance  …”   Dan  North h)p://dannorth.net/2010/08/30/introducing-­‐deliberate-­‐discovery/
  • 7. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Ubiquitous  language “The  pracBce  of  building   up  a  common,  rigorous   language  between   developers  and  users”   MarBn  Fowler
  • 8. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io The  3  Amigos The one where... User  stories  &   acceptance   criteria Examples Open   quesBons Domain   learning
  • 9. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Example  mapping Acceptance Criterion (Rule) User Story Example Open Question Acceptance Criterion (Rule) Acceptance Criterion (Rule) Example Example Example Example Example
  • 10. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Important  conversaBons having  conversaBons     is  more  important  than     capturing  conversaBons     is  more  important  than     automa.ng  conversaBons   Liz  Keogh h)p://lizkeogh.com/2014/01/22/using-­‐bdd-­‐with-­‐legacy-­‐systems/
  • 11. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Living  documentaBon a.k.a  Executable  specificaBon Living  documentaBon  is  a  reliable  and   authoritaBve  source  of  informaBon  on  system   funcBonality,  which  anyone  can  easily  access.     It  is  as  reliable  as  the  code,  but  much  easier  to   read  and  understand.   Gojko  Adzic h)p://specificaBonbyexample.com/key_ideas.html
  • 12. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io What  BDD  is  not…. -­‐ Using  “Given/When/Then”   -­‐ The  responsibility  of  testers   -­‐ An  alternaBve  to  manual  tesBng
  • 13. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io What  is  Cucumber? Features -Scenarios   -­‐Steps -Gherkin Glue  code -Step  definiBons -Ruby   -Java   -C#  &  others ApplicaBon
  • 14. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: New teams should not have scored yet Given I register a team Then my score is 0 Scenario: Correctly answering a question scores points Given I register a team When I submit a correct answer Then my score is 10
  • 15. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Feature:  Feature  name   Descrip8on  of  feature  goes  here   Scenario:  Scenario  name   Descrip8on  of  scenario  goes  here   Given  a  certain  context   When  something  happens   Then  an  outcome   And  something  else   But  not  this  though   Scenario:  Another  scenario  name   ... Gherkin  fundamentals
  • 16. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Given(/^I register a team$/) do # Glue code goes here end Ruby
  • 17. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io import cucumber.api.java.en.*; public class MyStepDefinitions { @Given("^I register a team$") public void iRegisterATeam() throws Throwable { // Glue code goes here } } Java
  • 18. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io
  • 19. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Cucumber  variants • Ruby   • C#  (Specflow)   • Java  (&  other  JVM  languages)   • Javascript   • PHP   • Python   • C++
  • 20. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Given/When/Then  namespaces Global  namespace     -­‐  Given/When/Then  interchangeable Separate  namespaces     -­‐  Given/When/Then  disBnct   -­‐  And/But  bind  to  preceding  namespace   -­‐  [StepDefiniBon]  for  compaBbility
  • 21. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Binding  &  test  frameworks Behind  the  scenes   -­‐  may  need  to  specify  paths   -­‐  select  required  plugin(s) Some  magic  code  generaBon   -­‐  NUnit  by  default   -­‐  configuraBon  changes  for  others   -­‐  several  output  opBons
  • 22. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Sharing  data  between  steps Varies  by  implementaBon   -­‐  Ruby,  Javascript:  World  object   -­‐  Java:  Dependency  InjecBon Context  object(s)   -­‐  Injected   -­‐  Scenario   -­‐  Feature
  • 23. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Hooks Before  &  AJer   Ruby:  Around,  AJerStep Before  &  AJer   BeforeStep  &  AJerStep   BeforeFeature  &  AJerFeature   BeforeTestRun  &  AJerTestRun   BeforeScenarioBlock  &   AJerScenarioBlock
  • 24. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Pu@ng  it  all  together SoJware  development  is  hard.   Understanding  what  your     methods  and  tools     are  good  for   can  make  it  easier.
  • 25. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Tools  are  not  essenBal
  • 26. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io BDD   is   a   second-­‐generaBon,   outside-­‐in,   pull-­‐based,   mulBple-­‐stakeholder,   mulBple-­‐scale,   high-­‐automaBon,   agile  methodology.     It   describes   a   cycle   of   interacBons   with   well-­‐defined   outputs,   resulBng   in   the   delivery   of   working,   tested   soJware  that  ma)ers.   Dan  North h)p://skillsma)er.com/podcast/java-­‐jee/how-­‐to-­‐sell-­‐bdd-­‐to-­‐the-­‐business BDD  redefined
  • 27. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io h)ps://cucumber.pro/blog/2014/03/03/the-­‐worlds-­‐most-­‐misunderstood-­‐collaboraBon-­‐tool.html When  you  do  BDD/SpecificaBon  by  Example  and  Outside-­‐in,   regression   tests   fall   out   at   the   other   end.   They   are   a   by-­‐ product  of  those  acBviBes.  TesBng  isn't  the  acBvity  itself.   Cucumber  is  first  a  foremost  a  collaboraBon  tool  that  aims  to   bring   a   common   understanding   to   soJware   teams   -­‐   across   roles.   Aslak  Hellesøy It’s  about  collaboraBon
  • 28. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io We  sBll  need  testers
  • 29. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io h)p://claysnow.co.uk/architectural-­‐alignment-­‐and-­‐test-­‐induced-­‐design-­‐damage-­‐fallacy/ Test  =  check  +  explore
  • 30. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io So  much  can  go  wrong!
  • 31. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io h)p://1.bp.blogspot.com/_YzKCMr-­‐tcMM/TFLIGeqTJfI/AAAAAAAAARQ/AhNW62KX5EA/s1600/cartoon6.jpg AutomaBon  is  development
  • 32. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Understand  designs Features -Scenarios   -­‐Steps -Gherkin Glue  code -Step  definiBons -Ruby   -Java   -C#  &  others ApplicaBon Support   code
  • 33. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io This  page  intenBonally  blank. <role>  will  write  scenarios
  • 34. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io More  does  not  mean  be)er
  • 35. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io “I  get  paid  for  code  that  works,  not  for  tests,  so  my  philosophy  is   to  test  as  li)le  as  possible  to  reach  a  given  level  of  confidence  ... “I  suspect  this  level  of  confidence  is  high  compared  to  industry   standards” h)p://stackoverflow.com/quesBons/153234/how-­‐deep-­‐are-­‐your-­‐unit-­‐tests/153565#153565 Kent  Beck It’s  about  confidence
  • 36. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io How  many  guy  ropes?
  • 37. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Clarity  over  detail
  • 38. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io ImperaBve DeclaraBve Avoid  incidental  details Keep  it  focussed
  • 39. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io TDD,  ATDD,  BDD,  SBE  …
  • 41. The  best  TDD  pracBBoners... • Work  from  the  outside-­‐in,  i.e.  test-­‐first   • Use  examples  to  clarify  their  requirements   • Develop  and  use  a  ubiquitous  language
  • 42. The  best  BDD  pracBBoners... • Focus  on  value   • Discover  examples  collabora7vely   • Create  living  documenta7on
  • 43. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io JUnit  or  Cucumber?
  • 44. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io Take  aways • BDD  is  about  collaboraBon   • You  need  a  ubiquitous  language   • Cucumber  can  power  conversaBon   • and  produce  living  documentaBon   • but  it’s  no  subsBtute  for  tesBng!
  • 45. Seb  Rose   
 Twi)er:     @sebrose   Blog:       www.claysnow.co.uk   E-­‐mail:     seb@cucumber.io QuesBons? Discount code at pragprog.com Java_One_25%_Off_Cuke Valid for 1 month
  • 46. @sebrose                                                                                                                                                                                                                                                                                                                                                                h)p://cucumber.io h)ps://cemarking.net/wp-­‐content/uploads/2014/01/User-­‐Manual_featured.jpg DocumentaBon
  • 47. Acceptance criteria User Story Examples Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50
  • 48. Step outcome !Passed " No exception thrown !Pending " Pending exception thrown !Undefined " No matching step definition found !Failed " Any other exception thrown !Skipped " Steps that follow a Pending, Undefined or Failed step !Duplicate " Step matches more than one step definition @sebrose http://claysnow.co.uk
  • 49. Scenario outcome !Passed " All steps passed !Failed " Any step failed !Undefined " No failed steps " At least one undefined step !Pending " No failed or undefined steps " At least one pending step @sebrose http://claysnow.co.uk