Android applications declare their main components in the AndroidManifest.xml file. Components can be of four different types:
Activities are the components in charge of an app’s user interface.
Each activity is a window containing various UI elements, such
as buttons and text areas. Developers can control the behavior
of each activity by implementing appropriate callbacks for each
life-cycle phase (i.e., created, paused, resumed, and destroyed).
Activities react to user input events, such as clicks, and consequently
are the primary target of testing tools for Android.
Services are application components that can perform longrunning
operations in the background. Unlike activities, they do
not provide a user interface, and consequently, they are usually
not a direct target of Android testing tools, although they might
be indirectly tested through some activities.
Broadcast Receivers and Intents allow inter-process communication.
Applications can register broadcast receivers to be
notified, by means of intents, about specific system events. Apps
can thus, for instance, react whenever a new SMS is received, a
new connection is available, or a new call is being made. Broadcast receivers can either be declared in the manifest file or at
runtime, in the application code. In order to properly explore the
behavior of an app, testing tools should be aware of what are the
relevant broadcast receivers, so that they could trigger the right
intents.
Content Providers act as a structured interface to shared data
stores, such as contacts and calendar databases. Applications may
have their own content providers and may make them available to
other apps. Like all software, the behavior of an app may highly
depend on the state of such content providers (e.g., on whether
the list of contacts is empty or it contains duplicates). As a
consequence, testing tools should “mock” content providers in an
attempt to make tests deterministic and achieve higher coverage
of an app’s behavior.
Paper: Automated Test Input Generation for Android: Are We There Yet?