DroidBot
DroidBot is a class in Kea that interacts with Android devices during the application exploration phase. It mainly provides methods for generating events, taking screenshots, etc. DroidBot also provides a UTG (UI Transition Graph). Based on the event transition graph, more advanced application exploration strategies can be written using Model-Based Testing (MBT).
Note
Droidbot serves as a reference project for this initiative.
Droidbot Project Architecture
The components of the Droidbot project architecture include:
App: Used to parse Android application installation packages (.hap) or Android packages (package). Provides information such as EntryActivity.
Device: An abstraction of an Android device that provides some operational interfaces at the device level, such as sending files, inputting content, rotating the device, and retrieving the foreground application.
ADB: An abstraction of Android device adb commands, providing interfaces for interacting with the device through adb, such as shell, pull_file, etc. The Device class depends on this class.
uiautomator2: The Android device testing tool uiautomator2 provides input event functionalities for extending Droidbot.
InputManager: Input controller that provides functionalities such as strategy selection.
InputPolicy: Input strategies that provide various input strategies, such as random strategies and big model guiding strategies, used to define the rules of exploring applications.
EventLog: An abstraction of event logs that records operations before and after event input, as well as operations for sending events.
InputEvent: A class for input events, which includes click, long press, input, and other events.
UTG: A class for the UI Transition Graph (UTG) used for application modeling, which can be utilized by input strategies for more complex decisions.
DeviceState: A class for application interface abstraction that provides different levels of abstraction for application interfaces to be modeled by the UTG class.
Since InputManager and InputPolicy are closely related to Kea’s input strategies, they will be introduced in a separate section. uiautomator2 serves as a reference framework and has not been modified in development. Other functionalities are largely based on the original Droidbot, so they will not be covered in this section. Important classes will be introduced in the HMDroidbot, a version of Droidbot developed by the team.
Droidbot Architecture Diagram