Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Specialized Testing Methods and Common Tools for Mobile Applications

Tech 1

Network Testing

Packet sniffing tools are commonly used to assist with network testing; popular options include Fiddler and Charles.

Key test scenarios:

  1. Network switching: Verify app behavior when switching sequentially between 2G, 3G, 4G, WiFi, weak signal, and complete network outage conditions
  2. 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

  1. Orientation switching between portrait and landscape modes
  2. Common gesture operations
  a. Long press to open context menus
  b. Pinch gesture for zoom in/out
  c. Swipe navigation
  1. Input field adaptation to avoid keyboard occlusion
  2. 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

  1. 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:

  1. adb get-serialno: Get the connected device's serial number
  2. adb devices: List all currently connected Android devices
  3. adb install <path-to-apk>: Install an APK to the connected device. If multiple devices are connected, use adb -s <device-serial> install <path-to-apk>. Common flags: -r for overwriting existing installation while retaining app data, -d allows installing lower version APKs over higher versions, -s installs the app to the device's SD card
  4. adb uninstall <app-package-name>: Uninstall the target app. Add the -k flag to keep app configuration and cache after uninstallation
  5. adb shell: Enter the device's shell environment. Common shell operations:
    • Device targeting flags: -d for the only connected physical device, -e for the only running emulator, -s <serial> for targeting a device by serial number
    • ls [-al]: List files and folders, al shows detailed file information
    • cd <folder>: Navigate into the target folder
    • cat <filename>: Print the content of a file
    • rename <old-path> <new-path>: Rename a file or folder
    • rm -r <folder>: Delete a folder and all its content
    • mv <source> <destination>: Move a file
    • cp <source> <destination>: Copy a file
    • mkdir <path>: Create a new directory
    • chmod 777 <filename>: Grant full read/write permissions to a file
  6. adb push <local-file-path> <device-target-path>: Copy a file from your computer to the connected device
  7. adb pull <device-file-path> <local-target-path>: Copy a file from the connected device to your computer
  8. adb 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

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.