ANDROID TESTING THAT DOESN’T
SUCK
GITHUB:REBOOTD@COMPUTERISTCO
getting started…
TESTING?
@computeristcogithub:rebootd
Unit Tests?Integration Tests?UI Tests?
TESTING?
Helps solving problemsFind bugs fasterFaster development speedCleaner code
@computeristcogithub:rebootd
TESTING?
Helps solving problemsFind bugs fasterFaster development speedCleaner code
BUT I WON’T DO IT IF IT SUCKS
@computeristcogithub:rebootd
BECAUSE PHILOSOPHY…
@computeristcogithub:rebootd
TOOLS
@computeristcogithub:rebootd
TOOLS
jUnit
@computeristcogithub:rebootd
TOOLS
jUnit Espresso
@computeristcogithub:rebootd
TOOLS
jUnit Espresso
UIAutomator
@computeristcogithub:rebootd
TOOLS
jUnit Espresso
UIAutomatorMonkey
@computeristcogithub:rebootd
TOOLS
jUnit Espresso
UIAutomatorMonkeyRobotium
@computeristcogithub:rebootd
TOOLS
jUnit Espresso
UIAutomatorMonkeyRobotium
Robolectric@computeristcogithub:rebootd
HOW DO I MAKE IT EASY
@computeristcogithub:rebootd
• Base classes• Mocking• DI• OSS• Gradle scripts• Build Server
Just say no to “friction burn” image search
MOCKING
@computeristcogithub:rebootd
DEPENDENCY INJECTION
@computeristcogithub:rebootd
Diving Deeper with Dagger - Fragmented Podcasthttp://fragmentedpodcast.com/episodes/021/
CODE COVERAGE
@computeristcogithub:rebootd
JaCoCo: https://docs.gradle.org/current/userguide/jacoco_plugin.html
START WRITING TESTS
@computeristcogithub:rebootd
Keep it really simple at first
Reality Check.Getting started is the hardest part when you’re the only developer.
Getting buy-in is the hardest part when you work on a team.
Also: If you are getting tired of doing it, so is the team.
START WRITING TESTS
@computeristcogithub:rebootd
Then do something more meaningful, but still simple
RUNNING YOUR TESTS
@computeristcogithub:rebootd
RUNNING YOUR TESTS
@computeristcogithub:rebootd
BUILD SERVER INTEGRATION
@computeristcogithub:rebootd
WATCH OUT FOR…
@computeristcogithub:rebootd
• flavors• unsupported api features• slow tests• asynchronous can’t be tested• SSL certificate issue with api calls
sometimes
WHAT ELSE?
@computeristcogithub:rebootd
UI Testing and build servers?Appium?Monkey Runner?UI Automator?Ranorex?Selendroid?
LINKS AND REFERENCES
@computeristcogithub:rebootd
Code:https://github.com/rebootd/ComputeristReader
GDE’s:https://github.com/chiukihttps://github.com/donnfelker
Articles & Sampleshttps://github.com/googlesamples/android-testinghttp://www.meetup.com/DenverDroids/events/224537126/http://blog.sqisland.com/2015/10/how-i-prepared-my-keynote.htmlhttp://www.donnfelker.com/materials-from-hdc09-testing-with-mocks-talk/http://www.donnfelker.com/integration-testing/
TO BE CONTINUED…
@computeristcogithub:rebootd
Resources:http://slides….https://github.com/rebootd/ComputeristReader
Contact:http://computerist.cohttps://github.com/rebootdhttps://twitter.com/computeristco
Ask me about presenting
for your group