0
Test Pyramid
in an

Android
Agile Project
Lima, 2013

PORTELA
PAMELA

How to balance your android test
suite to have a goo...
[

Tests, seriously? It’s a mobile app..

]
15+
Shared codebases
40+
Devs, QAs and Ops
http://martinfowler.com/bliki/TestPyramid.html
Unit Test
Verify small pieces individually

Run fast

Run a lot of times during development

Feedback instantly

6
Feedback
Android? It’s Java, let’s TDD.
Android TDD
Android SDK classes are not trivial

huge API

eyes on docs

java.lang.RuntimeException: Stub!

9
test object

result()

assert(expected, obj.result())

Humm,
I’ve seen that..
The ‘2 + 2 = 4’
example!
the object u’re looking at

dependencies
when(stub.getData()).thenReturn(data)

getData()

saveSomething()
verify(mock).saveSomething()
mock
stub
double
http://martinfowler.com/articles/mocksArentStubs.html
Unit Tests
with
Dependency
injection

Roboguice
DI

Mocks

Robolectric
Android Shadows

jUnit
@Test
Functional
Test

UI testing [with full stack]

Tests user flow

sounds perfect

BDD, ATDD

business likes that ;)
Feedback...
Cucumber
+
Honeydew
step definitions in Ruby
wraps UIAutomator
=

]

github.com/amplify-education/honeydew


Cucumber feature file
Honeydew steps
[

Cool.. write as much user-like tests
as you can.. PERFECT!!

]
Slow

Flaky
Costy
Feedback
some UI tests
Where are you?
http://fabiopereira.me/blog/2012/03/18/introducing-depth-of-test-dot/
backend
external services

libs
API contracts validation
PACTO
https://github.com/thoughtworks/pacto
[

Annnnd.. the manual tests?

]
Thank you! ;)
Questions?
Feedback?
A beer?
PORTELA
@rafaelportela
rportela@thoughtworks.com
PAMELA
@pamcdm
pmori@thoughtwo...
Android Test Pyramid - Ágiles 2013
Android Test Pyramid - Ágiles 2013
Upcoming SlideShare
Loading in...5
×

Android Test Pyramid - Ágiles 2013

351

Published on

How to balance your android test suite to have a good feedback, from units to functionals.

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

No Downloads
Views
Total Views
351
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "Android Test Pyramid - Ágiles 2013"

  1. 1. Test Pyramid in an Android Agile Project Lima, 2013 PORTELA PAMELA How to balance your android test suite to have a good feedback, from units to functionals.
  2. 2. [ Tests, seriously? It’s a mobile app.. ]
  3. 3. 15+ Shared codebases
  4. 4. 40+ Devs, QAs and Ops
  5. 5. http://martinfowler.com/bliki/TestPyramid.html
  6. 6. Unit Test Verify small pieces individually Run fast Run a lot of times during development Feedback instantly 6
  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.RuntimeException: Stub! 9
  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. when(stub.getData()).thenReturn(data) getData() saveSomething() verify(mock).saveSomething()
  13. 13. mock stub double http://martinfowler.com/articles/mocksArentStubs.html
  14. 14. Unit Tests with Dependency injection Roboguice DI Mocks Robolectric Android Shadows jUnit @Test
  15. 15. Functional Test UI testing [with full stack] Tests user flow sounds perfect BDD, ATDD business likes that ;) Feedback after a coffee *not a strict definition
  16. 16. Cucumber + Honeydew step definitions in Ruby wraps UIAutomator = ] github.com/amplify-education/honeydew 
  17. 17. Cucumber feature file
  18. 18. Honeydew steps
  19. 19. [ Cool.. write as much user-like tests as you can.. PERFECT!! ]
  20. 20. Slow Flaky Costy
  21. 21. Feedback
  22. 22. some UI tests
  23. 23. Where are you?
  24. 24. http://fabiopereira.me/blog/2012/03/18/introducing-depth-of-test-dot/
  25. 25. backend external services libs
  26. 26. API contracts validation PACTO https://github.com/thoughtworks/pacto
  27. 27. [ Annnnd.. the manual tests? ]
  28. 28. Thank you! ;) Questions? Feedback? A beer? PORTELA @rafaelportela rportela@thoughtworks.com PAMELA @pamcdm pmori@thoughtworks.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×