SlideShare a Scribd company logo
1 of 51
Download to read offline
Inside	
  Behavior	
  Driven	
  
Development	
  
Bal$more	
  So+ware	
  Prac$ces	
  and	
  Pa2erns	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  April	
  19,	
  2016	
  
Camille	
  Bell	
  
cbell@CamilleBellConsul$ng.com	
  
Twi2er	
  @agilecamille	
  
ww.slideshare.net/Camille_Bell	
  
Agenda	
  
•  What	
  is	
  BDD?	
  	
  
•  What	
  is	
  its	
  value?	
  
•  BDD	
  and	
  TDD	
  Similari;es	
  and	
  Differences	
  
•  Who	
  par;cipates	
  in	
  BDD?	
  	
  What	
  is	
  the	
  role	
  of	
  the	
  customer/product	
  owner?	
  	
  
•  Three	
  parts	
  of	
  Any	
  Test	
  
•  Use	
  of	
  Business	
  Language	
  in	
  BDD:	
  what	
  is	
  a	
  good	
  BDD	
  test?	
  
•  What	
  about	
  teams	
  that	
  have	
  tradi;onal	
  manual	
  testers?	
  
•  What	
  about	
  teams	
  that	
  have	
  developers	
  but	
  not	
  testers?	
  	
  
•  What	
  should	
  be	
  tested	
  manually?	
  
•  Demo	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  2	
  
BDD/ATDD	
  ==	
  Agile	
  Func;onal	
  Tes;ng	
  
•  Many	
  names	
  for	
  the	
  same	
  thing:	
  
–  Behavior	
  Driven	
  Development	
  (BDD)	
  
–  Acceptance	
  Test	
  Driven	
  Development	
  	
  (ATDD)	
  
–  Story	
  Driven	
  Development	
  	
  
–  Story	
  Tes;ng	
  
–  Specifica;on	
  by	
  Example	
  
•  We'll	
  call	
  it	
  Behavior	
  Driven	
  Development	
  or	
  BDD	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  3	
  
BDD	
  By	
  any	
  Other	
  Name	
  
•  There	
  are	
  some	
  minor	
  subtle	
  differences	
  between	
  
those	
  terms,	
  that	
  don't	
  maSer	
  for	
  most	
  purposes	
  
(Developers	
  tend	
  to	
  call	
  it	
  BDD	
  and	
  Testers	
  ATDD)	
  
•  Collaborate	
  to	
  define	
  detailed	
  acceptance	
  criteria	
  
before	
  developing	
  applica;on	
  code	
  	
  
•  Turn	
  the	
  criteria	
  into	
  executable	
  acceptance	
  tests	
  
(before	
  developing	
  applica;on	
  code)	
  
•  Watch	
  test	
  fail	
  (no	
  because	
  no	
  app	
  code)	
  
•  Then	
  later	
  pass,	
  when	
  app	
  func;onality	
  
implemented	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  4	
  
Value	
  of	
  BDD	
  Over	
  Tes;ng	
  AUerwards	
  
•  BeSer	
  Documenta;on	
  of	
  Requirements	
  –	
  Automated	
  tests	
  
are	
  precise	
  
•  Precise	
  Audi;ng	
  though	
  automated	
  traceability	
  	
  
•  Improved	
  Dev	
  Focus	
  –	
  Eliminates	
  Goldpla;ng	
  
•  Clear	
  when	
  you're	
  done	
  with	
  a	
  feature	
  	
  
•  Eliminates	
  False	
  Posi;ves	
  that	
  tes;ng	
  aUer	
  can	
  cause	
  
•  Ensures	
  acceptance	
  tes;ng	
  gets	
  done	
  
•  Ensures	
  acceptance	
  doesn't	
  slow	
  down	
  release	
  
•  Can	
  be	
  integrated	
  into	
  Con;nuous	
  Deployment	
  Pipeline	
  
•  Regressionable	
  Spec	
  	
  -­‐	
  Obvious	
  if	
  code	
  and	
  tests	
  out	
  of	
  sync	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  5	
  
Behavior	
  Driven	
  Development	
  &	
  	
  
Test	
  Driven	
  Development	
  Similari;es	
  
•  Both	
  specify	
  behavior	
  
•  Both	
  use	
  feedback	
  loops	
  
•  Both	
  use	
  automated	
  tes;ng,	
  not	
  manual	
  tes;ng	
  
•  Both	
  create	
  tests	
  with	
  3	
  main	
  parts	
  
•  Both	
  create	
  tests	
  which	
  can	
  be	
  run	
  independently	
  
•  Both	
  lower	
  defects	
  
•  Both	
  provide	
  regressionable	
  safety	
  nets	
  for	
  change	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  6	
  
Differences	
  Between	
  BDD	
  and	
  TDD	
  (1)	
  
•  BDD	
  and	
  TDD	
  focus	
  is	
  different	
  
–  BDD	
  focuses	
  on	
  building	
  the	
  Right	
  Thing	
  (business	
  value)	
  
–  TDD	
  focuses	
  on	
  building	
  the	
  Thing	
  Right	
  (technical	
  
quality)	
  
•  BDD	
  and	
  TDD	
  have	
  different	
  levels	
  of	
  granularity	
  
–  BDD	
  Scope	
  is	
  business	
  func;onality	
  
–  TDD	
  Scope	
  is	
  soUware	
  class	
  and	
  unit	
  level	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  7	
  
Differences	
  Between	
  BDD	
  and	
  TDD	
  (2)	
  
•  BDD	
  and	
  TDD	
  par;cipants	
  differ	
  
–  BDD	
  involves	
  a	
  greater	
  variety	
  of	
  par;cipants	
  
–  TDD	
  is	
  developer	
  centric	
  
•  BDD	
  and	
  TDD	
  specifica;on	
  languages	
  differ	
  
–  BDD	
  test	
  specifica;ons	
  are	
  in	
  business	
  language	
  	
  (e.g.	
  
Cucumber's	
  Gherkin)	
  
–  TDD	
  test	
  specifica;on	
  languages	
  is	
  in	
  programmer	
  
focused	
  unit	
  tes;ng	
  language	
  (e.g.	
  JUnit,	
  Rspec,	
  CPPUnit,	
  
NUnit,	
  etc.)	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  8	
  
Test	
  Driven	
  Development	
  Feedback	
  Loop	
  
Write	
  a	
  test	
  for	
  
new	
  low	
  level	
  
func;onality	
  	
  
Run	
  the	
  test	
  and	
  
watch	
  it	
  fail	
  	
  
(no	
  code	
  =	
  test	
  fails)	
  
Write	
  just	
  enough	
  
code	
  to	
  make	
  the	
  
test	
  pass	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  9	
  
Run	
  the	
  test	
  and	
  
watch	
  it	
  pass	
  
Clean	
  up	
  
complex	
  or	
  
messy	
  code	
  
Run	
  test	
  again	
  	
  
to	
  make	
  sure	
  it	
  	
  
s;ll	
  passes	
  
Check	
  in	
  
Code	
  &	
  
Tests	
  
Check	
  in	
  
Code	
  &	
  
Tests	
  
Simplified	
  TDD	
  Flow	
  
(oUen	
  called	
  Red-­‐Green-­‐Refactor	
  
Write	
  a	
  failing	
  unit	
  test	
  
for	
  new	
  func;onality	
  
Write	
  just	
  enough	
  
code	
  to	
  pass	
  test	
  
Refactored	
  code	
  must	
  
also	
  pass	
  tests,	
  	
  
no	
  new	
  func;onality	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  10	
  
TDD	
  is	
  Deep	
  Inside	
  Code:	
  Tes;ng	
  at	
  Unit	
  Level	
  
BDD	
  with	
  TDD	
  Flow	
  (simplified)	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  11	
  
REFACTOR	
  
RED	
  
GREEN	
  
RED	
  
GREEN	
  
REFACTOR	
  
TDD	
  
unit	
  test	
  
level	
  
BDD	
  
acceptance	
  	
  
test	
  level	
  
JUnit,	
  
NUnit,	
  
Rspec,	
  etc.	
  
Cucumber	
  
with	
  
Gherkin	
  
BDD	
  with	
  TDD	
  Inner	
  Feedback	
  Loop	
  
(detailed)	
  
Write	
  a	
  new	
  
step	
  for	
  BDD	
  
scenario	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  12	
  
Clean	
  up	
  	
  
BDD	
  	
  
test	
  code	
  
Run	
  BDD	
  test	
  
again	
  	
  
to	
  make	
  sure	
  it	
  	
  
s;ll	
  passes	
  
Check	
  in	
  
Code	
  &	
  
Tests	
  
Check	
  in	
  
Code	
  &	
  
Tests	
  
Focus	
  on	
  
One	
  
Scenario	
  
TDD	
  
unit	
  test	
  
level	
  
Run	
  Scenario	
  
and	
  watch	
  
Step	
  fail	
  	
  
Run	
  BDD	
  test	
  
&	
  watch	
  step	
  
pass	
  
When	
  step	
  
passes	
  pull	
  
up	
  to	
  BDD	
  
Drop	
  
down	
  to	
  
TDD	
  
Three	
  Parts	
  of	
  Wri;ng	
  any	
  Test	
  
Cucumber/
Gherkin	
  
3	
  As	
  
Ruby	
  
3	
  As	
  
Java	
  
Formal	
  Testers	
   What	
  it	
  is	
  
Given	
   Assemble	
   Arrange	
  	
   Precondi;on	
   All	
  the	
  setup	
  and	
  
dependencies	
  for	
  the	
  
test	
  
When	
   Ac;vate	
   Act	
   Ac;on/Event	
   Something	
  that	
  
happens	
  that	
  will	
  
make	
  the	
  outcome	
  
different	
  than	
  if	
  it	
  
hadn’t	
  happened	
  
Then	
   Assert	
   Assert	
   Expected	
  
Results	
  or	
  
Postcondi;on	
  
What	
  is	
  expected	
  to	
  
happen	
  and	
  any	
  side	
  
effects	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  13	
  
Collabora;vely	
  (Spec	
  it/define	
  tests)	
  
•  Some;mes	
  called	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
the	
  3	
  Amigos	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
(test,	
  dev,	
  business)	
  
•  Conversa;on	
  based	
  
•  Focus	
  on	
  value	
  
•  Specific	
  examples	
  
•  Concrete	
  data	
  
•  Outside	
  in	
  (business	
  focus	
  
drives	
  development)	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  14	
  
BDD	
  Test	
  Automa;on	
  Has	
  2	
  Sides	
  
Business	
  Facing	
  
•  Simple	
  English	
  
•  In	
  business	
  terms	
  
•  Promotes	
  collabora;on	
  
•  Uses	
  examples	
  
•  Uses	
  concrete	
  data	
  
•  Proves	
  business	
  needs	
  met	
  
•  Executable	
  specifica;on	
  
•  Modifiable	
  &	
  reusable	
  
Technology	
  Facing	
  
•  Exercises	
  underlying	
  SW	
  
•  Connects	
  to	
  browsers,	
  
networks,	
  databases,	
  
frameworks,	
  etc,	
  
•  Object	
  Oriented	
  
•  Extensive	
  test	
  libraries	
  
•  Modifiable	
  &	
  reusable	
  
•  Learnable	
  programming	
  
language	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  15	
  
Quali;es	
  of	
  a	
  Good	
  BDD	
  Acceptance	
  Test	
  
•  In	
  business	
  language	
  using	
  terms	
  common	
  to	
  that	
  domain,	
  
so	
  that	
  your	
  PO	
  or	
  customer	
  can	
  easily	
  understands	
  the	
  test	
  
•  Not	
  vague,	
  so	
  that	
  it	
  is	
  clear	
  exactly	
  what	
  condi;ons	
  make	
  
the	
  test	
  pass	
  or	
  fail	
  
•  Just	
  the	
  right	
  amount	
  of	
  detail,	
  concrete	
  data	
  relevant	
  to	
  the	
  
scenario,	
  but	
  no	
  extra	
  
•  Not	
  overly	
  technical	
  
•  Not	
  scripty	
  (no	
  click	
  here,	
  etc.)	
  
•  Let's	
  see	
  some	
  examples	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  16	
  
Too	
  Vague	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  17	
  
Scenario: Book search
When I search for a book
Then I expect to see the appropriate information
What	
  type	
  of	
  search:	
  by	
  
Author,	
  ISBN,	
  Title?	
  
Successful	
  or	
  
failed	
  search?	
  	
  
What	
  data	
  are	
  we	
  using	
  
to	
  search	
  with?	
  
What	
  is	
  the	
  appropriate	
  
informa;on	
  we	
  should	
  
see:	
  specific	
  Author,	
  ISBN	
  
or	
  Title?	
  
Too	
  Technical	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  18	
  
Scenario: Successful book search by author
Given the following Authors:
| id | name |
| 1 | Jeff Morgan |
| 2 | Gojko Adzic |
| 3 | Matt Wynne |
And the following Titles:
| id | title | author_id |
| 1 | Cucumber & Cheese | 1 |
| 2 | The Cucumber Book | 3 |
| 3 | Specification by Example | 2 |
And I'm on "http://www.mybooks.example/"
When I fill in "Morgan" in "//input[name()='query']"
And I click "#seekButton"
Then there should be 1 "div.book div.title" element
And the page should contain "Cucumber & Cheese"
Too	
  Scripty	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  19	
  
Scenario: Successful book search by author
Given the following catalog:
| Title | Author |
| Cucumber & Cheese | Jeff Morgan |
| The Cucumber Book | Matt Wynne |
| Specification by Example | Gojko Adzic |
And I'm on the bookstore home page
When I fill in "Morgan" in the search field
And I click "Search"
Then I should see only "Cucumber & Cheese" in the results
Business	
  Domain	
  Language,	
  
But	
  Too	
  Detailed	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  20	
  
Scenario: Successful book search by author
Given the following catalog:
| Title | Author | Publisher | ISBN |
| Cucumber & Cheese | Jeff Morgan | LeanPub | 0692422501 |
| The Cucumber Book | Matt Wynne | Pragmatic Programmers | 1934356808 |
| Specification by Example | Gojko Adzic | Manning Publications | 1617290084 |
When I search for "Morgan"
Then I should see only the following in the results:
| Title | Author | Format | Price |
| Cucumber & Cheese | Jeff Morgan | PDF | $14.99 |
Business	
  Domain	
  Language,	
  
Just	
  Right	
  !	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  21	
  
Scenario: Successful book search by author
Given the following catalog:
| Title | Author |
| Cucumber & Cheese | Jeff Morgan |
| The Cucumber Book | Matt Wynne |
| Specification by Example | Gojko Adzic |
When I search for "Morgan"
Then I should see only "Cucumber & Cheese" in the results
Crea;ng	
  BDD	
  Acceptance	
  Scenarios	
  
•  User	
  Stories,	
  especially	
  those	
  created	
  though	
  story	
  mapping,	
  
are	
  a	
  good	
  place	
  to	
  start	
  talking	
  about	
  acceptance	
  criteria	
  
•  That	
  can	
  lead	
  to	
  thinking	
  about	
  categories	
  of	
  test	
  scenarios	
  
(test	
  ;tles)	
  
•  Given,	
  When,	
  Then	
  	
  comes	
  next	
  
•  Make	
  sure	
  there	
  is	
  concrete	
  test	
  data	
  
•  Let's	
  see	
  how	
  it	
  works	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  22	
  
In	
  order	
  to	
  conduct	
  banking	
  	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  use	
  an	
  ATM	
  
Why?	
  
Who?	
  
What?	
  
Why	
  does	
  your	
  
user	
  want	
  this?	
  
Your	
  idea	
  probably	
  needs	
  to	
  be	
  broken	
  down	
  into	
  smaller	
  stories.	
  	
  
Who	
  is	
  this	
  user?	
  
How	
  is	
  he/she	
  
different	
  from	
  other	
  
users.	
  
What	
  exactly	
  does	
  
your	
  user	
  want?	
  
Start	
  with	
  an	
  idea	
  for	
  an	
  App	
  (like	
  ATM	
  banking)	
  
These	
  ideas	
  are	
  called	
  User	
  Stories.	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  23	
  
Sample	
  ATM	
  Stories	
  (Features)	
  
Cash	
  Withdrawal	
  :	
  
In	
  order	
  to	
  get	
  money	
  	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  withdraw	
  cash	
  at	
  the	
  ATM	
  
Check	
  Deposit	
  :	
  	
  
In	
  order	
  to	
  deposit	
  my	
  checks	
  	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  deposit	
  checks	
  at	
  the	
  ATM	
  
Transfer	
  to	
  Savings:	
  
In	
  order	
  to	
  earn	
  interest	
  even	
  	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  transfer	
  money	
  from	
  
checking	
  to	
  savings	
  at	
  the	
  ATM	
  
Transfer	
  to	
  Checking:	
  
In	
  order	
  to	
  not	
  overdraw	
  my	
  account	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  transfer	
  money	
  from	
  savings	
  
to	
  checking	
  at	
  the	
  ATM	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  24	
  
Choose	
  a	
  Story	
  (Feature)	
  
	
  (to	
  become	
  an	
  automated	
  test)	
  	
  
In	
  order	
  to	
  get	
  money	
  	
  
when	
  the	
  bank	
  is	
  closed	
  
As	
  a	
  bank	
  customer	
  
I	
  want	
  to	
  withdraw	
  cash	
  at	
  the	
  ATM	
  
Feature: Cash Withdrawal
In order to get money when the
bank is closed
As a bank customer
I want to withdraw cash at the ATM
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  25	
  
Acceptance	
  Criteria	
  will	
  become	
  our	
  specs	
  
(test	
  scenarios)	
  when	
  they	
  have	
  details	
  	
  
Feature: Cash Withdrawal
In order to get money when the
bank is closed
As a bank customer
I want to withdraw cash at the ATM
• 	
  Successful	
  Withdrawal	
  
• 	
  	
  Less	
  than	
  balance	
  
• 	
  	
  Equal	
  to	
  balance	
  
• 	
  Withdrawal	
  Failed	
  Due	
  to	
  
Insufficient	
  Funds	
  
• 	
  Withdrawal	
  Failed	
  Because	
  
Cash	
  Dispenser	
  Doesn’t	
  
Dispense	
  One	
  Dollar	
  Bills	
  
• 	
  Withdrawal	
  Failed	
  Because	
  
Account	
  Closed	
  
First	
  Cut	
  Acceptance	
  Criteria	
  for	
  several	
  tests	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  26	
  
• 	
  Successful	
  Withdrawal	
  
Given	
  my	
  account	
  has	
  been	
  credited	
  
with	
  $100	
  
When	
  I	
  withdraw	
  $20	
  
Then	
  	
  $20	
  should	
  be	
  dispensed	
  
And	
  the	
  balance	
  of	
  my	
  account	
  
should	
  be	
  $80	
  
Choose	
  a	
  Scenario	
  and	
  	
  
Define	
  the	
  Steps	
  in	
  Testable	
  Detail	
  	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  27	
  
• 	
  Successful	
  Withdrawal	
  
(less	
  than	
  balance)	
  
Given my account has
starting balance of $100
When I withdraw $20
Then $20 should be
dispensed
And the ending balance of
my account should be $80
Given,	
  When,	
  Then	
  format	
  –	
  	
  
Business	
  language	
  with	
  unambiguous	
  detail	
  	
  
Detailed	
  Acceptance	
  Criteria	
  
These	
  detailed	
  acceptance	
  criteria	
  are	
  
acceptance	
  tests	
  that	
  are	
  executable	
  specs	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  28	
  
With	
  Minor	
  Changes	
  it	
  can	
  become	
  an	
  
Automated	
  Test	
  (Cucumber's	
  Gherkin)	
  
• 	
  Successful	
  Withdrawal	
  
Given	
  my	
  account	
  has	
  been	
  
credited	
  with	
  $100	
  
When	
  I	
  withdraw	
  $20	
  
Then	
  $20	
  should	
  be	
  dispensed	
  
And	
  the	
  balance	
  of	
  my	
  account	
  
should	
  be	
  $80	
  
Scenario: Successful Withdrawal
Given my account has been
credited with $100
When I withdraw $20
Then $20 should be dispensed
And the balance of my account
should be $80
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  29	
  
The	
  Structure	
  of	
  	
  
Cucumber	
  Features	
  
Feature: [ feature title ]
As a user [ role ]
I want [ feature ]
So that [ business value ]
Scenario: [ scenario title ]
Given [ a pre-condition ]
And [another pre-condition ]
When [ event ]
Then [ post-condition outcome ]
And [ another post-condition outcome ]
Plain	
  	
  
Text	
  Key	
  
Words	
  
From	
  	
  
User	
  
Story	
  
Ref:	
  Cucumber	
  code	
  examples	
  from	
  
“The	
  Cucumber	
  Book”	
  by	
  MaS	
  Wynne	
  and	
  Aslak	
  Hellesøy	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  30	
  
Example	
  
Cucumber	
  Feature	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  31	
  
Step	
  Defini;ons	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  32	
  
Cucumber	
  Command	
  Line	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  33	
  
Plus	
  the	
  Evolving	
  Code	
  Under	
  Test	
  
(Ruby	
  example,	
  code	
  could	
  be	
  in	
  any	
  language)	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  34	
  
• 	
  Successful	
  Withdrawal	
  
(equal	
  to	
  balance)	
  
Given my account has
starting balance of $100
When I withdraw $100
Then $100 should be
dispensed
And the ending balance of
my account should be $0
Add	
  More	
  Scenarios	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  35	
  
Given my account has
starting balance of $100
When I withdraw $120
Then $0 should be
dispensed
And the ending balance of
my account should be $100
And I should see a message
containing "insufficient
funds"
• 	
  Failed	
  Withdrawal	
  	
  
(insufficient	
  funds)	
  
Features	
  
Scenarios	
  
Automa;on	
  Libraries	
  
(e.g.	
  rspec,	
  page-­‐object,	
  
wa;r-­‐webdriver,	
  etc.)	
  
Support	
  Code	
  
(e.g.	
  env.rb,	
  hooks.rb,	
  Gemfile,	
  
your	
  custom	
  page	
  objects)	
  
Business	
  
Facing	
  
Technology	
  
Facing	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  36	
  
Step	
  Defini;ons	
  
Cucumber/PageObject	
  Technology	
  Stack	
  
Gherkin	
  
(English-­‐like	
  
business	
  
language)	
  	
  
Built-­‐in	
  Ruby	
  
Libraries	
  for	
  
Tes;ng	
  	
  	
  
Ruby	
  	
  
(oUen	
  modified	
  
templates)	
  
Steps	
  wriSen	
  in	
  
Ruby	
  
Steps	
  
•  Testers	
  learn	
  the	
  business	
  side	
  of	
  BDD	
  quickly,	
  but	
  oUen	
  are	
  
challenged	
  by	
  technology	
  side	
  	
  
•  Testers	
  add	
  important	
  perspec;ve	
  in	
  three	
  amigos	
  sessions	
  
•  Make	
  sure	
  that	
  the	
  PO/customer	
  approves	
  of	
  the	
  scenario	
  
wording	
  and	
  any	
  changes	
  to	
  it	
  (needs	
  to	
  readable	
  to	
  PO)	
  
•  Testers	
  responsible	
  for	
  wri;ng	
  all	
  acceptance	
  tests	
  
•  Testers	
  can	
  learn	
  technology	
  side	
  of	
  BDD.	
  Business	
  needs	
  to	
  
provide	
  training,	
  coaching	
  and	
  pa;ence	
  (see	
  my	
  talk	
  
"Growing	
  Manual	
  Testers	
  into	
  Automators")	
  	
  
•  Pair	
  Testers	
  and	
  Developers	
  to	
  speed	
  learning	
  technology	
  
side	
  	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  37	
  
Teams	
  with	
  Tradi;onal	
  Manual	
  Testers	
  
Teams	
  of	
  Only	
  Developers	
  
•  Devs	
  learn	
  the	
  technology	
  side	
  of	
  BDD	
  quickly,	
  but	
  oUen	
  are	
  
challenged	
  by	
  business	
  side	
  	
  
•  Developers	
  tend	
  to	
  think	
  "happy	
  path",	
  so	
  have	
  another	
  dev	
  
or	
  BA	
  take	
  the	
  role	
  of	
  "devil's	
  advocate"	
  in	
  three	
  amigos	
  
session	
  too	
  flesh	
  out	
  error	
  scenarios	
  
•  Make	
  sure	
  that	
  the	
  PO/customer	
  approves	
  of	
  the	
  scenario	
  
wording	
  and	
  any	
  changes	
  to	
  it	
  (needs	
  to	
  readable	
  to	
  PO)	
  
•  Developers	
  responsible	
  for	
  wri;ng	
  all	
  acceptance	
  tests	
  
•  BDD	
  tests	
  do	
  NOT	
  take	
  the	
  place	
  of	
  TDD	
  unit	
  tests,	
  TDD	
  unit	
  
tes;ng	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  38	
  
Mob	
  Programming	
  
•  Whole	
  team	
  works	
  together	
  
•  On	
  the	
  same	
  thing	
  
•  At	
  the	
  same	
  ;me	
  
•  In	
  the	
  same	
  space	
  
•  Using	
  the	
  same	
  computer	
  
•  Driver	
  rotates	
  
•  Everyone	
  par;cipates	
  
•  Great	
  for	
  training	
  &	
  prac;ce	
  
•  Great	
  for	
  collabora;on	
  
•  Everyone	
  up	
  to	
  speed	
  faster	
  
•  Some	
  teams	
  mob	
  always,	
  others	
  frequently	
  
•  Features	
  delivered	
  faster	
  –	
  single	
  piece	
  flow	
  /wo	
  handoffs	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  39	
  
Some	
  Tes;ng	
  Shouldn't	
  Be	
  Automated	
  
•  Look	
  and	
  Feel	
  –	
  Does	
  the	
  corporate	
  logo	
  look	
  right?	
  
•  Usability	
  –	
  Is	
  the	
  app	
  easy	
  to	
  use?	
  
•  Page	
  Layout	
  of	
  PDF	
  documents	
  –	
  Easier	
  for	
  a	
  human	
  to	
  
inspect	
  
•  Readability	
  –	
  Humans	
  must	
  verify	
  readability	
  
•  Transla;on	
  –	
  Does	
  the	
  Spanish	
  page	
  say	
  the	
  same	
  thing	
  the	
  
English	
  page	
  does?	
  
•  Data	
  Input	
  Integrity	
  (garbage	
  in/garbage	
  out)	
  
•  Legalese	
  –	
  Some;mes	
  a	
  lawyer	
  must	
  verify	
  the	
  page	
  text	
  
(unless	
  lawyer	
  is	
  part	
  of	
  the	
  Amigos	
  session)	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  40	
  
BDD	
  &	
  TDD	
  Stoplight	
  Demo	
  
Resources	
  
and	
  
References	
  
Resources	
  –	
  BDD	
  Overview	
  and	
  Value	
  
•  How	
  tests	
  become	
  Executable	
  Specifica;ons	
  –	
  Explains	
  without	
  
coding,	
  also	
  good	
  overview	
  for	
  anyone	
  
–  Specifica$on	
  by	
  Example:	
  How	
  Successful	
  Teams	
  Deliver	
  
the	
  Right	
  So+ware	
  by	
  Gojko	
  Adzic	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  43	
  
Available	
  from	
  Amazon	
  or	
  Manning	
  hSps://www.manning.com/	
  
Managers,	
  Requirements	
  Analysts,	
  Product	
  Owners	
  and	
  others	
  
who	
  want	
  to	
  understand	
  the	
  concepts,	
  human	
  interac$ons	
  and	
  
value	
  of	
  BDD	
  /	
  ATDD	
  
Resources	
  –	
  Cucumber	
  Books	
  
Ignore	
  references	
  to	
  headless	
  Rails	
  tes$ng	
  unless	
  using	
  Rails	
  
•  Cucumber	
  with	
  Ruby	
  –	
  General	
  
–  The	
  Cucumber	
  Book:	
  Behavior-­‐Driven	
  Development	
  for	
  
Testers	
  and	
  Developers	
  by	
  MaS	
  Wynne	
  &	
  Aslak	
  Hellesoy	
  
•  Advanced	
  Cucumber	
  Topics	
  
–  Cucumber	
  Recipes:	
  Automate	
  Anything	
  with	
  BDD	
  Tools	
  
and	
  Techniques	
  by	
  Ian	
  Dees,	
  MaS	
  Wynne	
  &	
  Aslak	
  Hellesøy	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  44	
  
Available	
  from	
  Amazon	
  or	
  the	
  Pragma;c	
  Bookstore	
  hSps://pragprog.com/	
  
Resources	
  –	
  Free	
  Cucumber	
  Info	
  
Cucumber	
  Wikis	
  
•  Both	
  wikis	
  focus	
  on	
  headless	
  Cucumber	
  (not	
  in	
  browser	
  with	
  
PageObject),	
  but	
  provide	
  useful	
  info	
  on	
  Cucumber	
  and	
  Gherkin	
  
•  Older	
  Wiki	
  –	
  easy	
  to	
  explore	
  format,	
  contains	
  some	
  info	
  not	
  in	
  
new	
  wiki	
  hSps://github.com/cucumber/cucumber/wiki	
  
•  Newer	
  Wiki	
  –	
  contains	
  some	
  nice	
  blogs	
  and	
  plug	
  for	
  semi	
  
commercial	
  product	
  and	
  support	
  hSps://cucumber.io/	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  45	
  
Resources	
  –	
  Free	
  Ruby	
  Info	
  
Ruby	
  101	
  –	
  the	
  basics:	
  (Learn	
  Ruby	
  
2.x	
  not	
  Ruby	
  1.9)	
  
•  On-­‐line	
  tutorials	
  –	
  my	
  favorite	
  is	
  
Ruby	
  Monk	
  	
  hSps://rubymonk.com	
  
Learn	
  to	
  navigate	
  the	
  documenta$on:	
  
•  Ruby's	
  built-­‐in	
  classes	
  and	
  methods	
  
are	
  very	
  rich.	
  
•  Testers	
  should	
  learn	
  to	
  check	
  if	
  the	
  
needed	
  func;onality	
  already	
  exists	
  
•  Ruby	
  docs	
  are	
  found	
  at	
  
hSp://ruby-­‐doc.org/	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  46	
  
ALL	
  
SOME	
  
Resources	
  –	
  Cheezy's	
  Book	
  
Cucumber	
  with	
  PageObject	
  –	
  Best	
  approach	
  to	
  web	
  tes$ng	
  (IHMO)	
  
•  Covers	
  Cucumber,	
  Gherkin,	
  PageObject,	
  Wa;r,	
  Selenium,	
  etc.	
  used	
  in	
  
web	
  demo	
  
•  Step	
  by	
  step	
  tutorial	
  with	
  exercises	
  
•  SoUcopy	
  only,	
  work	
  in	
  progress,	
  updated	
  periodically	
  
–  Cucumber	
  and	
  Cheese:	
  A	
  Testers	
  Workshop	
  by	
  Jeff	
  Morgan	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  47	
  
	
  Available	
  only	
  from	
  Lean	
  Pub	
  hSps://leanpub.com/cucumber_and_cheese	
  	
  
Resources	
  –	
  Free	
  PageObject	
  Info	
  
Cheezy's	
  (Jeff	
  Morgan's)	
  Blog	
  
•  Other	
  Cheezy	
  blog	
  posts	
  are	
  also	
  
worthwhile	
  	
  
hSp://www.cheezyworld.com/
2011/07/29/introducing-­‐page-­‐
object-­‐gem/	
  
Official	
  documenta$on	
  
•  PageObject	
  is	
  a	
  gem.	
  
•  Like	
  most	
  gems,	
  it	
  and	
  its	
  
documenta;on	
  can	
  be	
  found	
  on	
  
GitHub	
  (scroll	
  down)	
  
hSps://github.com/cheezy/page-­‐
object	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  48	
  
Resources	
  –	
  Free	
  Detailed	
  Demo	
  
Cheezy's	
  Demo	
  Tes$ng	
  Puppies	
  Site	
  
•  Uses	
  RubyMine	
  IDE,	
  but	
  other	
  
editors	
  or	
  IDEs	
  work	
  fine	
  
•  Covers	
  a	
  later	
  example	
  from	
  
Cucumber	
  and	
  Cheese	
  book	
  resource	
  
•  1	
  hour	
  10	
  minute	
  YouTube	
  video	
  
hSps://www.youtube.com/watch?
v=zpt15XIjpas	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  49	
  
Resources	
  –	
  Ruby	
  Books	
  
If	
  Ruby	
  Monk	
  is	
  too	
  challenging,	
  try	
  Learn	
  to	
  Program	
  
•  For	
  those	
  who	
  haven't	
  programmed	
  before	
  (most	
  manual	
  
testers)	
  
–  Learn	
  to	
  Program	
  -­‐	
  Second	
  Edi$on	
  by	
  Chris	
  Pine	
  
•  For	
  those	
  who	
  know	
  object-­‐oriented	
  programming	
  in	
  some	
  
other	
  language	
  (includes	
  more	
  Ruby	
  than	
  most	
  testers	
  will	
  
need)	
  
–  Programming	
  Ruby	
  1.9	
  &	
  2.0	
  by	
  Dave	
  Thomas	
  
•  For	
  a	
  problem-­‐based	
  approach	
  to	
  wri;ng	
  small	
  pieces	
  of	
  
Ruby	
  that	
  do	
  useful	
  things	
  
–  Everyday	
  Scrip$ng	
  with	
  Ruby	
  by	
  Brian	
  Marick	
  
cbell@CamilleBellConsul$ng.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  50	
  
Available	
  from	
  Amazon	
  or	
  the	
  Pragma;c	
  Bookstore	
  hSps://pragprog.com/	
  
Camille	
  Bell	
  
Agile	
  Technical	
  &	
  Process	
  Coaching	
  
Retrospec;ves	
  
Agile	
  Boot	
  Camps	
  	
  
Agile	
  Training	
  
Updated	
  Slides	
  
or	
  just	
  to	
  chat	
  about	
  things	
  agile	
  
cbell@CamilleBellConsul$ng.com	
  
Twi2er	
  @agilecamille	
  

More Related Content

What's hot

BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieQA or the Highway
 
Automated Acceptance Tests in .NET
Automated Acceptance Tests in .NETAutomated Acceptance Tests in .NET
Automated Acceptance Tests in .NETWyn B. Van Devanter
 
Behavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftBehavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftAspire Systems
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
WE are Doing it Wrong - Dmitry Sharkov
WE are Doing it Wrong - Dmitry SharkovWE are Doing it Wrong - Dmitry Sharkov
WE are Doing it Wrong - Dmitry SharkovQA or the Highway
 
Production code without tests
Production code without testsProduction code without tests
Production code without testsAkim Khalilov
 
Flexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts ExplainedFlexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts ExplainedSandy Mamoli
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Promises in JavaScript with jQuery
Promises in JavaScript with jQueryPromises in JavaScript with jQuery
Promises in JavaScript with jQueryRyan Blunden
 
Web based automation testing on Node.js environment
Web based automation testing on Node.js environmentWeb based automation testing on Node.js environment
Web based automation testing on Node.js environmentYu-Lin Huang
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewBlue Elephant Consulting
 
Westrich spock-assets-gum
Westrich spock-assets-gumWestrich spock-assets-gum
Westrich spock-assets-gumBrian Westrich
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern RiverGlide
 
Automation testing in Agile project
Automation testing in Agile projectAutomation testing in Agile project
Automation testing in Agile projectHien Nguyen
 

What's hot (20)

BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
 
Automated Acceptance Tests in .NET
Automated Acceptance Tests in .NETAutomated Acceptance Tests in .NET
Automated Acceptance Tests in .NET
 
Behavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shiftBehavior Driven Testing - A paradigm shift
Behavior Driven Testing - A paradigm shift
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
eXtreme Programming
eXtreme ProgrammingeXtreme Programming
eXtreme Programming
 
WE are Doing it Wrong - Dmitry Sharkov
WE are Doing it Wrong - Dmitry SharkovWE are Doing it Wrong - Dmitry Sharkov
WE are Doing it Wrong - Dmitry Sharkov
 
Production code without tests
Production code without testsProduction code without tests
Production code without tests
 
Developer Testing
Developer TestingDeveloper Testing
Developer Testing
 
Flexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts ExplainedFlexing your Agile Muscle - Agile Technical Concepts Explained
Flexing your Agile Muscle - Agile Technical Concepts Explained
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Promises in JavaScript with jQuery
Promises in JavaScript with jQueryPromises in JavaScript with jQuery
Promises in JavaScript with jQuery
 
Web based automation testing on Node.js environment
Web based automation testing on Node.js environmentWeb based automation testing on Node.js environment
Web based automation testing on Node.js environment
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
 
Westrich spock-assets-gum
Westrich spock-assets-gumWestrich spock-assets-gum
Westrich spock-assets-gum
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 
Automation testing in Agile project
Automation testing in Agile projectAutomation testing in Agile project
Automation testing in Agile project
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 

Similar to Inside Behavior Driven Development

Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference CardSeapine Software
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Perfecto Mobile
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanQA or the Highway
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is ImportaintSana Nasar
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012Justin Gordon
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptxAmalEldhose2
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentAll Things Open
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0Ganesh Kondal
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnitsatejsahu
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Synerzip
 
Being Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingBeing Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingRaj Indugula
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentQASymphony
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
Software Quality via Unit Testing
Software Quality via Unit TestingSoftware Quality via Unit Testing
Software Quality via Unit TestingShaun Abram
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentnikhil sreeni
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Jason Tice
 

Similar to Inside Behavior Driven Development (20)

Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference Card
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
TDD with Ruby
TDD with RubyTDD with Ruby
TDD with Ruby
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
 
Tech breakfast at Lab49
Tech breakfast at Lab49Tech breakfast at Lab49
Tech breakfast at Lab49
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven Development
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
TDD In Practice
TDD In PracticeTDD In Practice
TDD In Practice
 
Being Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingBeing Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testing
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven Development
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
Software Quality via Unit Testing
Software Quality via Unit TestingSoftware Quality via Unit Testing
Software Quality via Unit Testing
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 

More from Camille Bell

What CS Class Didn't Teach About Testing
What CS Class Didn't Teach About TestingWhat CS Class Didn't Teach About Testing
What CS Class Didn't Teach About TestingCamille Bell
 
Remote Mob Programming
Remote Mob ProgrammingRemote Mob Programming
Remote Mob ProgrammingCamille Bell
 
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipCamille Bell
 
Software Craftsmanship Workshop
Software Craftsmanship WorkshopSoftware Craftsmanship Workshop
Software Craftsmanship WorkshopCamille Bell
 
What They Didn't Tell You in CSM Clas
What They Didn't Tell You in CSM ClasWhat They Didn't Tell You in CSM Clas
What They Didn't Tell You in CSM ClasCamille Bell
 
Automate Debugging with git bisect
Automate Debugging with git bisectAutomate Debugging with git bisect
Automate Debugging with git bisectCamille Bell
 
Promoting Agility with Running Tested Features - Paper
Promoting Agility with Running Tested Features - PaperPromoting Agility with Running Tested Features - Paper
Promoting Agility with Running Tested Features - PaperCamille Bell
 

More from Camille Bell (7)

What CS Class Didn't Teach About Testing
What CS Class Didn't Teach About TestingWhat CS Class Didn't Teach About Testing
What CS Class Didn't Teach About Testing
 
Remote Mob Programming
Remote Mob ProgrammingRemote Mob Programming
Remote Mob Programming
 
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW Craftsmanship
 
Software Craftsmanship Workshop
Software Craftsmanship WorkshopSoftware Craftsmanship Workshop
Software Craftsmanship Workshop
 
What They Didn't Tell You in CSM Clas
What They Didn't Tell You in CSM ClasWhat They Didn't Tell You in CSM Clas
What They Didn't Tell You in CSM Clas
 
Automate Debugging with git bisect
Automate Debugging with git bisectAutomate Debugging with git bisect
Automate Debugging with git bisect
 
Promoting Agility with Running Tested Features - Paper
Promoting Agility with Running Tested Features - PaperPromoting Agility with Running Tested Features - Paper
Promoting Agility with Running Tested Features - Paper
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Inside Behavior Driven Development

  • 1. Inside  Behavior  Driven   Development   Bal$more  So+ware  Prac$ces  and  Pa2erns                                                                                              April  19,  2016   Camille  Bell   cbell@CamilleBellConsul$ng.com   Twi2er  @agilecamille   ww.slideshare.net/Camille_Bell  
  • 2. Agenda   •  What  is  BDD?     •  What  is  its  value?   •  BDD  and  TDD  Similari;es  and  Differences   •  Who  par;cipates  in  BDD?    What  is  the  role  of  the  customer/product  owner?     •  Three  parts  of  Any  Test   •  Use  of  Business  Language  in  BDD:  what  is  a  good  BDD  test?   •  What  about  teams  that  have  tradi;onal  manual  testers?   •  What  about  teams  that  have  developers  but  not  testers?     •  What  should  be  tested  manually?   •  Demo   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      2  
  • 3. BDD/ATDD  ==  Agile  Func;onal  Tes;ng   •  Many  names  for  the  same  thing:   –  Behavior  Driven  Development  (BDD)   –  Acceptance  Test  Driven  Development    (ATDD)   –  Story  Driven  Development     –  Story  Tes;ng   –  Specifica;on  by  Example   •  We'll  call  it  Behavior  Driven  Development  or  BDD   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      3  
  • 4. BDD  By  any  Other  Name   •  There  are  some  minor  subtle  differences  between   those  terms,  that  don't  maSer  for  most  purposes   (Developers  tend  to  call  it  BDD  and  Testers  ATDD)   •  Collaborate  to  define  detailed  acceptance  criteria   before  developing  applica;on  code     •  Turn  the  criteria  into  executable  acceptance  tests   (before  developing  applica;on  code)   •  Watch  test  fail  (no  because  no  app  code)   •  Then  later  pass,  when  app  func;onality   implemented   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      4  
  • 5. Value  of  BDD  Over  Tes;ng  AUerwards   •  BeSer  Documenta;on  of  Requirements  –  Automated  tests   are  precise   •  Precise  Audi;ng  though  automated  traceability     •  Improved  Dev  Focus  –  Eliminates  Goldpla;ng   •  Clear  when  you're  done  with  a  feature     •  Eliminates  False  Posi;ves  that  tes;ng  aUer  can  cause   •  Ensures  acceptance  tes;ng  gets  done   •  Ensures  acceptance  doesn't  slow  down  release   •  Can  be  integrated  into  Con;nuous  Deployment  Pipeline   •  Regressionable  Spec    -­‐  Obvious  if  code  and  tests  out  of  sync   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      5  
  • 6. Behavior  Driven  Development  &     Test  Driven  Development  Similari;es   •  Both  specify  behavior   •  Both  use  feedback  loops   •  Both  use  automated  tes;ng,  not  manual  tes;ng   •  Both  create  tests  with  3  main  parts   •  Both  create  tests  which  can  be  run  independently   •  Both  lower  defects   •  Both  provide  regressionable  safety  nets  for  change   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      6  
  • 7. Differences  Between  BDD  and  TDD  (1)   •  BDD  and  TDD  focus  is  different   –  BDD  focuses  on  building  the  Right  Thing  (business  value)   –  TDD  focuses  on  building  the  Thing  Right  (technical   quality)   •  BDD  and  TDD  have  different  levels  of  granularity   –  BDD  Scope  is  business  func;onality   –  TDD  Scope  is  soUware  class  and  unit  level   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      7  
  • 8. Differences  Between  BDD  and  TDD  (2)   •  BDD  and  TDD  par;cipants  differ   –  BDD  involves  a  greater  variety  of  par;cipants   –  TDD  is  developer  centric   •  BDD  and  TDD  specifica;on  languages  differ   –  BDD  test  specifica;ons  are  in  business  language    (e.g.   Cucumber's  Gherkin)   –  TDD  test  specifica;on  languages  is  in  programmer   focused  unit  tes;ng  language  (e.g.  JUnit,  Rspec,  CPPUnit,   NUnit,  etc.)   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      8  
  • 9. Test  Driven  Development  Feedback  Loop   Write  a  test  for   new  low  level   func;onality     Run  the  test  and   watch  it  fail     (no  code  =  test  fails)   Write  just  enough   code  to  make  the   test  pass   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                      9   Run  the  test  and   watch  it  pass   Clean  up   complex  or   messy  code   Run  test  again     to  make  sure  it     s;ll  passes   Check  in   Code  &   Tests   Check  in   Code  &   Tests  
  • 10. Simplified  TDD  Flow   (oUen  called  Red-­‐Green-­‐Refactor   Write  a  failing  unit  test   for  new  func;onality   Write  just  enough   code  to  pass  test   Refactored  code  must   also  pass  tests,     no  new  func;onality   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  10   TDD  is  Deep  Inside  Code:  Tes;ng  at  Unit  Level  
  • 11. BDD  with  TDD  Flow  (simplified)   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  11   REFACTOR   RED   GREEN   RED   GREEN   REFACTOR   TDD   unit  test   level   BDD   acceptance     test  level   JUnit,   NUnit,   Rspec,  etc.   Cucumber   with   Gherkin  
  • 12. BDD  with  TDD  Inner  Feedback  Loop   (detailed)   Write  a  new   step  for  BDD   scenario   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  12   Clean  up     BDD     test  code   Run  BDD  test   again     to  make  sure  it     s;ll  passes   Check  in   Code  &   Tests   Check  in   Code  &   Tests   Focus  on   One   Scenario   TDD   unit  test   level   Run  Scenario   and  watch   Step  fail     Run  BDD  test   &  watch  step   pass   When  step   passes  pull   up  to  BDD   Drop   down  to   TDD  
  • 13. Three  Parts  of  Wri;ng  any  Test   Cucumber/ Gherkin   3  As   Ruby   3  As   Java   Formal  Testers   What  it  is   Given   Assemble   Arrange     Precondi;on   All  the  setup  and   dependencies  for  the   test   When   Ac;vate   Act   Ac;on/Event   Something  that   happens  that  will   make  the  outcome   different  than  if  it   hadn’t  happened   Then   Assert   Assert   Expected   Results  or   Postcondi;on   What  is  expected  to   happen  and  any  side   effects   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  13  
  • 14. Collabora;vely  (Spec  it/define  tests)   •  Some;mes  called                                 the  3  Amigos                                           (test,  dev,  business)   •  Conversa;on  based   •  Focus  on  value   •  Specific  examples   •  Concrete  data   •  Outside  in  (business  focus   drives  development)   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  14  
  • 15. BDD  Test  Automa;on  Has  2  Sides   Business  Facing   •  Simple  English   •  In  business  terms   •  Promotes  collabora;on   •  Uses  examples   •  Uses  concrete  data   •  Proves  business  needs  met   •  Executable  specifica;on   •  Modifiable  &  reusable   Technology  Facing   •  Exercises  underlying  SW   •  Connects  to  browsers,   networks,  databases,   frameworks,  etc,   •  Object  Oriented   •  Extensive  test  libraries   •  Modifiable  &  reusable   •  Learnable  programming   language   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  15  
  • 16. Quali;es  of  a  Good  BDD  Acceptance  Test   •  In  business  language  using  terms  common  to  that  domain,   so  that  your  PO  or  customer  can  easily  understands  the  test   •  Not  vague,  so  that  it  is  clear  exactly  what  condi;ons  make   the  test  pass  or  fail   •  Just  the  right  amount  of  detail,  concrete  data  relevant  to  the   scenario,  but  no  extra   •  Not  overly  technical   •  Not  scripty  (no  click  here,  etc.)   •  Let's  see  some  examples   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  16  
  • 17. Too  Vague   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  17   Scenario: Book search When I search for a book Then I expect to see the appropriate information What  type  of  search:  by   Author,  ISBN,  Title?   Successful  or   failed  search?     What  data  are  we  using   to  search  with?   What  is  the  appropriate   informa;on  we  should   see:  specific  Author,  ISBN   or  Title?  
  • 18. Too  Technical   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  18   Scenario: Successful book search by author Given the following Authors: | id | name | | 1 | Jeff Morgan | | 2 | Gojko Adzic | | 3 | Matt Wynne | And the following Titles: | id | title | author_id | | 1 | Cucumber & Cheese | 1 | | 2 | The Cucumber Book | 3 | | 3 | Specification by Example | 2 | And I'm on "http://www.mybooks.example/" When I fill in "Morgan" in "//input[name()='query']" And I click "#seekButton" Then there should be 1 "div.book div.title" element And the page should contain "Cucumber & Cheese"
  • 19. Too  Scripty   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  19   Scenario: Successful book search by author Given the following catalog: | Title | Author | | Cucumber & Cheese | Jeff Morgan | | The Cucumber Book | Matt Wynne | | Specification by Example | Gojko Adzic | And I'm on the bookstore home page When I fill in "Morgan" in the search field And I click "Search" Then I should see only "Cucumber & Cheese" in the results
  • 20. Business  Domain  Language,   But  Too  Detailed   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  20   Scenario: Successful book search by author Given the following catalog: | Title | Author | Publisher | ISBN | | Cucumber & Cheese | Jeff Morgan | LeanPub | 0692422501 | | The Cucumber Book | Matt Wynne | Pragmatic Programmers | 1934356808 | | Specification by Example | Gojko Adzic | Manning Publications | 1617290084 | When I search for "Morgan" Then I should see only the following in the results: | Title | Author | Format | Price | | Cucumber & Cheese | Jeff Morgan | PDF | $14.99 |
  • 21. Business  Domain  Language,   Just  Right  !   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  21   Scenario: Successful book search by author Given the following catalog: | Title | Author | | Cucumber & Cheese | Jeff Morgan | | The Cucumber Book | Matt Wynne | | Specification by Example | Gojko Adzic | When I search for "Morgan" Then I should see only "Cucumber & Cheese" in the results
  • 22. Crea;ng  BDD  Acceptance  Scenarios   •  User  Stories,  especially  those  created  though  story  mapping,   are  a  good  place  to  start  talking  about  acceptance  criteria   •  That  can  lead  to  thinking  about  categories  of  test  scenarios   (test  ;tles)   •  Given,  When,  Then    comes  next   •  Make  sure  there  is  concrete  test  data   •  Let's  see  how  it  works   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  22  
  • 23. In  order  to  conduct  banking     when  the  bank  is  closed   As  a  bank  customer   I  want  to  use  an  ATM   Why?   Who?   What?   Why  does  your   user  want  this?   Your  idea  probably  needs  to  be  broken  down  into  smaller  stories.     Who  is  this  user?   How  is  he/she   different  from  other   users.   What  exactly  does   your  user  want?   Start  with  an  idea  for  an  App  (like  ATM  banking)   These  ideas  are  called  User  Stories.   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  23  
  • 24. Sample  ATM  Stories  (Features)   Cash  Withdrawal  :   In  order  to  get  money     when  the  bank  is  closed   As  a  bank  customer   I  want  to  withdraw  cash  at  the  ATM   Check  Deposit  :     In  order  to  deposit  my  checks     when  the  bank  is  closed   As  a  bank  customer   I  want  to  deposit  checks  at  the  ATM   Transfer  to  Savings:   In  order  to  earn  interest  even     when  the  bank  is  closed   As  a  bank  customer   I  want  to  transfer  money  from   checking  to  savings  at  the  ATM   Transfer  to  Checking:   In  order  to  not  overdraw  my  account   when  the  bank  is  closed   As  a  bank  customer   I  want  to  transfer  money  from  savings   to  checking  at  the  ATM   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  24  
  • 25. Choose  a  Story  (Feature)    (to  become  an  automated  test)     In  order  to  get  money     when  the  bank  is  closed   As  a  bank  customer   I  want  to  withdraw  cash  at  the  ATM   Feature: Cash Withdrawal In order to get money when the bank is closed As a bank customer I want to withdraw cash at the ATM cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  25  
  • 26. Acceptance  Criteria  will  become  our  specs   (test  scenarios)  when  they  have  details     Feature: Cash Withdrawal In order to get money when the bank is closed As a bank customer I want to withdraw cash at the ATM •   Successful  Withdrawal   •     Less  than  balance   •     Equal  to  balance   •   Withdrawal  Failed  Due  to   Insufficient  Funds   •   Withdrawal  Failed  Because   Cash  Dispenser  Doesn’t   Dispense  One  Dollar  Bills   •   Withdrawal  Failed  Because   Account  Closed   First  Cut  Acceptance  Criteria  for  several  tests   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  26  
  • 27. •   Successful  Withdrawal   Given  my  account  has  been  credited   with  $100   When  I  withdraw  $20   Then    $20  should  be  dispensed   And  the  balance  of  my  account   should  be  $80   Choose  a  Scenario  and     Define  the  Steps  in  Testable  Detail     cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  27  
  • 28. •   Successful  Withdrawal   (less  than  balance)   Given my account has starting balance of $100 When I withdraw $20 Then $20 should be dispensed And the ending balance of my account should be $80 Given,  When,  Then  format  –     Business  language  with  unambiguous  detail     Detailed  Acceptance  Criteria   These  detailed  acceptance  criteria  are   acceptance  tests  that  are  executable  specs   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  28  
  • 29. With  Minor  Changes  it  can  become  an   Automated  Test  (Cucumber's  Gherkin)   •   Successful  Withdrawal   Given  my  account  has  been   credited  with  $100   When  I  withdraw  $20   Then  $20  should  be  dispensed   And  the  balance  of  my  account   should  be  $80   Scenario: Successful Withdrawal Given my account has been credited with $100 When I withdraw $20 Then $20 should be dispensed And the balance of my account should be $80 cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  29  
  • 30. The  Structure  of     Cucumber  Features   Feature: [ feature title ] As a user [ role ] I want [ feature ] So that [ business value ] Scenario: [ scenario title ] Given [ a pre-condition ] And [another pre-condition ] When [ event ] Then [ post-condition outcome ] And [ another post-condition outcome ] Plain     Text  Key   Words   From     User   Story   Ref:  Cucumber  code  examples  from   “The  Cucumber  Book”  by  MaS  Wynne  and  Aslak  Hellesøy   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  30  
  • 31. Example   Cucumber  Feature   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  31  
  • 32. Step  Defini;ons   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  32  
  • 33. Cucumber  Command  Line   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  33  
  • 34. Plus  the  Evolving  Code  Under  Test   (Ruby  example,  code  could  be  in  any  language)   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  34  
  • 35. •   Successful  Withdrawal   (equal  to  balance)   Given my account has starting balance of $100 When I withdraw $100 Then $100 should be dispensed And the ending balance of my account should be $0 Add  More  Scenarios   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  35   Given my account has starting balance of $100 When I withdraw $120 Then $0 should be dispensed And the ending balance of my account should be $100 And I should see a message containing "insufficient funds" •   Failed  Withdrawal     (insufficient  funds)  
  • 36. Features   Scenarios   Automa;on  Libraries   (e.g.  rspec,  page-­‐object,   wa;r-­‐webdriver,  etc.)   Support  Code   (e.g.  env.rb,  hooks.rb,  Gemfile,   your  custom  page  objects)   Business   Facing   Technology   Facing   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  36   Step  Defini;ons   Cucumber/PageObject  Technology  Stack   Gherkin   (English-­‐like   business   language)     Built-­‐in  Ruby   Libraries  for   Tes;ng       Ruby     (oUen  modified   templates)   Steps  wriSen  in   Ruby   Steps  
  • 37. •  Testers  learn  the  business  side  of  BDD  quickly,  but  oUen  are   challenged  by  technology  side     •  Testers  add  important  perspec;ve  in  three  amigos  sessions   •  Make  sure  that  the  PO/customer  approves  of  the  scenario   wording  and  any  changes  to  it  (needs  to  readable  to  PO)   •  Testers  responsible  for  wri;ng  all  acceptance  tests   •  Testers  can  learn  technology  side  of  BDD.  Business  needs  to   provide  training,  coaching  and  pa;ence  (see  my  talk   "Growing  Manual  Testers  into  Automators")     •  Pair  Testers  and  Developers  to  speed  learning  technology   side     cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  37   Teams  with  Tradi;onal  Manual  Testers  
  • 38. Teams  of  Only  Developers   •  Devs  learn  the  technology  side  of  BDD  quickly,  but  oUen  are   challenged  by  business  side     •  Developers  tend  to  think  "happy  path",  so  have  another  dev   or  BA  take  the  role  of  "devil's  advocate"  in  three  amigos   session  too  flesh  out  error  scenarios   •  Make  sure  that  the  PO/customer  approves  of  the  scenario   wording  and  any  changes  to  it  (needs  to  readable  to  PO)   •  Developers  responsible  for  wri;ng  all  acceptance  tests   •  BDD  tests  do  NOT  take  the  place  of  TDD  unit  tests,  TDD  unit   tes;ng   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  38  
  • 39. Mob  Programming   •  Whole  team  works  together   •  On  the  same  thing   •  At  the  same  ;me   •  In  the  same  space   •  Using  the  same  computer   •  Driver  rotates   •  Everyone  par;cipates   •  Great  for  training  &  prac;ce   •  Great  for  collabora;on   •  Everyone  up  to  speed  faster   •  Some  teams  mob  always,  others  frequently   •  Features  delivered  faster  –  single  piece  flow  /wo  handoffs   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  39  
  • 40. Some  Tes;ng  Shouldn't  Be  Automated   •  Look  and  Feel  –  Does  the  corporate  logo  look  right?   •  Usability  –  Is  the  app  easy  to  use?   •  Page  Layout  of  PDF  documents  –  Easier  for  a  human  to   inspect   •  Readability  –  Humans  must  verify  readability   •  Transla;on  –  Does  the  Spanish  page  say  the  same  thing  the   English  page  does?   •  Data  Input  Integrity  (garbage  in/garbage  out)   •  Legalese  –  Some;mes  a  lawyer  must  verify  the  page  text   (unless  lawyer  is  part  of  the  Amigos  session)   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  40  
  • 41. BDD  &  TDD  Stoplight  Demo  
  • 43. Resources  –  BDD  Overview  and  Value   •  How  tests  become  Executable  Specifica;ons  –  Explains  without   coding,  also  good  overview  for  anyone   –  Specifica$on  by  Example:  How  Successful  Teams  Deliver   the  Right  So+ware  by  Gojko  Adzic   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  43   Available  from  Amazon  or  Manning  hSps://www.manning.com/   Managers,  Requirements  Analysts,  Product  Owners  and  others   who  want  to  understand  the  concepts,  human  interac$ons  and   value  of  BDD  /  ATDD  
  • 44. Resources  –  Cucumber  Books   Ignore  references  to  headless  Rails  tes$ng  unless  using  Rails   •  Cucumber  with  Ruby  –  General   –  The  Cucumber  Book:  Behavior-­‐Driven  Development  for   Testers  and  Developers  by  MaS  Wynne  &  Aslak  Hellesoy   •  Advanced  Cucumber  Topics   –  Cucumber  Recipes:  Automate  Anything  with  BDD  Tools   and  Techniques  by  Ian  Dees,  MaS  Wynne  &  Aslak  Hellesøy   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  44   Available  from  Amazon  or  the  Pragma;c  Bookstore  hSps://pragprog.com/  
  • 45. Resources  –  Free  Cucumber  Info   Cucumber  Wikis   •  Both  wikis  focus  on  headless  Cucumber  (not  in  browser  with   PageObject),  but  provide  useful  info  on  Cucumber  and  Gherkin   •  Older  Wiki  –  easy  to  explore  format,  contains  some  info  not  in   new  wiki  hSps://github.com/cucumber/cucumber/wiki   •  Newer  Wiki  –  contains  some  nice  blogs  and  plug  for  semi   commercial  product  and  support  hSps://cucumber.io/   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  45  
  • 46. Resources  –  Free  Ruby  Info   Ruby  101  –  the  basics:  (Learn  Ruby   2.x  not  Ruby  1.9)   •  On-­‐line  tutorials  –  my  favorite  is   Ruby  Monk    hSps://rubymonk.com   Learn  to  navigate  the  documenta$on:   •  Ruby's  built-­‐in  classes  and  methods   are  very  rich.   •  Testers  should  learn  to  check  if  the   needed  func;onality  already  exists   •  Ruby  docs  are  found  at   hSp://ruby-­‐doc.org/   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  46   ALL   SOME  
  • 47. Resources  –  Cheezy's  Book   Cucumber  with  PageObject  –  Best  approach  to  web  tes$ng  (IHMO)   •  Covers  Cucumber,  Gherkin,  PageObject,  Wa;r,  Selenium,  etc.  used  in   web  demo   •  Step  by  step  tutorial  with  exercises   •  SoUcopy  only,  work  in  progress,  updated  periodically   –  Cucumber  and  Cheese:  A  Testers  Workshop  by  Jeff  Morgan   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  47    Available  only  from  Lean  Pub  hSps://leanpub.com/cucumber_and_cheese    
  • 48. Resources  –  Free  PageObject  Info   Cheezy's  (Jeff  Morgan's)  Blog   •  Other  Cheezy  blog  posts  are  also   worthwhile     hSp://www.cheezyworld.com/ 2011/07/29/introducing-­‐page-­‐ object-­‐gem/   Official  documenta$on   •  PageObject  is  a  gem.   •  Like  most  gems,  it  and  its   documenta;on  can  be  found  on   GitHub  (scroll  down)   hSps://github.com/cheezy/page-­‐ object   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  48  
  • 49. Resources  –  Free  Detailed  Demo   Cheezy's  Demo  Tes$ng  Puppies  Site   •  Uses  RubyMine  IDE,  but  other   editors  or  IDEs  work  fine   •  Covers  a  later  example  from   Cucumber  and  Cheese  book  resource   •  1  hour  10  minute  YouTube  video   hSps://www.youtube.com/watch? v=zpt15XIjpas   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  49  
  • 50. Resources  –  Ruby  Books   If  Ruby  Monk  is  too  challenging,  try  Learn  to  Program   •  For  those  who  haven't  programmed  before  (most  manual   testers)   –  Learn  to  Program  -­‐  Second  Edi$on  by  Chris  Pine   •  For  those  who  know  object-­‐oriented  programming  in  some   other  language  (includes  more  Ruby  than  most  testers  will   need)   –  Programming  Ruby  1.9  &  2.0  by  Dave  Thomas   •  For  a  problem-­‐based  approach  to  wri;ng  small  pieces  of   Ruby  that  do  useful  things   –  Everyday  Scrip$ng  with  Ruby  by  Brian  Marick   cbell@CamilleBellConsul$ng.com                                                                                                                                                                                                                                                                  50   Available  from  Amazon  or  the  Pragma;c  Bookstore  hSps://pragprog.com/  
  • 51. Camille  Bell   Agile  Technical  &  Process  Coaching   Retrospec;ves   Agile  Boot  Camps     Agile  Training   Updated  Slides   or  just  to  chat  about  things  agile   cbell@CamilleBellConsul$ng.com   Twi2er  @agilecamille