Fastbot: Cross‑Platform Intelligent Automated Testing System for Android and iOS
This article details ByteDance’s Fastbot system, an AI‑driven cross‑platform automated testing framework for Android and iOS that leverages model‑based testing, reinforcement learning, and image‑based UI analysis to improve test coverage, fault injection, and scalability across mobile applications and games.
Background: AI‑augmented testing has become a core capability for large internet companies. ByteDance’s Quality Lab explored automated test generation and built Fastbot, a stability‑testing service for Android that uses model‑based testing, multi‑device cooperation, expert‑system configuration, model reuse, complex case generation, and precise targeting.
Test Generation: Fastbot’s ATG (Automated Testing Generation) abstracts GUI pages as states and actions, turning test generation into a graph‑traversal problem. Compared with record‑and‑replay, ATG reduces script maintenance and improves reuse. Typical ATG techniques include code‑based testing, model‑based testing, combinatorial testing, search‑based testing (e.g., Facebook’s Sapienz), and adaptive random testing.
Fastbot Design Principles: To overcome memory limits on mobile devices, heavy computation is off‑loaded to the cloud while the client only captures UI information and injects actions. The system uses a client‑side lightweight driver and a server‑side agent that builds state nodes, decides actions via heuristic or reinforcement‑learning policies, and sends commands back to the device.
Fastbot‑Android Workflow: Multiple devices form a farm; each reports GUI trees to the server, which runs a Monte‑Carlo‑tree‑search‑inspired exploration/exploitation algorithm with Q‑learning and curiosity‑driven rewards. After many rounds the value function stabilises, guiding the agent to select actions with the highest expected reward.
Cross‑Platform Foundations: The architecture decouples client capabilities from algorithmic decisions, allowing the same backend service to support iOS. Fastbot‑iOS uses a native C++ library based on OpenCV for image‑based UI parsing, a minimal set of private WDA interfaces, and optional plug‑ins (e.g., Shoots SDK) for deeper integration.
Image Processing Pipeline: Fastbot‑iOS performs fast image preprocessing (cropping, histogram equalisation, binarisation), row/column scanning to segment UI elements, text‑block aggregation, night‑mode handling, and, when needed, deep‑learning models for classification, OCR, and YOLOv3 object detection.
UI Anomaly Detection: The system can detect black/white screens, overlapping UI, missing assets, purple/white blocks in games, black borders, over‑exposure, occlusions, text overlap, and visual glitches such as screen tearing or corrupted textures.
Game Testing Applications: Fastbot applies reinforcement‑learning agents (e.g., A3C) and multi‑language OCR to automatically traverse game UI, detect translation errors, and perform task‑automation, demonstrating its suitability for large‑scale game quality assurance.
Conclusion: Fastbot is widely deployed in ByteDance’s products, executing over ten thousand daily tasks and uncovering more than fifty thousand crashes per month, thereby improving release‑time stability and serving as a foundational service in the company’s DevOps pipeline.
ByteDance Terminal Technology
Official account of ByteDance Terminal Technology, sharing technical insights and team updates.
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.