Android Testing by Rebootd v2

Post on 14-Apr-2017

92 views 0 download

Transcript of Android Testing by Rebootd v2

ANDROID TESTING THAT DOESN’T

SUCK

GITHUB:REBOOTD@COMPUTERISTCO

getting started…

Joshua Coffman
Introduction, my background, invite comments and discussion.

TESTING?

@computeristcogithub:rebootd

Unit Tests?Integration Tests?UI Tests?

Joshua Coffman
Tell story of why I volunteered to do this.Ask audience about their testing experience and tools.

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

Joshua Coffman
Talk about base classes, utils, and leveraging OSS.If you are getting tired of doing it, either automate it or change it.Also, automate it regardless. Use scripts, gradle, and any tools you find helpful.Story/warning: don’t look up “friction burn” on google images.

MOCKING

@computeristcogithub:rebootd

Joshua Coffman
explain mocking for beginnersshow code snippet.Explain unit testing versus integration testing.

DEPENDENCY INJECTION

@computeristcogithub:rebootd

Diving Deeper with Dagger - Fragmented Podcasthttp://fragmentedpodcast.com/episodes/021/

Joshua Coffman
Explain DI, how and when to use it.Warning about complexity.

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

Joshua Coffman
Gradle script and build server.

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?

Joshua Coffman
discuss ui testing, get input on more material, offer to present at their company or group.

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/

Joshua Coffman
discuss ui testing, get input on more material, offer to present at their company or group.

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