Create a comprehensive mobile app testing strategy covering device matrix selection, native and cross-platform testing approaches, real device vs emulator trade-offs, and a multi-layered testing pyramid tailored to mobile-specific challenges like OS fragmentation, network conditions, and app lifecycle events.
## ROLE You are a mobile quality engineering lead with extensive experience testing iOS and Android applications across native, hybrid, and cross-platform frameworks. You have managed device labs of 200+ devices, built automated testing pipelines for apps with 10M+ downloads, and designed testing strategies that caught critical bugs across the fragmented Android ecosystem and iOS version transitions. You have deep expertise in Appium, Detox, XCTest, Espresso, Maestro, and cloud device platforms (BrowserStack, Sauce Labs, AWS Device Farm, Firebase Test Lab). You understand the unique mobile testing challenges: OS fragmentation, device-specific rendering, network condition variability, battery and performance constraints, app lifecycle management, push notification testing, deep linking, and app store review requirements. ## OBJECTIVE Build a complete mobile testing strategy for [APP NAME], a [APP TYPE: native iOS / native Android / React Native / Flutter / Ionic / Kotlin Multiplatform / SwiftUI + Jetpack Compose] application targeting [MARKET: consumer B2C / enterprise B2B / healthcare / fintech / e-commerce / social / gaming]. The app supports [IOS VERSIONS: e.g., iOS 16+] and [ANDROID VERSIONS: e.g., Android 11+ (API 30+)] with a user base of [USER BASE: e.g., 500K MAU]. The team has [TEAM SIZE] mobile developers with [QA SETUP: no dedicated QA / manual QA only / some automation / mature automation pipeline]. The app's critical features include [FEATURES: e.g., real-time messaging, payment processing, camera/photo features, offline mode, location services, biometric auth]. ## TASK: COMPLETE MOBILE TESTING STRATEGY ### Step 1 — Device & OS Matrix Selection Design the device testing matrix using a risk-based approach rather than trying to cover every device. Analyze [APP NAME]'s analytics data (or industry benchmarks if pre-launch) to identify the top [NUMBER: 15-25] device-OS combinations that cover [COVERAGE TARGET: 85-95%] of the user base. Organize the matrix into three tiers: Tier 1 — Must Pass (test every release): The [NUMBER: 5-8] most common devices representing 60%+ of users. For iOS: the current iPhone generation (e.g., iPhone 15/16), previous generation (iPhone 14), and the oldest supported model with the minimum iOS version. For Android: the most popular Samsung Galaxy (e.g., S24, A54), a Google Pixel (stock Android reference), and a popular budget device in your market (e.g., Xiaomi Redmi, Samsung A series). Include both phone and tablet if the app supports tablets. Tier 2 — Should Pass (test weekly or before major releases): [NUMBER: 8-12] additional devices covering mid-range and emerging segments, different screen sizes and aspect ratios, and specific devices known to have rendering or performance quirks. Tier 3 — Spot Check (test monthly or for specific features): [NUMBER: 5-8] edge devices including the oldest supported OS version, foldable devices (Samsung Z Fold/Flip), devices with unusual screen ratios or notch configurations, and market-specific devices if targeting regions like India, Brazil, or Southeast Asia. For each device in the matrix, specify: device model, OS version, screen resolution, RAM, whether to test on real device or emulator, and any device-specific features to validate (120Hz display, always-on display, stylus input). ### Step 2 — Mobile Test Pyramid Design Adapt the traditional test pyramid for mobile-specific constraints. Define each layer with mobile-appropriate tooling and scope: Unit Tests (70% of test count): Business logic, view models, state management, data transformations, API response parsing, local database operations. For [APP TYPE], recommend the specific unit testing framework: XCTest for Swift, JUnit for Kotlin, Jest for React Native, flutter_test for Flutter. Emphasize testing the ViewModel/Presenter layer thoroughly since this is where most business logic lives in well-architected mobile apps. Component/Widget Tests (15% of test count): For React Native/Flutter, widget or component tests that render individual UI components with mock data and verify visual output and interaction handling. For native apps, snapshot testing of individual screens and custom views. These tests catch UI rendering issues without the overhead of full device execution. Integration Tests (10% of test count): Tests that validate the interaction between the app and real or sandboxed backend APIs, database operations with actual SQLite/Realm/CoreData instances, and navigation flows across multiple screens. For [APP TYPE], show the integration test setup using [INTEGRATION TOOL: Detox for React Native / integration_test for Flutter / XCTest UI tests for iOS / Espresso for Android / Maestro for cross-platform]. E2E Tests (5% of test count): Full device tests covering the [NUMBER: 5-10] most critical user journeys on real devices or high-fidelity emulators. These tests are expensive to maintain, so limit them to flows that generate revenue or are required for app store compliance. Show the E2E test architecture: page object model adapted for mobile (screen objects), wait strategies for mobile-specific async operations (animations, network calls, native dialogs), and device interaction helpers (permissions dialogs, notifications, biometric prompts). ### Step 3 — Mobile-Specific Test Scenarios Define test scenarios for challenges unique to mobile applications. Network condition testing: test the app under [NETWORK CONDITIONS: no network / slow 3G / flaky connection with packet loss / WiFi to cellular handoff / airplane mode toggle]. Show how to simulate network conditions using [TOOL: Charles Proxy / Network Link Conditioner / Android emulator network throttling / Appium's network connection API]. Verify that the app shows appropriate offline states, queues actions for retry, syncs correctly when connectivity returns, and never shows a blank screen or crashes. App lifecycle testing: test the app's behavior during background/foreground transitions, memory pressure (OS kills the app while backgrounded), incoming phone calls during critical flows (payment, form submission), screen rotation during data entry, split-screen/multi-window on Android and Stage Manager on iPad. Verify state preservation: form data is not lost, playback resumes, authenticated sessions survive backgrounding. Push notification testing: verify notification delivery, display (title, body, images, action buttons), deep link navigation from notification tap, notification handling when the app is in foreground/background/killed states, and notification permission flows. Permission testing: test the flows when users grant, deny, or revoke permissions (camera, location, contacts, microphone, photos). Verify the app gracefully handles denied permissions with clear messaging and settings deep-links, and that permission state changes mid-session are handled correctly. ### Step 4 — Real Device vs Emulator Strategy Define when to use real devices vs emulators/simulators for each testing purpose. Emulators/Simulators are appropriate for: unit tests, component tests, most integration tests, and development-cycle testing where fast iteration matters. Emulators excel at: controlled environments, easy CI/CD integration, free scaling, and API-level testing. Real devices are mandatory for: performance testing (emulators do not reflect real CPU/GPU/memory constraints), camera and sensor testing, biometric authentication, push notification delivery, battery consumption testing, actual network condition testing, and final pre-release validation. Define the cloud device strategy for CI/CD: [CLOUD PLATFORM: BrowserStack App Automate / Sauce Labs / AWS Device Farm / Firebase Test Lab / LambdaTest], the device pool configuration matching your Tier 1 matrix, the cost optimization approach (reserved devices for core tests, on-demand for expanded matrix), and the parallel execution strategy to keep CI pipeline times under [TARGET: 15-20 minutes] for the core test suite. ### Step 5 — Automation Framework Selection & Setup Recommend and configure the automation framework for [APP TYPE]. Compare the options: Appium (cross-platform, language-agnostic, largest community, slower execution), Detox (React Native native, gray-box testing, fast and reliable, RN-only), Maestro (YAML-based, easy to write, fast execution, growing ecosystem), XCTest/Espresso (native, fastest execution, platform-specific, deepest OS integration). For [APP TYPE], provide the recommended framework with rationale and show the complete setup: project configuration, first test case, page/screen object pattern, test data management, and CI/CD integration. Implement the screen object pattern with mobile adaptations: each screen class encapsulates element locators and interaction methods, handles platform-specific differences (iOS picker vs Android spinner), includes smart wait strategies (wait for element to be visible AND stable, not just present in the DOM), and provides scroll-to-find helpers for long lists. Show accessibility-first locator strategies: prefer accessibility IDs/labels over XPath or class names — this makes tests more reliable AND ensures the app is accessible. ### Step 6 — Release Testing & App Store Compliance Design the release testing checklist and app store compliance validation. Create a pre-release checklist covering: regression test suite execution on Tier 1 devices, performance benchmark comparison against the previous release (startup time, memory usage, frame rate, battery impact), accessibility audit (VoiceOver/TalkBack navigation, Dynamic Type/font scaling, color contrast), app size verification against budget [SIZE BUDGET: e.g., <50MB download / <100MB installed], deep link testing for all registered URL schemes, crash-free rate validation against target [CRASH TARGET: >99.5%], analytics event validation for key user journeys, and localization spot-check for supported languages. Address platform-specific app store review requirements: Apple's guidelines on privacy labels, ATT framework compliance, and guideline-specific rejection risks; Google Play's data safety form, target API level requirements, and policy compliance. Define the phased rollout testing strategy: [ROLLOUT: 1% → 5% → 25% → 100%] with specific metrics to monitor at each stage (crash rate, ANR rate, user complaints, feature adoption) and rollback criteria.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[APP NAME][TEAM SIZE][APP TYPE]