Why Network Testing Matters for Mobile
Mobile users experience a wide range of network conditions that desktop users rarely encounter. A user might start a transaction on a fast WiFi connection, walk into an elevator (no signal), exit to a parking garage (weak cellular), and drive away (switching towers). Your app must handle all of these transitions gracefully.
Network Condition Categories
| Condition | Speed | Latency | Real-World Scenario |
|---|---|---|---|
| No network | 0 | N/A | Airplane mode, underground |
| 2G (EDGE) | 50-200 Kbps | 300-1000ms | Rural areas, developing countries |
| 3G | 0.5-5 Mbps | 100-500ms | Suburban areas, older networks |
| 4G LTE | 5-50 Mbps | 30-100ms | Most urban areas |
| 5G | 50-1000+ Mbps | 1-10ms | Select urban areas |
| Slow WiFi | 1-5 Mbps | 10-50ms | Crowded cafes, hotels, airports |
| Fast WiFi | 50-500 Mbps | 1-10ms | Home, office |
Network Throttling Tools
iOS Network Link Conditioner
Apple provides a built-in network throttling tool:
- On device: Settings > Developer > Network Link Conditioner
- In Xcode: Xcode > Open Developer Tool > Network Link Conditioner
- Preset profiles: 3G, Edge, WiFi (lossy), 100% Loss, etc.
Android Network Emulation
Android emulator has built-in network speed settings:
# Using ADB
adb shell svc wifi disable # Disable WiFi
adb shell settings put global airplane_mode_on 1 # Airplane mode
# Emulator command line options
emulator -avd Pixel_8 -netdelay edge -netspeed edge # 2G simulation
Charles Proxy
Charles Proxy works with both iOS and Android:
Settings > Proxy > Throttle Settings
- Bandwidth: 50 Kbps (simulate 2G)
- Latency: 500ms (simulate poor connection)
- Stability: 80% (simulate packet loss)
Essential Network Test Scenarios
1. Slow Network Loading
Test every data-loading screen on 2G/3G speeds:
- Loading indicators appear within 1 second
- Content loads progressively (text before images)
- Timeout errors are shown after reasonable wait (15-30 seconds)
- User can cancel long-running operations
- Previously cached data is shown while refreshing
2. Network Loss During Operation
Test losing network connectivity during:
- Form submission → data preserved, retry after reconnection
- File upload → resume or restart with clear feedback
- Payment transaction → proper error handling, no double charges
- Chat message sending → message queued, sent on reconnection
- Video/audio streaming → buffer, resume, or graceful stop
3. Network Transitions
Test switching between network types:
- WiFi to cellular (walk away from router)
- Cellular to WiFi (arrive at home/office)
- 4G to 3G to 2G (entering rural area)
- Network to no network to network (tunnel or elevator)
4. Timeout Handling
| Operation | Suggested Timeout | Error Behavior |
|---|---|---|
| API requests | 15-30 seconds | Retry with backoff |
| Image loading | 10-20 seconds | Show placeholder |
| File uploads | 60-120 seconds | Resume capability |
| WebSocket connection | 10 seconds + heartbeat | Reconnect automatically |
Testing with Charles Proxy
Charles Proxy is the most versatile network testing tool for mobile:
Setup for iOS
- Install Charles on your Mac
- Configure iOS device WiFi proxy to your Mac’s IP, port 8888
- Install Charles root certificate on the iOS device
- Enable SSL Proxying for specific domains
Setup for Android
- Configure emulator/device proxy settings
- Install Charles certificate (may require network security config for Android 7+)
- Enable SSL Proxying
Key Charles Features for Testing
- Throttling: Simulate any network speed/latency combination
- Breakpoints: Pause specific requests to modify before sending
- Map Remote: Redirect API calls to different servers
- Rewrite: Modify request/response headers and bodies
- Repeat: Replay requests to test idempotency
Advanced Network Testing Strategies
Testing Request Retry Logic
When a request fails due to network issues, apps typically retry. Test the retry mechanism:
Verify:
□ Exponential backoff between retries (1s, 2s, 4s, 8s...)
□ Maximum retry count (typically 3-5 retries)
□ User notification after final retry failure
□ Retry does not duplicate side effects (double payment, duplicate message)
□ Manual retry option available after automatic retries exhaust
Testing Bandwidth-Sensitive Features
Some features need special attention on slow networks:
| Feature | Slow Network Impact | Test Strategy |
|---|---|---|
| Image galleries | Extremely slow loading | Progressive loading, thumbnails first |
| Video playback | Buffering, quality drops | Adaptive bitrate, quality selector |
| Real-time features | Delayed updates | Optimistic UI, pending indicators |
| File downloads | Timeouts, partial downloads | Resume capability, progress indicator |
Testing SSL/TLS Certificate Handling
Use Charles Proxy to test certificate scenarios:
- Valid certificate → connection succeeds
- Expired certificate → warning or rejection
- Self-signed certificate → strict rejection (no override)
- Certificate pinning → verify pinned cert is validated
Exercise: Network Test Plan
Scenario: You are testing a messaging app. Design a network test plan covering:
- Sending a message on 2G
- Receiving messages while switching from WiFi to cellular
- Uploading a photo on a connection with 20% packet loss
- App behavior when the server returns a 503 (Service Unavailable)
Solution
Sending on 2G: Use Charles Proxy throttle at 50Kbps/500ms latency. Verify: (a) Message shows “sending” state immediately; (b) Message transitions to “sent” after network delivery; (c) If sending takes >30s, show timeout with retry; (d) Draft preserved if app is backgrounded during send.
WiFi to cellular during receive: Start on WiFi, switch to cellular mid-conversation. Verify: (a) No messages lost during transition; (b) New messages appear within 5s of transition; (c) WebSocket reconnects automatically; (d) No duplicate messages appear.
Photo upload with packet loss: Configure Charles with 20% random failure. Verify: (a) Upload retries automatically on failure; (b) Progress bar reflects actual upload progress; (c) Upload can be cancelled; (d) On final failure, photo is saved locally for retry later.
Server 503 response: Use Charles to return 503 for API calls. Verify: (a) User sees “service temporarily unavailable” message; (b) App retries after delay (not immediately); (c) Previously loaded messages remain visible; (d) Send queue holds messages until service recovers.
Pro Tips from Production Experience
Tip 1: Test the first load experience on 3G. Many users will first open your app on a mediocre connection. If the initial load takes more than 5 seconds on 3G, you will lose users before they even see your product.
Tip 2: Use Charles Proxy’s throttle presets for consistency. Create custom throttle presets for your most common test scenarios (e.g., “India 3G”: 384Kbps down, 128Kbps up, 250ms latency) and share them with your team.
Tip 3: Test the second-worst case, not the worst. 100% network failure is easy to test and usually well-handled. The tricky bugs appear at 80% packet loss, 2Kbps bandwidth, or 3000ms latency — conditions that are bad enough to break things but not obvious enough to trigger the offline mode.
Key Takeaways
- Mobile users experience wildly varying network conditions — from 5G to no signal, often within minutes
- Network throttling tools (Charles Proxy, Network Link Conditioner, ADB) are essential for realistic testing
- Test loading states, timeouts, retry logic, and network transitions systematically
- Special attention needed for payment transactions, file uploads, and real-time features during network issues
- The most dangerous bugs appear during network transitions (WiFi to cellular) and degraded connections (not full disconnection)