android testing talk by rebootd v2

25
ANDROID TESTING THAT DOESN’T SUCK GITHUB:REBOOTD @COMPUTERISTCO getting started…

Upload: re-bootd

Post on 18-Jan-2017

252 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Android Testing Talk by Rebootd v2

ANDROID TESTING THAT DOESN’T

SUCK

GITHUB:REBOOTD@COMPUTERISTCO

getting started…

Joshua Coffman
Introduction, my background, invite comments and discussion.
Page 2: Android Testing Talk by Rebootd v2

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.
Page 3: Android Testing Talk by Rebootd v2

TESTING?

Helps solving problemsFind bugs fasterFaster development speedCleaner code

@computeristcogithub:rebootd

Page 4: Android Testing Talk by Rebootd v2

TESTING?

Helps solving problemsFind bugs fasterFaster development speedCleaner code

BUT I WON’T DO IT IF IT SUCKS

@computeristcogithub:rebootd

Page 5: Android Testing Talk by Rebootd v2

BECAUSE PHILOSOPHY…

@computeristcogithub:rebootd

Page 6: Android Testing Talk by Rebootd v2

TOOLS

@computeristcogithub:rebootd

Page 7: Android Testing Talk by Rebootd v2

TOOLS

jUnit

@computeristcogithub:rebootd

Page 8: Android Testing Talk by Rebootd v2

TOOLS

jUnit Espresso

@computeristcogithub:rebootd

Page 9: Android Testing Talk by Rebootd v2

TOOLS

jUnit Espresso

UIAutomator

@computeristcogithub:rebootd

Page 10: Android Testing Talk by Rebootd v2

TOOLS

jUnit Espresso

UIAutomatorMonkey

@computeristcogithub:rebootd

Page 11: Android Testing Talk by Rebootd v2

TOOLS

jUnit Espresso

UIAutomatorMonkeyRobotium

@computeristcogithub:rebootd

Page 12: Android Testing Talk by Rebootd v2

TOOLS

jUnit Espresso

UIAutomatorMonkeyRobotium

Robolectric@computeristcogithub:rebootd

Page 13: Android Testing Talk by Rebootd v2

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.
Page 14: Android Testing Talk by Rebootd v2

MOCKING

@computeristcogithub:rebootd

Joshua Coffman
explain mocking for beginnersshow code snippet.Explain unit testing versus integration testing.
Page 15: Android Testing Talk by Rebootd v2

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.
Page 16: Android Testing Talk by Rebootd v2

CODE COVERAGE

@computeristcogithub:rebootd

JaCoCo: https://docs.gradle.org/current/userguide/jacoco_plugin.html

Page 17: Android Testing Talk by Rebootd v2

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.

Page 18: Android Testing Talk by Rebootd v2

START WRITING TESTS

@computeristcogithub:rebootd

Then do something more meaningful, but still simple

Page 19: Android Testing Talk by Rebootd v2

RUNNING YOUR TESTS

@computeristcogithub:rebootd

Joshua Coffman
Gradle script and build server.
Page 20: Android Testing Talk by Rebootd v2

RUNNING YOUR TESTS

@computeristcogithub:rebootd

Page 21: Android Testing Talk by Rebootd v2

BUILD SERVER INTEGRATION

@computeristcogithub:rebootd

Page 22: Android Testing Talk by Rebootd v2

WATCH OUT FOR…

@computeristcogithub:rebootd

• flavors• unsupported api features• slow tests• asynchronous can’t be tested• SSL certificate issue with api calls

sometimes

Page 23: Android Testing Talk by Rebootd v2

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.
Page 24: Android Testing Talk by Rebootd v2

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.
Page 25: Android Testing Talk by Rebootd v2

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