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.

The Test Pyramid

3,454 views

Published on

How to balance your automated test suite to have a good feedback, from units to end-to-end tests.

Published in: Technology, Education
  • Login to see the comments

The Test Pyramid

  1. 1. The Test Pyramid Thiago Ghisi @thiagoghisi How to balance your test suite to have a good feedback, from units to end-to-end tests.
  2. 2. 2002 2007 2010
  3. 3. [ Tests, seriously? It’s a mobile app... ]
  4. 4. 108 Shared codebases
  5. 5. 144 Devs, QAs and Ops
  6. 6. January, 2009 Brian Marick @marick http://www.slideshare.net/jezhumble/creating-maintainable-automated-acceptance-tests
  7. 7. October, 2009 Mike Cohn @mikewcohn http://www.slideshare.net/jezhumble/creating-maintainable-automated-acceptance-tests
  8. 8. http://www.slideshare.net/jezhumble/creating-maintainable-automated-acceptance-tests
  9. 9. August, 2010 Jez Humble @jezhumble
  10. 10. Feedback
  11. 11. [ Perfect!!! Let’s follow the test pyramid guidelines… ]
  12. 12. easy. :-) really hard to isolate the dependencies. :-( 20% of code coverage. :-(
  13. 13. Functional Tests • UI/End-to-end testing [with full stack] • Tests user flow • BDD, ATDD • Feedback after a coffee sounds perfect business likes that ;)
  14. 14. Cucumber feature file
  15. 15. Honeydew steps
  16. 16. Cucumber + Honeydew step definitions in Ruby wraps UIAutomator = ] https://github.com/amplify-education/honeydew ☺
  17. 17. why cucumber? https://speakerdeck.com/nicholaspufal/why-bdd-is-misunderstood
  18. 18. [ Cool.. write as much user-like tests as you can… PERFECT!! ]
  19. 19. UI test results history (1)
  20. 20. UI test results history (2)
  21. 21. UI test results history (3)
  22. 22. Slow Flaky / Fragile Costy
  23. 23. Feedback
  24. 24. the build monkey
  25. 25. http://watirmelon.com/tag/software-testing-pyramid/
  26. 26. Few UI tests
  27. 27. [ OK… let’s do it right now… ]
  28. 28. Unit Test • Verify small pieces individually • Run fast • Stable • Run a lot of times during development • Feedback instantly
  29. 29. Unit tests results history
  30. 30. Feedback
  31. 31. Android? It’s Java, let’s TDD.
  32. 32. Android TDD Android SDK classes are not trivial huge API eyes on docs java.lang.RuntimeException: Stub!
  33. 33. test object result() assert(expected, obj.result()) Humm, I’ve seen that.. The ‘2 + 2 = 4’ example!
  34. 34. the object u’re looking at dependencies
  35. 35. getData() saveSomething()
  36. 36. when(stub.getData()).thenReturn(data) getData() saveSomething() verify(mock).saveSomething()
  37. 37. mock fake double stub dummy http://martinfowler.com/articles/mocksArentStubs.html
  38. 38. Unit Tests with Dependency injection Roboguice DI Mocks Robolectric Android Shadows jUnit @Test
  39. 39. Lots of Unit tests
  40. 40. Where are you? http://www.mountaingoatsoftware.com/blog/the-forgotten-layer-of-the-test-automation-pyramid
  41. 41. http://fabiopereira.me/blog/2012/03/18/introducing-depth-of-test-dot/
  42. 42. backend external services libs
  43. 43. API contracts validation PACTO https://github.com/thoughtworks/pacto https://speakerdeck.com/marcosccm/evoluindo-ecossistemas-com-consumer-driven-contracts
  44. 44. Service/Integration tests instead of end-to-end tests
  45. 45. [ Annnnd.. the manual tests? ]
  46. 46. Session based exploratory/usability tests
  47. 47. http://blog.kalistick.com/Agile/harden-testing-pyramid/
  48. 48. http://watirmelon.com/2011/06/10/yet-another-software-testing-pyramid/
  49. 49. http://blog.softed.com/2013/08/26/1883/
  50. 50. Test automation closer to the user Testing on the level of the users incl. browser, network, databases, external systems, … User Journey UI Connection of UI tests to a persona like flow through the system $$$ slower fewer Integration Tests of multiple integrated method Unit Tests of single methods without dependencies $ faster more closer to the developer https://my.thoughtworks.com/docs/DOC-21002
  51. 51. http://www.slideshare.net/nashjain/inverting-the-testing-pyramid
  52. 52. http://www.slideshare.net/guestc8adce/pivotal-labs-open-view-presentation-quality-assurance-and-developer-testing-presentation
  53. 53. http://blog.codeclimate.com/blog/2013/10/09/rails-testing-pyramid/
  54. 54. Feedback
  55. 55. Feedback
  56. 56. http://herdingcats.typepad.com/my_weblog/2011/02/a-radical-book.html
  57. 57. Thank you! ;) Questions? Feedback? A beer? THIAGO GHISI @thiagoghisi tghisi@thoughtworks.com

×