Test pyramid in an Android Agile Project - TDC2013

1,188 views
1,043 views

Published on

Slides created originally by @rafaelportela to Ágiles 2013 Perú and adapted to our presentation at TDC (The Developer's Conference) 2013 Porto Alegre.
How to balance your android test suite to have a good feedback, from units to end-to-end tests.

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

No Downloads
Views
Total views
1,188
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
4
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Test pyramid in an Android Agile Project - TDC2013

  1. 1. Test Pyramid in an Android Agile Project PORTELA GHISI How to balance your android test suite to have a good feedback, from units to end-to-end tests.
  2. 2. [   Tests,  seriously?  It’s  a  mobile  app...   ]  
  3. 3. 15+   Shared  codebases  
  4. 4. 40+   Devs,  QAs  and  Ops    
  5. 5. h6p://mar:nfowler.com/bliki/TestPyramid.html  
  6. 6. Unit Test •  Verify small pieces individually •  Run fast •  Run a lot of times during development •  Feedback instantly  
  7. 7. Feedback  
  8. 8. Android?  It’s  Java,  let’s  TDD.  
  9. 9. Android TDD Android SDK classes are not trivial huge  API   eyes  on  docs   java.lang.Run:meExcep:on:  Stub!    
  10. 10. test object result() assert(expected, obj.result()) Humm,        I’ve  seen  that..     The  ‘2  +  2  =  4’                            example!    
  11. 11. the object u’re looking at dependencies
  12. 12. getData() saveSomething()
  13. 13. when(stub.getData()).thenReturn(data) getData() saveSomething() verify(mock).saveSomething()
  14. 14. mock   stub   double   h6p://mar:nfowler.com/ar:cles/mocksArentStubs.html  
  15. 15. Unit  Tests   with   Dependency     injec:on   Roboguice   DI   Mocks   Robolectric   Android  Shadows   jUnit   @Test  
  16. 16. Func:onal   Test   UI testing [with full stack] •  Tests user flow •  BDD, ATDD •  *not  a  strict  defini:on   •  Feedback after a coffee sounds  perfect   business  likes  that  ;)    
  17. 17. Cucumber + Honeydew step definitions in Ruby wraps UIAutomator ] = github.com/amplify-­‐educa:on/honeydew   ☺
  18. 18. Cucumber  feature  file  
  19. 19. Honeydew  steps  
  20. 20. why   cucumber?   https://speakerdeck.com/nicholaspufal/why-bdd-is-misunderstood
  21. 21. [   Cool..  write  as  much  user-­‐like  tests                          as  you  can..      PERFECT!!   ]  
  22. 22. Unit  tests  results  history  
  23. 23. UI  test  results  history  (1)  
  24. 24. UI  test  results  history  (2)  
  25. 25. Slow   Flaky       Costy  
  26. 26. Feedback    
  27. 27. the  build  keeper  
  28. 28. some  UI  tests    
  29. 29. Where  are  you?   h6p://www.mountaingoatsoXware.com/blog/the-­‐forgo6en-­‐layer-­‐of-­‐the-­‐test-­‐automa:on-­‐pyramid  
  30. 30. h6p://fabiopereira.me/blog/2012/03/18/introducing-­‐depth-­‐of-­‐test-­‐dot/  
  31. 31. backend   external  services   libs  
  32. 32. API  contracts  validaJon   PACTO   h6ps://github.com/thoughtworks/pacto   h6ps://speakerdeck.com/marcosccm/evoluindo-­‐ecossistemas-­‐com-­‐consumer-­‐driven-­‐contracts  
  33. 33. [   Annnnd..  the  manual  tests?   ]  
  34. 34. http://blog.kalistick.com/Agile/harden-testing-pyramid/
  35. 35. http://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/
  36. 36. Feedback  
  37. 37. Thank you! ;) Questions? Feedback? A beer? PORTELA @rafaelportela rportela@thoughtworks.com GHISI @thiagoghisi tghisi@thoughtworks.com

×