Mobile Development 12 min read

Mobile Performance Testing Methods for Baidu Video App

This article outlines comprehensive mobile performance testing practices for Baidu Video, covering background, key performance dimensions such as smoothness, crash, memory, power, CPU, and network, and detailing metric collection methods on Android and iOS using command‑line tools, Xcode Instruments, and third‑party utilities.

Baidu Intelligent Testing
Baidu Intelligent Testing
Baidu Intelligent Testing
Mobile Performance Testing Methods for Baidu Video App

Background Introduction Performance testing is often overlooked in many startups, where functional and stability testing are prioritized, while medium‑size companies may consider performance testing but lack guidance. This series, based on Baidu test engineers' practice, introduces general mobile performance testing methods and product‑specific focuses for Baidu Video.

Ba​idu Video is a third‑party video aggregation product offering online playback and offline download on PC, Android, and iOS. User experience, smoothness, download speed, and video retrieval are the primary concerns.

App Performance Analysis Dimensions Video apps belong to the entertainment‑game category, so the performance testing priority order is: smoothness, crash, memory, traffic, response time, power consumption, CPU.

On Android, most metrics can be obtained via shell commands because the platform is built on a Linux‑based system.

Android System Metric Acquisition

CPU The testing methods include:

Using Android‑provided commands: adbshell dumpsys cpuinfo | grep packagename > /address/cpu.txt

Using the top command: adbshell top | grep packagename > /address/cpu.txt

Memory Memory consumption tests aim to keep the app from occupying excessive system resources and to release memory promptly. Test states include idle, medium‑spec, and full‑spec, each representing different usage intervals. Test items cover idle memory usage, medium‑spec memory usage, full‑spec memory usage, memory peak, memory leak, resident memory, and post‑stress memory.

Power (Battery) Power testing focuses on three aspects:

Before and after installing the target APK, standby power should show no significant difference.

In common usage scenarios, the device should enter standby with current within normal range.

During prolonged continuous use, no abnormal power consumption should occur.

Power testing methods are divided into software and hardware approaches. Software methods include:

Using third‑party tools such as Kingsoft Battery Manager.

Custom tools based on PowerManager.WakeLock , calculating power as CPU consumption + WakeLock consumption + data transmission + GPS consumption + Wi‑Fi connection consumption .

Retrieving battery info via adbshell dumpsys battery .

Hardware testing typically uses a multimeter or power meter, sometimes requiring a dummy battery or soldering for devices without removable batteries.

Startup Time Startup time testing is divided into three categories: first launch, non‑first launch, and in‑app screen switching. Tests can be performed via software (using Android DisplayManager to capture activity launch time and filtering logs for the keyword Displayed ) or hardware (using external measurement devices).

Frame Rate (FPS) GPU performance on mobile is evaluated through over‑draw detection, screen‑slide frame rate, and slide smoothness. Over‑draw is identified via the developer option “Show GPU over‑draw” (available on Android 4.2+). Acceptance criteria include no black pixels, no 4× over‑draw, and over‑draw area not exceeding ¼ of the screen.

Screen‑slide frame rate can be measured using software tools such as Systrace:

Enable “Graphics” and “View” tracing in developer options.

Launch the Systrace plugin, select the target app, set capture duration, and enable gfx and view categories.

Perform manual sliding; the trace is saved as trace.html .

Convert trace.html to trace.csv on a Linux system for analysis.

Network Traffic Traffic testing evaluates data usage under different loads (medium and high). Test items include first‑launch traffic, background traffic over two hours, high‑load traffic peak, and medium‑load average traffic. Methods include:

Third‑party tools such as “流量宝”.

Custom tools using packet capture ( tcodump ) and parsing with wireshark .

Reading UID‑specific traffic counters via adbshell dumpsys package to obtain the UID, then using adbshell cat /proc/uid_stat/UID/tcp_rcv and adbshell cat /proc/uid_stat/UID/tcp_snd before and after app interaction to calculate total traffic.

iOS System Metric Acquisition iOS metrics can be collected on a Mac with Xcode (7.0 or later). Recommended tools are:

Instruments (built‑in Xcode tool, requires a developer or enterprise certificate).

GT (Tencent’s app with embedded SDK).

SmallApple (open‑source iOS automation tool: https://github.com/hyxbiao/smallapple ), which supports non‑jailbroken devices, does not require source code, and provides one‑click signing, installation, testing, and performance data collection (CPU, memory, traffic, crash).

SmallApple’s key features include minimal cost, support for non‑jailbroken devices, no source‑code dependency, ability to test App Store or third‑party apps, and full command‑line operation.

Promotional Note Follow the Baidu Quality Department subscription account for more detailed articles and series on mobile testing, CI, and evaluation.

performanceiOSAndroidNetworkmobile testingCPUMemorypower
Baidu Intelligent Testing
Written by

Baidu Intelligent Testing

Welcome to follow.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.