SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVMAlan Parkinson
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentationAkhila B
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
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
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
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
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
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
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS appAleks Zinevych
 

Mais procurados (20)

Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
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)
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 
Cucumber presentation
Cucumber presentationCucumber presentation
Cucumber presentation
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
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)
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
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
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Bdd Introduction
Bdd IntroductionBdd Introduction
Bdd Introduction
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
 
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
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 

Semelhante a 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
 

Semelhante a 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 Google
CouchDB GoogleCouchDB Google
CouchDB Google
 
CouchDB - Local Web Platform
CouchDB - Local Web PlatformCouchDB - Local Web Platform
CouchDB - Local Web Platform
 
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
 

Mais 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
 

Mais 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...
 

Último

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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