Test	  Driven	  Development	                via	           Agile	  Tes2ng	  
What	  is	  Tes*ng	  on	  Agile	  projects?	  
Itera&on	  0	            Itera&on	  1	          Itera&on	  2	          Itera&on	  3	   ..	     ..	     Itera&on	  n	      ...
Story	  planning	                                          and	  wri&ng	                 Showcase	                        ...
What	  makes	  Agile	  Teams	  	          successful?	  Test	  Automa2on	  
What	  makes	  Agile	  Tes*ng	         unsuccessful?	  Test	  Automa2on	  
The	  Test	  Pyramid	  •  “Succeeding	  with	  Agile”	  –	  Mike	  Cohn	  •  Mar*n	  Fowler	  –	  Test	  Pyramid	      –  ...
Ideal	  Test	  Pyramid	  
Test	  Pyramid	  reality	  Development	  team	  Test	  Pyramid	                 QA	  team	                                ...
Test	  Pyramid	  –	  An*	  PaCern	  
Case	  Study	                      •  Mul*ple,	  long	                         running	  projects	                      • ...
Its	  not	  what	  I	  said,	  its	  what	  I	          mean!	  
•  Remove	  the	  ambiguity	  •  Same	  visibility	  for	  all	  
Evolu*on	  of	  Test	  Frameworks	                  Behavior	                   Driven	                Development	       ...
Behavior	  Driven	  Development	  	                 (BDD)	  
RED	  REFACTOR	               GREEN	  
Behavior	  Driven	  Tes*ng	            (BDT)	  
Expected	  Func&onality:	  	  The	  customer	  should	  be	  able	  to	  withdraw	  money	  from	  his	  account	  via	  a...
BDD	  Example:	  Given	  the	  account	  has	  balance	  of	  INR	  5000	  When	  the	  customer	  requests	  INR	  1000	 ...
BDT	  Example:	  Given	  the	  account	  is	  in	  credit	  And	  the	  dispenser	  contains	  cash	  	  When	  the	  cust...
New	  Expected	  Func&onality:	  	  The	  customer	  should	  be	  able	  to	  withdraw	  money	  from	  his	  account	  o...
BDT	  Example	  -­‐	  updated:	  Given	  the	  account	  is	  in	  credit	  And	  the	  card	  is	  valid	  And	  the	  di...
Test	  specifica*on	  styles	  Story:	  Animal	  Submission	  	  As	  a	  Zoologist	  I	  want	  to	  add	  a	  new	  anima...
Impera*ve	  Scenario	  Given	  I	  am	  on	  the	  animal	  crea*on	  page	  	  When	  I	  fill	  in	  Name	  with	  ‘Allig...
Declara*ve	  Scenario	  Given	  I	  am	  on	  the	  animal	  crea*on	  page	  	  When	  I	  add	  a	  new	  animal	  	  Th...
What	  does	  this	  do	  for	  me?	  
How	  did	  we	  accomplish	  this?	  
Given	  auc&oneer	  creates	  a	  sale	  And	  5	  items	  are	  added	  to	  the	                                        ...
Current	  state	  Tests	  running	  on	  Hudson	  /	  Jenkins	     Since	  1st	  test	  was	  automated	  Feature	  files	 ...
Tools	  to	  enable	  BDD	  /	  BDT	  •    Cucumber	  •    JBehave	  •    SpecFlow	  •    Twist	  
Anand.Bagmar@thoughtworks.com	        abagmar@gmail.com	              ThoughtWorks®	  
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Test Driven Development via Agile Testing
Upcoming SlideShare
Loading in …5
×

Test Driven Development via Agile Testing

3,127 views

Published on

The following topics are covered:
• Overview of Agile Testing
• The Test Pyramid
• Different flavors of TDD
o BDD – Behavior Driven Development
o ATDD – Acceptance Driven Development
o BDT – Behavior Driven Testing
• Difference between BDD and BDT
• Tools that support BDT
• The value proposition of BDT

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,127
On SlideShare
0
From Embeds
0
Number of Embeds
669
Actions
Shares
0
Downloads
93
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Test Driven Development via Agile Testing

  1. 1. Test  Driven  Development   via   Agile  Tes2ng  
  2. 2. What  is  Tes*ng  on  Agile  projects?  
  3. 3. Itera&on  0   Itera&on  1   Itera&on  2   Itera&on  3   ..   ..   Itera&on  n   Story  test   Showcase   Showcase   Showcase   analysis  for   IPM   Itera2on  1,   Itera2on  2,   Itera2on  n-­‐1,   Itera2on  1   IPM   IPM   IPM   Test   Support   Support   Support   Itera&on  1   Automa&on   Itera2on  1   Itera2on  2   Itera2on  n-­‐1   Story  tes&ng   -­‐  strategy,   framework   setup,  etc.   Story  test   Itera&on  2   Itera&on  3   Itera&on  n   analysis  for   Story  tes&ng   Story  tes&ng   Story  tes&ng   Itera2on  2   Test   Test   Test   Automa&on   Automa&on   Automa&on   maint.,   maint.,   maint.,   execu&on   execu&on   execu&on   Story  test   Story  test   Story  test   analysis  for   analysis  for   analysis  for   Itera2on  3   Itera2on  4   Itera2on  n+1  
  4. 4. Story  planning   and  wri&ng   Showcase   IPM   Automa&on   (execu&on,   QA  kickoff   maintenance)   Agile  Tes2ng     in  an  Itera2on Manual  +  Exploratory   Story  kickoff   Tes&ng   BA  /  QA   Test  Scenario   Volleyball   Wri&ng   Implement  Test   Automa&on  
  5. 5. What  makes  Agile  Teams     successful?  Test  Automa2on  
  6. 6. What  makes  Agile  Tes*ng   unsuccessful?  Test  Automa2on  
  7. 7. The  Test  Pyramid  •  “Succeeding  with  Agile”  –  Mike  Cohn  •  Mar*n  Fowler  –  Test  Pyramid   –  hCp://mar*nfowler.com/bliki/TestPyramid.html  
  8. 8. Ideal  Test  Pyramid  
  9. 9. Test  Pyramid  reality  Development  team  Test  Pyramid   QA  team   Test  Pyramid  
  10. 10. Test  Pyramid  –  An*  PaCern  
  11. 11. Case  Study   •  Mul*ple,  long   running  projects   •  Legacy   applica*ons   •  Integrated  
  12. 12. Its  not  what  I  said,  its  what  I   mean!  
  13. 13. •  Remove  the  ambiguity  •  Same  visibility  for  all  
  14. 14. Evolu*on  of  Test  Frameworks   Behavior   Driven   Development   (BDD)   Op*mized   scripts   Record  &   Playback     Core   Framework  
  15. 15. Behavior  Driven  Development     (BDD)  
  16. 16. RED  REFACTOR   GREEN  
  17. 17. Behavior  Driven  Tes*ng   (BDT)  
  18. 18. Expected  Func&onality:    The  customer  should  be  able  to  withdraw  money  from  his  account  via  an  ATM  machine  
  19. 19. BDD  Example:  Given  the  account  has  balance  of  INR  5000  When  the  customer  requests  INR  1000  Then  the  account  is  debited  by  INR  1000  
  20. 20. BDT  Example:  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  
  21. 21. New  Expected  Func&onality:    The  customer  should  be  able  to  withdraw  money  from  his  account  only  if  his  card  is  valid  
  22. 22. BDT  Example  -­‐  updated:  Given  the  account  is  in  credit  And  the  card  is  valid  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  
  23. 23. Test  specifica*on  styles  Story:  Animal  Submission    As  a  Zoologist  I  want  to  add  a  new  animal  to  the  site  So  that  I  can  share  my  animal  knowledge  with  the  community  
  24. 24. Impera*ve  Scenario  Given  I  am  on  the  animal  crea*on  page    When  I  fill  in  Name  with  ‘Alligator’  And  fill  in  Genus  with  ‘Alligator’  And  check  Lay  Eggs  And  click  the  Create  buCon    Then  I  should  see  the  no*ce  ‘Thank  you  for  your  animal  submission!’  And  the  page  should  include  the  animal’s  name,  genus  and  lay’s  eggs  Reference:  hCp://wa*rmelon.com/2010/12/10/cucumber-­‐impera*ve-­‐or-­‐declara*ve-­‐that-­‐is-­‐the-­‐ques*on/  
  25. 25. Declara*ve  Scenario  Given  I  am  on  the  animal  crea*on  page    When  I  add  a  new  animal    Then  I  animal  should  be  created  successfully  Reference:  hCp://wa*rmelon.com/2010/12/10/cucumber-­‐impera*ve-­‐or-­‐declara*ve-­‐that-­‐is-­‐the-­‐ques*on/  
  26. 26. What  does  this  do  for  me?  
  27. 27. How  did  we  accomplish  this?  
  28. 28. Given  auc&oneer  creates  a  sale  And  5  items  are  added  to  the   Who  is  doing  the  sale   ac*on?            When  auc&oneer  starts  the   What  is  the  business  sale   func*onality?  And  auc&oneer  sets  a  star*ng   Ac*ons  and  bid  of  5000   verifica*ons  happen  And  buyer_1  bids   implicitly  And  buyer_2  bids   Depicts  a  user  flow    Then  auc&oneer  Sells  the  item  And  buyer_2  wins  the  item  
  29. 29. Current  state  Tests  running  on  Hudson  /  Jenkins   Since  1st  test  was  automated  Feature  files   33  Scenarios   65  Smoke  tests  execu*on  *me   15  minutes  Regression  tests  execu*on  *me   45  minutes  Test  case  repository  (manual  +   Cucumber  .feature  files  with  automated)   appropriate  tagging  Project  Management  tool   Mingle  
  30. 30. Tools  to  enable  BDD  /  BDT  •  Cucumber  •  JBehave  •  SpecFlow  •  Twist  
  31. 31. Anand.Bagmar@thoughtworks.com   abagmar@gmail.com   ThoughtWorks®  

×