sickn33/agentic-awesome-skills / plugins/aasb-design-studio/skills/mobile-design
mobile-design
VerifiedDesign and review iOS, Android, React Native or Flutter interfaces for touch, accessibility, navigation, offline behavior and measured performance. Use for mobile app UI work; not a mobile compliance certification.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.0 KB |
| decision-trees.md | markdown | 17.1 KB |
| mobile-backend.md | markdown | 15.7 KB |
| mobile-color-system.md | markdown | 10.2 KB |
| mobile-debugging.md | markdown | 5.1 KB |
| mobile-design-thinking.md | markdown | 16.9 KB |
| mobile-navigation.md | markdown | 12.1 KB |
| mobile-performance.md | markdown | 20.5 KB |
| mobile-testing.md | markdown | 11.6 KB |
| mobile-typography.md | markdown | 11.2 KB |
| platform-android.md | markdown | 19.9 KB |
| platform-ios.md | markdown | 17.5 KB |
| scripts/mobile_audit.py | script | 6.0 KB |
| scripts/test_mobile_audit_review.py | script | 3.1 KB |
| touch-psychology.md | markdown | 17.3 KB |
mobile-testing.md
View on GitHub# Mobile Testing Patterns
> **Mobile testing is NOT web testing. Different constraints, different strategies.**
> This file teaches WHEN to use each testing approach and WHY.
> **Code examples are minimal - focus on decision-making.**
---
## π§ MOBILE TESTING MINDSET
```
Mobile testing differs from web:
βββ Real devices matter (emulators hide bugs)
βββ Platform differences (iOS vs Android behavior)
βββ Network conditions vary wildly
βββ Battery/performance under test
βββ App lifecycle (background, killed, restored)
βββ Permissions and system dialogs
βββ Touch interactions vs clicks
```
---
## π« AI MOBILE TESTING ANTI-PATTERNS
| β AI Default | Why It's Wrong | β
Mobile-Correct |
|---------------|----------------|-------------------|
| Jest-only testing | Misses native layer | Jest + E2E on device |
| Enzyme patterns | Deprecated, web-focused | React Native Testing Library |
| Browser-based E2E (Cypress) | Can't test native features | Detox / Maestro |
| Mock everything | Misses integration bugs | Real device testing |
| Ignore platform tests | iOS/Android differ | Platform-specific cases |
| Skip performance tests | Mobile perf is critical | Profile on low-end device |
| Test only happy path | Mobile has more edge cases | Offline, permissions, interrupts |
| 100% unit test coverage | False security | Pyramid balance |
| Copy web testing patterns | Different environment | Mobile-specific tools |
---
## 1. Testing Tool Selection
### Decision Tree
```
WHAT ARE YOU TESTING?
β
βββ Pure functions, utilities, helpers
β βββ Jest (unit tests)
β βββ No special mobile setup needed
β
βββ Individual components (isolated)
β βββ React Native β React Native Testing Library
β βββ Flutter β flutter_test (widget tests)
β
βββ Components with hooks, context, navigation
β βββ React Native β RNTL + mocked providers
β βββ Flutter β integration_test package
β
βββ Full user flows (login, checkout, etc.)
β βββ Detox (React Native, fast, reliable)
β βββ Maestro (Cross-platform, YAML-based)
β βββ Appium when its driver/device coverage fits the project
β
βββ Performance, memory, battery
βββ Flashlight (RN performance)
βββ Flutter DevTools
βββ Real device profiling (Xcode/Android Studio)
```
### Tool Comparison
| Tool | Platform | Speed | Reliability | Use When |
|------|----------|-------|-------------|----------|
| **Jest** | RN | β‘β‘β‘ | β‘β‘β‘ | Unit tests, logic |
| **RNTL** | RN | β‘β‘β‘ | β‘β‘ | Component tests |
| **flutter_test** | Flutter | β‘β‘β‘ | β‘β‘β‘ | Widget tests |
| **Detox** | RN | β‘β‘ | β‘β‘β‘ | E2E, critical flows |
| **Maestro** | Both | β‘β‘ | β‘β‘ | E2E, cross-platform |
| **Appium** | Both | β‘ | β‘ | Driver/device coverage dependent |
---
## 2. Testing Pyramid for Mobile
```
βββββββββββββββββ
β E2E Tests β 10%
β (Real device) β Slow, expensive, essential
βββββββββββββββββ€
β Integration β 20%
β Tests β Component + context
βββββββββββββββββ€
β Component β 30%
β Tests β Isolated UI
βββββββββββββββββ€
β Unit Tests β 40%
β (Jest) β Pure logic
βββββββββββββββββ
```
### Why This Distribution?
| Level | Why This % |
|-------|------------|
| **E2E 10%** | Slow, flaky, but catches integration bugs |
| **Integration 20%** | Tests real user flows without full app |
| **Component 30%** | Fast feedback on UI changes |
| **Unit 40%** | Fastest, most stable, logic coverage |
> π΄ **If you have 90% unit tests and 0% E2E, you're testing the wrong things.**
---
## 3. What to Test at Each Level
### Unit Tests (Jest)
```
β
TEST:
βββ Utility functions (formatDate, calculatePrice)
βββ State reducers (Redux, Zustand stores)
βββ API response transformers
βββ Validation logic
βββ Business rules
β DON'T TEST:
βββ Component rendering (use component tests)
βββ Navigation (use integration tests)
βββ Native modules (mock them)
βββ Third-party libraries
```
### Component Tests (RNTL / flutter_test)
```
β
TEST:
βββ Component renders correctly
βββ User interactions (tap, type, swipe)
βββ Loading/error/empty states
βββ Accessibility labels exist
βββ Props change behavior
β DON'T TEST:
βββ Internal implementation details
βββ Snapshot everything (only key components)
βββ Styling specifics (brittle)
βββ Third-party component internals
```
### Integration Tests
```
β
TEST:
βββ Form submission flows
βββ Navigation between screens
βββ State persistence across screens
βββ API integration (with mocked server)
βββ Context/provider interactions
β DON'T TEST:
βββ Every possible path (use unit tests)
βββ Third-party services (mock them)
βββ Backend logic (backend tests)
```
### E2E Tests
```
β
TEST:
βββ Critical user journeys (login, purchase, signup)
βββ Offline β online transitions
βββ Deep link handling
βββ Push notification navigation
βββ Permission flows
βββ Payment flows
β DON'T TEST:
βββ Every edge case (too slow)
βββ Visual regression (use snapshot tests)
βββ Non-critical features
βββ Backend-only logic
```
---
## 4. Platform-Specific Testing
### What Differs Between iOS and Android?
| Area | iOS Behavior | Android Behavior | Test Both? |
|------|--------------|------------------|------------|
| **Back navigation** | Edge swipe | System back button | β
YES |
| **Permissions** | OS/version-specific prompts and settings | Permission/version-specific prompts, denial and settings | β
YES |
| **Keyboard** | Different appearance | Different behavior | β
YES |
| **Date picker** | Wheel/modal | Material dialog | β οΈ If custom UI |
| **Push format** | APNs payload | FCM payload | β
YES |
| **Deep links** | Universal Links | App Links | β
YES |
| **Gestures** | Some unique | Material gestures | β οΈ If custom |
### Platform Testing Strategy
```
FOR EACH PLATFORM:
βββ Run unit tests (same on both)
βββ Run component tests (same on both)
βββ Run E2E on REAL DEVICE
β βββ iOS: iPhone (not just simulator)
β βββ Android: Mid-range device (not flagship)
βββ Test platform-specific features separately
```
---
## 5. Offline & Network Testing
### Offline Scenarios to Test
| Scenario | What to Verify |
|----------|----------------|
| Start app offline | Shows cached data or offline message |
| Go offline mid-action | Action queued, not lost |
| Come back online | Queue synced, no duplicates |
| Slow network (2G) | Loading states, timeouts work |
| Flaky network | Retry logic, error recovery |
### How to Test Network Conditions
```
APPROACH:
βββ Unit tests: Mock NetInfo, test logic
βββ Integration: Mock API responses, test UI
βββ E2E (Detox): Use device.setURLBlacklist()
βββ E2E (Maestro): Use network conditions
βββ Manual: Use Charles Proxy / Network Link Conditioner
```
---
## 6. Performance Testing
### What to Measure
| Metric | Target | How to Measure |
|--------|--------|----------------|
| **App startup** | < 2 seconds | Profiler, Flashlight |
| **Screen transition** | < 300ms | React DevTools |
| **List scroll** | 60 FPS | Profiler, feel |
| **Memory** | Stable, no leaks | Instruments / Android Profiler |
| **Bundle size** | Minimize | Metro bundler analysis |
### When to Performance Test
```
PERFORMANCE TEST:
βββ Before release (required)
βββ After adding heavy features
βββ After upgrading dependencies
βββ When users report slowness
βββ On CI (optional, automated benchmarks)
WHERE TO TEST:
βββ Real device (REQUIRED)
βββ Low-end device (Galaxy A series, old iPhone)
βββ NOT on emulator (lies about performance)
βββ With production-like data (not 3 items)
```
---
## 7. Accessibility Testing
### What to Verify
| Element | Check |
|---------|-------|
| Interactive elements | Have accessibilityLabel |
| Images | Have alt text or decorative flag |
| Forms | Labels linked to inputs |
| Buttons | Role = button |
| Touch targets | β₯ 44x44 (iOS) / 48x48 (Android) |
| Color contrast | WCAG AA minimum |
### How to Test
```
AUTOMATED:
βββ React Native: native accessibility tooling (jest-axe targets DOM and does not validate a native view tree)
βββ Flutter: Accessibility checker in tests
βββ Lint rules for missing labels
MANUAL:
βββ Enable VoiceOver (iOS) / TalkBack (Android)
βββ Navigate entire app with screen reader
βββ Test with increased text size
βββ Test with reduced motion
```
---
## 8. CI/CD Integration
### What to Run Where
| Stage | Tests | Devices |
|-------|-------|---------|
| **PR** | Unit + Component | None (fast) |
| **Merge to main** | + Integration | Simulator/Emulator |
| **Pre-release** | + E2E | Real devices (farm) |
| **Nightly** | Full suite | Device farm |
### Device Farm Options
| Service | Pros | Cons |
|---------|------|------|
| **Firebase Test Lab** | Free tier, Google devices | Android focus |
| **AWS Device Farm** | Wide selection | Expensive |
| **BrowserStack** | Good UX | Expensive |
| **Local devices** | Free, reliable | Limited variety |
---
## π MOBILE TESTING CHECKLIST
### Before PR
- [ ] Unit tests for new logic
- [ ] Component tests for new UI
- [ ] No console.logs in tests
- [ ] Tests pass on CI
### Before Release
- [ ] E2E on real iOS device
- [ ] E2E on real Android device
- [ ] Tested on low-end device
- [ ] Offline scenarios verified
- [ ] Performance acceptable
- [ ] Accessibility verified
### What to Skip (Consciously)
- [ ] 100% coverage (aim for meaningful coverage)
- [ ] Every visual permutation (use snapshots sparingly)
- [ ] Third-party library internals
- [ ] Backend logic (separate tests)
---
## π― Testing Questions to Ask
Before writing tests, answer:
1. **What could break?** β Test that
2. **What's critical for users?** β E2E test that
3. **What's complex logic?** β Unit test that
4. **What's platform-specific?** β Test on both platforms
5. **What happens offline?** β Test that scenario
> **Remember:** Good mobile testing is about testing the RIGHT things, not EVERYTHING. A flaky E2E test is worse than no test. A failing unit test that catches a bug is worth 100 passing trivial tests.
## Evidence interpretation
The pyramid percentages and startup/transition thresholds above are illustrative
planning examples, not validated universal requirements. Choose by user risk and
measured baseline. Component snapshots are not rendered visual/accessibility tests.
A testID is not an accessibility label, and inherited text may already provide a
correct native accessible name. Test real semantics and focus order with native
tools/screen readers. A flaky critical E2E test should be repaired or replaced,
not silently removed. Device farms/cert installation/telemetry can incur costs or
expose data and require explicit scope. No native device test was run in this review.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |