Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Anand Bagmar BDT Workshop Bangalore - May2013

426 views

Published on

Published in: Technology, Design
  • Be the first to comment

  • Be the first to like this

Anand Bagmar BDT Workshop Bangalore - May2013

  1. 1. Behavior  Driven  Tes.ng  (BDT)   Workshop  
  2. 2. Intent  of  workshop   •  Learn  by  experience  
  3. 3. Structure  of  workshop   •  Few  slides   •  Few  exercises  based  on  case  study   •  Lots  of  interac:ons   •  Homework  
  4. 4. Behavior  Driven  Development     (BDD)  
  5. 5. RED   GREEN  REFACTOR  
  6. 6. Behavior  Driven  Tes:ng   (BDT)  
  7. 7. Expected  Func,onality:     The  customer  should  be  able  to  withdraw   money  from  his  account  via  an  ATM  machine  
  8. 8. Given  the  account  has  balance  of  5000   When  the  customer  requests  1000   Then  the  account  is  debited  by  1000   BDD  Example:  
  9. 9. 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:  
  10. 10. Case  Study  
  11. 11. 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  
  12. 12. Search     Search   Results   Contact   Informa,on  
  13. 13. Search  Module
  14. 14. Search  Results  
  15. 15. Contact  Details  
  16. 16. Contact  Details  
  17. 17. 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  
  18. 18. Search     Search   Results   Contact   Informa,on  
  19. 19. Phase  1  -­‐  Showcase  
  20. 20. Test  specifica:on  styles   •  Impera:ve     •  Declara:ve  
  21. 21. 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  
  22. 22. 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     ...  
  23. 23. …   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    
  24. 24. 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  
  25. 25. 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  
  26. 26. Case  Study  -­‐  updated  
  27. 27. 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  
  28. 28. Registered  User  
  29. 29. 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  
  30. 30. Login   Search     Search   Results   Contact   Informa,on   • User   registra,on  
  31. 31. Phase  2  -­‐  Showcase  
  32. 32. 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  foo@bar.com     Then  I  am  able  to  Save  and  Con:nue     When  I  re-­‐login  as  user  foo@bar.com   And  I  search  for  and  select  some  flight  op:on   Then  I  should  see  my  contact  details  pre-­‐populated  
  33. 33. Given  I,  a  registered  user  foo@bar.com,  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  
  34. 34. A  prac:ce  that  makes  Agile  Teams     successful   Test  Automa.on  
  35. 35. A  prac:ce  that  makes  Agile  Tes:ng   unsuccessful   Test  Automa.on  
  36. 36. Ideal  Test  Pyramid  
  37. 37. What  does  BDT  do  for  me?  
  38. 38. hVp://essenceo]es:ng.blogspot.com/search/label/bdt     Vodqa-­‐pune@thoughtworks.com   Vodqa-­‐bangalore@thoughtworks.com  

×