Intelligent Android Exploration Tool (IAET): UI‑Driven Automated Testing, Algorithms, Implementation, and Evaluation
This article presents IAET, an intelligent Android exploration tool that detects UI elements, applies graph‑based traversal algorithms with similarity optimizations, implements a bridge using UiAutomator and app_process, and demonstrates superior crash‑detection and activity‑coverage performance compared with the APE benchmark across major Chinese apps.
The paper introduces IAET (Intelligence Android Exploration Tool), a smart automation framework designed to increase QA efficiency for rapidly released Android apps by intelligently detecting clickable UI elements and exploring more pages and execution paths than traditional random tools like Monkey.
UI‑driven layer : Using Google’s UiAutomator, IAET obtains the active window hierarchy via UiAutomation#getRootInActiveWindow() and recursively collects all clickable nodes. Example code for extracting clickable views:
public static void getCurrentAllClickViews(AccessibilityNodeInfo nodeInfo, List
list) {
if (nodeInfo == null) return;
if (isVisible(nodeInfo)) {
if (nodeInfo.isClickable() && notEditText(nodeInfo)) {
list.add(nodeInfo);
}
if (nodeInfo.getChildCount() != 0) {
for (int i = 0; i < nodeInfo.getChildCount(); i++) {
getCurrentAllClickViews(nodeInfo.getChild(i), list);
}
}
}
}To run UiAutomator tests, a Java bridge class is created and executed with app_process :
public class UiTestAutomationBridge {
public void connect() {
// ... initialization ...
mUiAutomation = new UiAutomation(mHandlerThread.getLooper(), new UiAutomationConnection());
mUiAutomation.connect();
// ... set service info ...
}
public AccessibilityNodeInfo getRootInActiveWindow() {
return mUiAutomation.getRootInActiveWindow();
}
}The main entry point pushes the compiled JAR to the device and starts it:
adb shell CLASSPATH='/data/local/tmp/iAET.jar' '/system/bin/app_process' '/data/local/tmp/iAET.jar' com.testing.MainExploration Algorithm 1.0 : The app is modeled as a graph where nodes are pages and edges are events. A depth‑first‑like strategy randomly triggers unvisited events, prefers newly discovered pages, and returns to previous pages only after all events of the current page are exhausted.
Algorithm 2.0 extends the model to include page states, represented as (PageName, {Elements}) . State similarity (same page name and similar element sets) allows the algorithm to treat multiple UI configurations as a single node, reducing redundant exploration.
Similarity optimizations are applied to elements, states, and events. When a set of similar events exceeds a threshold, further triggering of those events is skipped, dramatically cutting exploration time for long‑list pages such as photo galleries.
Tool implementation : IAET consists of a core service (UI driver, exception monitor) and an exploration driver that applies the algorithms and custom rules (pre‑input, black‑list, module‑specific exploration). Example of a pre‑input JSON rule:
{
"data": [
{
"activity": "activityname",
"list": [
{"contentDesc": "contentdesc", "resourceId": "resourceid", "text": "value"},
{"contentDesc": "contentdesc", "resourceId": "resourceid", "text": "value"}
]
}
]
}Experimental results : IAET was evaluated on 16 popular Chinese apps, comparing activity coverage against the open‑source tool APE. IAET consistently achieved higher coverage, especially after introducing similarity‑based event pruning (version 7.5.0), which increased the number of explored pages.
The study also shows that the remaining coverage bottleneck lies in payment‑order pages that are hard to reach without real transactions, with overall page coverage exceeding 80%.
Conclusion : Intelligent automated exploration provides a foundational service for performance testing, crash detection, and UI validation under various network and memory conditions. By modeling apps as state graphs and applying similarity‑aware traversal, IAET improves both efficiency and depth of testing for Android applications.
Ctrip Technology
Official Ctrip Technology account, sharing and discussing growth.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.