-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Android Testing Options
Automated Testing is an important topic that helps us ensure quality when building Android apps. There are many different testing tools and frameworks we can use while developing Android apps. This guide will take a look at some of the more popular approaches available.
Unit testing is about testing a particular component (i.e activity) in isolation of other components.
- Robolectric - Popular Android unit test framework that allows faster test execution by running tests on the JVM (no device or emulator needed).
- JUnit - Popular Java unit test framework. Most of the Android test frameworks are built on top of JUnit.
- Espresso - Extensible Android UI Test Framework provided by Google that handles test synchronization very well.
- UIAutomator - Android UI Test Framework provided by Google for testing across multiple apps at the same time.
- Google Android Testing - This is the testing framework included as part of the platform (even Google doesn't seem to use this).
- Robotium - Third party Android UI Test Framework (comparison with Espresso).
- Selendroid - Selenium for Android.
- Assertj-Android - An extension of AssertJ (fluent assertions for Java) extended for Android (formerly known as FEST Android).
- MoreAsserts - Extension of JUnit assertions to add assertions for sets, lists, etc.
- ViewAsserts - Platform provided helper methods to validate view layout.
- Mockito - Popular mocking framework for Java unit testing.
- EasyMock - Mocking framework that also has record / replay support.
- MonkeyRunner - API Toolkit that allows controlling the Android device from Python code.
- Monkey - Program that runs on the device and does random clicks, typing text, etc.
- Cloud Test Lab - Large bank of devices that you can submit your tests too and have them run across a large range of different devices.
- Spoon - Run your tests across multiple devices at the same time and see aggregated reports.
Created by CodePath with much help from the community. Contributed content licensed under cc-wiki with attribution required. You are free to remix and reuse, as long as you attribute and use a similar license.
Finding these guides helpful?
We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.
Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.