40
Behavior Driven Tes.ng (BDT) Workshop

Anand Bagmar BDT Workshop Bangalore - May2013

  • View
    191

  • Download
    2

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Anand Bagmar BDT Workshop Bangalore - May2013

Behavior  Driven  Tes.ng  (BDT)  Workshop  

Page 2: Anand Bagmar BDT Workshop Bangalore - May2013

Intent  of  workshop  

•  Learn  by  experience  

Page 3: Anand Bagmar BDT Workshop Bangalore - May2013

Structure  of  workshop  

•  Few  slides  •  Few  exercises  based  on  case  study  •  Lots  of  interac:ons  •  Homework  

Page 4: Anand Bagmar BDT Workshop Bangalore - May2013

Behavior  Driven  Development    (BDD)  

Page 5: Anand Bagmar BDT Workshop Bangalore - May2013

RED  

GREEN  REFACTOR  

Page 6: Anand Bagmar BDT Workshop Bangalore - May2013

Behavior  Driven  Tes:ng  (BDT)  

Page 7: Anand Bagmar BDT Workshop Bangalore - May2013

Expected  Func,onality:  

 

The  customer  should  be  able  to  withdraw  money  from  his  account  via  an  ATM  machine  

Page 8: Anand Bagmar BDT Workshop Bangalore - May2013

Given  the  account  has  balance  of  5000  When  the  customer  requests  1000  Then  the  account  is  debited  by  1000  

BDD  Example:  

Page 9: Anand Bagmar BDT Workshop Bangalore - May2013

Given  the  account  is  in  credit  

And  the  dispenser  contains  cash  

 

When  the  customer  requests  cash  

 

Then  ensure  the  account  is  debited  

And  ensure  cash  is  dispensed  

And  ensure  the  card  is  returned  

BDT  Example:  

Page 10: Anand Bagmar BDT Workshop Bangalore - May2013

Case  Study  

Page 11: Anand Bagmar BDT Workshop Bangalore - May2013
Page 12: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  1  Requirements  

•  Guest  User  is  able  to  search  for  a  flight  for  a  single  traveller  

•  Ability  to  specify  contact  informa:on  for  person  booking  the  flight  

Page 13: Anand Bagmar BDT Workshop Bangalore - May2013

Search    Search  Results  

Contact  Informa,on  

Page 14: Anand Bagmar BDT Workshop Bangalore - May2013

Search  Module�

Page 15: Anand Bagmar BDT Workshop Bangalore - May2013

Search  Results  

Page 16: Anand Bagmar BDT Workshop Bangalore - May2013

Contact  Details  

Page 17: Anand Bagmar BDT Workshop Bangalore - May2013

Contact  Details  

Page 18: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  1  Requirements  

•  Guest  User  is  able  to  search  for  a  flight  for  a  single  traveller  

•  Ability  to  specify  contact  informa:on  for  person  booking  the  flight  

Page 19: Anand Bagmar BDT Workshop Bangalore - May2013

Search    Search  Results  

Contact  Informa,on  

Page 20: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  1  -­‐  Showcase  

Page 21: Anand Bagmar BDT Workshop Bangalore - May2013

Test  specifica:on  styles  

•  Impera:ve    •  Declara:ve  

Page 22: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  1  Requirements  

•  Guest  User  is  able  to  search  for  a  flight  for  a  single  traveller  

•  Ability  to  specify  contact  informa:on  for  person  booking  the  flight  

Page 23: Anand Bagmar BDT Workshop Bangalore - May2013

Impera:ve  style  Given  I  am  a  guest  user  on  the  Indigo  home  page  And  I  select  round  trip  op:on  And  I  select  Pune  from  the  origin  dropdown  And  I  select  Bangalore  from  the  des:na:on  drop  down  And  I  select  departure  date  as  5  July  2012  And  I  select  returning  date  as  25  July  2012    When  I  click  on  Search    Then  I  should  see  the  search  results  page    And  I  should  see  at  least  1  op:on  for  my  criteria    ...    

Page 24: Anand Bagmar BDT Workshop Bangalore - May2013

…  When  I  select  the  first  op:on  Then  I  am  on  the  Contact  Informa:on  page    When  I  enter  first  name  as  foo  And  I  enter  last  name  as  bar  …  …  And  I  click  the  Select  and  Con,nue  buVon    Then  I  should  be  on  the  next  page    

Page 25: Anand Bagmar BDT Workshop Bangalore - May2013

Given  I,  a  guest  user,  search  for  flight  op:ons  for  a  one-­‐way  trip  for  1  Adult    When  I  select  the  first  flight  And  I  enter  valid  contact  details    Then  I  am  able  to  Save  and  Con:nue  

Declara:ve  style  

Page 26: Anand Bagmar BDT Workshop Bangalore - May2013

Given  I,  a  guest  user,  search  for  flight  op:ons  for  a  one-­‐way  trip  for  1  Adult  from  Delhi  to  Bangalore    When  I  select  the  first  flight  And  I  enter  valid  contact  details  for  traveller1    Then  I  am  able  to  Save  and  Con:nue  

Declara:ve  style  

Page 27: Anand Bagmar BDT Workshop Bangalore - May2013

Case  Study  -­‐  updated  

Page 28: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  2  Requirements  

•  User  registra:on  possible  now  from  Contact  informa:on  page  

•  Registered  user  can  login  from  home  page  (below  search  criteria)  

•  When  booking  :cket,  contact  informa:on  pre-­‐filled  based  on  the  logged  in  user  informa:on  

Page 29: Anand Bagmar BDT Workshop Bangalore - May2013

Registered  User  

Page 30: Anand Bagmar BDT Workshop Bangalore - May2013
Page 31: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  2  Requirements  

•  User  registra:on  possible  now  from  Contact  informa:on  page  

•  Registered  user  can  login  from  home  page  (below  search  criteria)  

•  When  booking  :cket,  contact  informa:on  pre-­‐filled  based  on  the  logged  in  user  informa:on  

Page 32: Anand Bagmar BDT Workshop Bangalore - May2013

Login   Search    Search  Results  

Contact  Informa,on  

• User  registra,on  

Page 33: Anand Bagmar BDT Workshop Bangalore - May2013

Phase  2  -­‐  Showcase  

Page 34: Anand Bagmar BDT Workshop Bangalore - May2013

Given  I,  as  a  guest  user,  search  for  flight  op:ons  for  a  one-­‐way  trip  for  1  Adult    When  I  select  the  first  flight  And  I  enter  valid  contact  details  And  I  register  myself  as  user  [email protected]    Then  I  am  able  to  Save  and  Con:nue    When  I  re-­‐login  as  user  [email protected]  And  I  search  for  and  select  some  flight  op:on  Then  I  should  see  my  contact  details  pre-­‐populated  

Page 35: Anand Bagmar BDT Workshop Bangalore - May2013

Given  I,  a  registered  user  [email protected],  search  for  flight  op:ons  for  a  one-­‐way  trip  for  1  Adult  from  Delhi  to  Bangalore    When  I  select  the  first  flight  And  I  enter  invalid  contact  details  for  traveller1  Then  I  should  not  be  able  to  proceed  to  passenger  details    When  I  enter  valid  contact  details  for  traveller1  And  I  enter  valid  passenger  details  for  traveller1  And  I  enter  my  Visa  card  details  to  make  the  payment    Then  my  flight  is  booked    And  I  get  the  email  confirma:on  on  the  registered  email  address  

Page 36: Anand Bagmar BDT Workshop Bangalore - May2013

A  prac:ce  that  makes  Agile  Teams    successful  

Test  Automa.on  

Page 37: Anand Bagmar BDT Workshop Bangalore - May2013

A  prac:ce  that  makes  Agile  Tes:ng  unsuccessful  

Test  Automa.on  

Page 38: Anand Bagmar BDT Workshop Bangalore - May2013

Ideal  Test  Pyramid  

Page 39: Anand Bagmar BDT Workshop Bangalore - May2013

What  does  BDT  do  for  me?  

Page 40: Anand Bagmar BDT Workshop Bangalore - May2013

hVp://essenceo]es:ng.blogspot.com/search/label/bdt  

 

Vodqa-­‐[email protected]  

Vodqa-­‐[email protected]