Upload
rafael-portela
View
325
Download
0
Embed Size (px)
DESCRIPTION
How to balance your android test suite to have a good feedback, from units to functionals.
Citation preview
Test Pyramidin an
AndroidAgile Project
How to balance your android test suite to have a good feedback, from units to functionals.
Lima, 2013
PORTELAPAMELA
Tests, seriously? It’s a mobile app..[ ]
Shared codebases
15+
Devs, QAs and Ops
40+
http://martinfowler.com/bliki/TestPyramid.html
6
Unit Test
Verify small pieces individually
Run fast
Run a lot of times during development
Feedback instantly
Feedback
Android? It’s Java, let’s TDD.
9
Android TDD
java.lang.RuntimeException: Stub!
Android SDK classes are not trivial
eyes on docs
huge API
test object
result()
assert(expected, obj.result())
Humm, I’ve seen that..
The ‘2 + 2 = 4’ example!
the object u’re looking at
dependencies
getData()
saveSomething()
verify(mock).saveSomething()
when(stub.getData()).thenReturn(data)
http://martinfowler.com/articles/mocksArentStubs.html
mockstub
double
Unit Testswith
Dependency injection
Roboguice
Robolectric
jUnit
DI
Mocks
Android Shadows
@Test
Functional Test
UI testing [with full stack]
Tests user flow
BDD, ATDD
Feedback after a coffee
business likes that ;)
sounds perfect
*not a strict definition
Cucumber
Honeydew
wraps UIAutomator
step definitions in Ruby
+=]
github.com/amplify-education/honeydew
Cucumber feature file
Honeydew steps
Cool.. write as much user-like tests as you can.. PERFECT!![ ]
Flaky
Slow
Costy
Feedback
some UI tests
Where are you?
http://fabiopereira.me/blog/2012/03/18/introducing-depth-of-test-dot/
external services
backend
libs
API contracts validation
PACTO
https://github.com/thoughtworks/pacto
Annnnd.. the manual tests?[ ]
Thank you! ;)
PORTELA@rafaelportela [email protected]
PAMELA@[email protected]
Questions?
Feedback?
A beer?