Special Test Checklist

  • The performance test
    • Power consumption test
      • batteryhistory
      • instruments
    • Caton test
      • blockcanary
    • H5 performance test
      • devtool
      • headless
      • chrome
  • Scenario testing
    • Compatibility test
      • mqc mtc testln
      • appium grid stf
    • Robustness testing
      • monkey
    • Weak network test
      • facebok atc
      • The proxy custom
    • Security testing
      • wvs

      • burpsuite

Special Test (technical dimension)

  • collapse
    • Automatic traverse
    • Monkey test
    • Horizontal and vertical screen switch, fast advance and retreat
  • Stutter (drop frame, GC, CPU)
    • Caton test
    • Memory leak test
    • method profile
  • Slow response (startup time, interactive response, H5)
    • Hot and cold start
    • Interface switch
    • H5 performance test
  • Heating (CPU, MEM, IO, Network, GPS and other hardware use)
    • method profile
    • The gc statistics
    • IO statistics
    • Traffic statistics
    • Hardware usage statistics
    • Power consumption analysis
  • Compatibility issues (model coverage, regression)
    • Compatibility test

    • Automated testing

    • Automatic traverse

    • Monkey test

Activity Startup process

Meaning: In an app, each page is an Activity

The boot process
  1. Start app: Create a blank window to start the app process
  2. Launch application onCreate: Create an object
  3. Start the MainTread main thread
    • Activity init: Creates a page process. Init is a process creation
    • Activity onCreate: Creates an Activity object, renders the entire page, replaces the empty page when the entire page ==displayed time== displayed ends
    • Other Stuff: dynamic page loading process, such as loading DYNAMIC resources such as JS and PHP
The main process
  1. application onCreate
    • Load third-party SDK: Load third-party services
      • Login Use the third-party QQ login
      • Share your content on wechat
      • Use alipay and other payment methods
  2. Activity onCreate (takes the longest)
    • Load its own logic
    • Send the remote data request xxx.json
    • Render interface List
App startup performance indicator
  1. Cold start (most important)

    • Time: between Application onCreate and Displayed Time
    • Common meaning: The app is not started or the app process is killed
  2. A warmer

    • The app has been started, but has not been used for a long time. The phone memory kills the app process, but the object is still preserved
  3. Warm start

    • The app process is in the background, not killed by memory, and only brings the background to the foreground for the user to show when entering the app
  4. The first screen starts (I don’t think so)

    • Baidu seemed to do not have this thing for a long time, estimation is to show that there is an advertisement after opening?
  5. Suggested time (not a special standard, just understand)

    • Cold start for 5 seconds

    • Warm start for 2 seconds

    • Hot start 1.5 seconds

App startup time test method and tools

  1. Adb logcat (time is not accurate)
    • Adb Logcat does not record blank pages, AD time, or dynamic loading, only a main “page” or the time after entering another page
  2. Screen recording + Video framing (most accurate)
  3. Uiautomator and other automation tools 200ms
  4. traceview
  5. Hard points (a unified way to test boot times between different hardware)

adb logcat

steps
  1. Adb shell PM clear Package to clear cached data
  2. Adb shell am force-stop package
  3. Adb shell am start -s -w package/activty
  4. To get the data: adb logcat | grep -i displayed
The results of
  • StartTime: Records the point in time when stratActivityAndWait() was just about to be called
  • EndTime: Records the time point returned by the stratActivityAndWait() function call
  • WaitTime: the call time of stratActivityAndWait()
  • WaitTime=endTime-startTime
In actual combat

Record the startup time of the snowball

C:\Users\user>adb shell pm clear com.xueqiu.android Success C:\Users\user>adb shell am force-stop com.xueqiu.android #-W: wait for launch to complete #-S: force stop the target app before starting the activity C:\Users\user>adb shell am start -S -W com.xueqiu.android/.view.WelcomeActivityAlias Stopping: com.xueqiu.android Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.xueqiu.android/.view.WelcomeActivityAlias } Status: ok Activity: com.xueqiu.android/.view.WelcomeActivityAlias ThisTime: 1063 TotalTime: 1063 WaitTime: 1111 Complete C: \ Users \ user > adb logcat | grep -i displayed 05-03 05:06:19. 698 951 986 I ActivityManager: Displayed com.xueqiu.trade.android/com.xueqiu.android.base.h5.H5Activity: + 490 ms 05-03 05:08:00. 489 951 986 I ActivityManager: mon Displayed com.xueqiu.android/.com. Search. USearchActivity: + 214 ms 05-03 05:10:00. 307 951 986 I ActivityManager: Displayed com. Xueqiu. Android /. The WelcomeActivityAlias: + 1 s63ms 05-03 05:10:02. 058 951 986 I ActivityManager: Displayed com.xueqiu.android/.com mon. MainActivity: + 590 ms 05-03 05:10:06. 771 951 986 I ActivityManager: Displayed com.xueqiu.android/.com mon. UpdateDialogActivity: + 105 ms 05-03 05:11:19. 856 951 986 I ActivityManager: Displayed com. Xueqiu. Android /. The WelcomeActivityAlias: + 728 ms 05-03 05:11:21. 266 951 986 I ActivityManager: Displayed com.xueqiu.android/.com mon. MainActivity: + 955 msCopy the code

Remove the needle using FFMPEG

steps

To first download the ffMPEG program, and then configure the environment variable, please download the Windows version on the official website, environment configuration is particularly easy

  1. Clear app cache: ADB shell PM clear Package
  2. Adb shell am force-stop package Adb shell am force-stop package adb shell am force-stop package
  3. Record a 30-second video and save it in sdcard: ADB shell ScreenRecord –bugreport –time-limit 30 /sdcard/1.mp4 &
  4. Adb shell am start -s -w package/activity
  5. Pull the file to the current folder: adb pull /sdcard/1.mp4.
  6. Xueqiu.gif (xuemPEG-i) 1. Mp4 xueqiu.gif
  7. ffmpeg -i 1.mp4 -r 10 frames_%03d.jpg
    • -i Is followed by the video file to be processed
    • -r indicates how many frames are broken down in a second. If it’s a 30-second video, it will break down into 300 images
    • % 03D indicates that the file starts at 001 and ends at 300
    • Split the video from 1.MP4 into 300 pictures, each of which takes 0.1 seconds

Note: When using method 7, try to put the videos in a folder ==

In field
C:\Users\user>adb shell pm clear com.xueqiu.android
Success

C:\Users\user>adb shell am force-stop com.xueqiu.android


C:\Users\user>adb shell am start -S -W com.xueqiu.android/.view.WelcomeActivityAlias
Stopping: com.xueqiu.android
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.xueqiu.android/.view.WelcomeActivityAlias }
Status: ok
Activity: com.xueqiu.android/.view.WelcomeActivityAlias
ThisTime: 1063
TotalTime: 1063
WaitTime: 1111
Complete

C:\Users\user>adb pull /sdcard/1.mp4 .

C:\Users\user>ffmpeg -i 1.mp4 -r 10 frames_%03d.jpg
Copy the code

More technical articles can be found at qrcode.testing-studio.com/f?from=juej…