Project: /_project.yaml Book: /_book.yaml
{% include “_versions.html” %}
This content is geared toward Android platform developers. Before understanding how testing is done on the Android platform, please refer to the Android platform architecture for an overview.
The Test Development Workflow subsection now contains introductory materials including end-to-end examples for all primary test types.
The Soong build system was introduced in Android 8.0 (Oreo) with support for android_test
arriving in Android Q, now available in the Android Open Source Project (AOSP) master branch. Soong's Blueprint-based configuration is far simpler than the previous Make solution.
Atest is a command line tool that allows users to build, install and run Android tests locally. It is the recommended standard for initial testing of your feature.
A platform test typically interacts with one or more of the Android system services, or Hardware abstraction layer (HAL) layers, exercises the functionalities of the subject under test, and asserts correctness of the testing outcome.
As such, a platform test may:
Types 1 and 2 are typically written as instrumentation tests, while type 3 are usually written as native tests using the gtest{: .external} framework.
To learn more, see our end-to-end examples:
Become familiar with these tools, as they are intrinsic to testing in Android.
Android Compatibility Test Suite is a suite of various types of tests, used to ensure compatibility of Android framework implementations across OEM partners, and across platform releases. The suite also includes instrumentation tests and native tests (also using gtest framework).
CTS and platform tests are not mutually exclusive, and here are some general guidelines:
The Vendor Test Suite (VTS) automates HAL and OS kernel testing. To use VTS to test an Android native system implementation, set up a testing environment then test a patch using a VTS plan.
Trade Federation (tradefed or TF for short) is a continuous test framework designed for running tests on Android devices. TF can run functional tests locally, at your desk, within your platform checkout. There are two required files to run a test in TF, a java test source and an XML config. See RebootTest.java{: .external} and reboot.xml{: .external} for examples.
The Debugging section summarizes useful tools and related commands for debugging, tracing, and profiling native Android platform code when developing platform-level features.