Specialized Testing Methods and Common Tools for Mobile Applications
Network Testing
Packet sniffing tools are commonly used to assist with network testing; popular options include Fiddler and Charles.
Key test scenarios:
- Network switching: Verify app behavior when switching sequentially between 2G, 3G, 4G, WiFi, weak signal, and complete network outage conditions
- Weak signal testing: Monitor for ANR (Application Not Responding) errors and app crashes when the app operates under poor network conditions
Interruption Testing
Test scenarios:
1. Unexpected interruptions
a. Incoming phone calls
b. Incoming SMS messages
c. Alarm notifications
d. Sudden network disconnection
e. Unexpected device power off
f. Incoming video calls
g. Incoming voice calls
h. Existing app ANR events
i. System update prompts
j. Low memory system alerts
k. Notification pushes from other installed apps
2. Context switching
a. Screen lock/unlock while app is active
b. Switching to other foreground apps and back
Compatibility Testing
Core test dimensions:
1. Testing across different device models
2. Testing across different operating system versions
Common testing approaches:
1. Manual testing: Suitable for projects with small user bases and low compatibility requirements
2. Cloud testing platforms: Suitable for projects with large user bases and strict compatibility requirements
Mainstream cloud testing platforms:
1. Tencent WeTest: http://wetest.qq.com
2. Baidu MTC: http://mtc.baidu.com
3. Alibaba MQC: http://mqc.aliyun.com/
4. Testin: https://www.testin.cn/
Performance Testing
1. Client-side performance testing
a. Data traffic consumption
b. Power drain rate
c. CPU utilization
d. Memory usage
2. Server-side performance testing
UI Testing
- Orientation switching between portrait and landscape modes
- Common gesture operations
a. Long press to open context menus
b. Pinch gesture for zoom in/out
c. Swipe navigation
- Input field adaptation to avoid keyboard occlusion
- Most other UI test points are consistent with web application testing
Security Testing
1. Password input is not displayed in plain text
2. Password fields do not allow copy operations
3. Sensitive information is encrypted during transmission
4. Account locking after multiple consecutive failed login attempts
5. Session expiration after prolonged inactivity, requiring re-login
6. Proper app permission control
7. Resistance to SQL injection attacks
Stability Testing
Stability testing for Android apps is typically implemented with the built-in Monkey tool.
Installation Testing
Pre-installation test conditions
a. Clean stock Android system
b. System with an older version of the target app already installed
c. System with the same version of the target app already installed
d. System with a newer version of the target app installed (for downgrade installation testing)
e. System with third-party antivirus software installed
f. System with competing apps from the same industry installed
g. System with low available storage
During installation
a. Behavior on unexpected installation interruption
b. Correct display of permission confirmation prompts
c. Correct display of installation progress
Post-installation verification
a. Verify app can launch normally
b. Verify all installation files are correctly placed
c. Verify requested permissions are properly configured
d. Measure total installation duration
Upgrade Testing
1. Automatic over-the-air upgrade
2. Manual upgrade selection after system prompt
3. Behavior when upgrade is interrupted unexpectedly
4. Behavior when insufficient storage is encountered during upgrade
5. Data consistency and synchronization after successful upgrade
6. In-place upgrade while the app is running
7. Cross-version upgrade testing
Uninstallation Testing
1. Test unexpected interruption during uninstallation for large apps
2. Uninstall while the app remains in running state
3. Verify all residual app files and data are removed after uninstallation
4. Verify successful reinstallation of the same version after uninstallation
5. Verify correct display of uninstall confirmation prompts
API Testing
Packet capture tools are required to assist with app API testing, covering:
1. Interfaces between internal modules of the app
2. External third-party interfaces called by the app (with UI entry)
3. External interfaces where the app acts as the provider (no UI, requires test tools to simulate requests)
Other Testing
- Supported file type testing
a. Image upload functionality
b. Video upload functionality
c. General file upload functionality
Common App Testing Tools
ADB (Android Debug Bridge)
ADB is a debug tool that connects a development machine to a Android device. Below are commonyl used ADB commands:
adb get-serialno: Get the connected device's serial numberadb devices: List all currently connected Android devicesadb install <path-to-apk>: Install an APK to the connected device. If multiple devices are connected, useadb -s <device-serial> install <path-to-apk>. Common flags:-rfor overwriting existing installation while retaining app data,-dallows installing lower version APKs over higher versions,-sinstalls the app to the device's SD cardadb uninstall <app-package-name>: Uninstall the target app. Add the-kflag to keep app configuration and cache after uninstallationadb shell: Enter the device's shell environment. Common shell operations:- Device targeting flags:
-dfor the only connected physical device,-efor the only running emulator,-s <serial>for targeting a device by serial number ls [-al]: List files and folders,alshows detailed file informationcd <folder>: Navigate into the target foldercat <filename>: Print the content of a filerename <old-path> <new-path>: Rename a file or folderrm -r <folder>: Delete a folder and all its contentmv <source> <destination>: Move a filecp <source> <destination>: Copy a filemkdir <path>: Create a new directorychmod 777 <filename>: Grant full read/write permissions to a file
- Device targeting flags:
adb push <local-file-path> <device-target-path>: Copy a file from your computer to the connected deviceadb pull <device-file-path> <local-target-path>: Copy a file from the connected device to your computeradb logcat: View system and app logs. Android log level are:I: Info,V: Verbose (lowest priority),D: Debug,W: Warning,E: Error,F: Fatal,S: Silent (highest priority, no output)
Common log usage examples:
- Filter by tag, add timestamps and write output to file:
adb logcat -s <tag> -v time > output.log - Filter logs by search term: `adb logcat | grep