Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Two Types of Tests
Unit tests on Android fall into two buckets: JVM tests and instrumented tests. JVM tests execute on your development machine (that is, your laptop or desktop) through a JVM. Instrumented tests execute directly on an Android device. Each type of test has benefits and downsides, so you will find that you use both depending on what you need at a particular point in development.
JVM tests can complete execution in milliseconds, while instrumented tests are orders of magnitude slower and can take seconds to complete. On the flip side, since instrumented tests execute directly on the device that runs your app, you can be confident that the tests accurately represent what will happen when users interact with your app. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access