Chapter 7 Application Testing
1. Wukong Stability Tool
https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/application-test/wukong-guidelines.md/
Introduction:
The Wukong stability testing tool for OpenHarmony, a core component of the OpenHarmony toolkit, provides foundational capabilities for application stability testing. These include:
- Random event injection for Ability modules (to simulate unpredictable user interactions)
- Widget/control injection testing (to validate UI component robustness)
- Exception/crash capture mechanisms (for error diagnosis)
- Automated test report generation
- Data traversal screenshot capture for Ability interfaces (to document visual states)
This tool systematically ensures app reliability through controlled chaos engineering and behavioral verification.
Command-Specific Usage Instructions: https://gitee.com/openharmony/ostest\_wukong/blob/master/README\_zh.md
Wukong exec Random Testing Usage Example
Enter the shell environment and execute the random testing command:
wukong exec -s 10 -i 1000 -a 0.28 -t 0.72 -c 100
Random Testing Example Explanation:

Wukong Specialized Testing Usage Example
Enter the shell environment and execute the specialized sequential traversal testing command:
wukong special -C [bundlename] -p
Specialized Testing Example Explanation:

Upon completion of the test command execution, the test results will be automatically generated.
The root directory for test result output is as follows:
The storage path for reports of versions prior to September 22, 2022, is as follows: /data/local/wukong/report/xxxxxxxx_xxxxxx/
The storage path for reports of versions after September 22, 2022, is as follows: /data/local/tmp/wukong/report/xxxxxxxx_xxxxxx/
Note: The test report directory will be automatically generated.
This directory contains the following categories of results:

wukong execution log
reports/xxxxxxxx_xxxxxx/wukong.log
2. SmartPerf Performance Tool
Introduction:
SmartPerf is a performance and power consumption testing tool developed based on the OpenHarmony system. It features user-friendly operation and provides key KPI metrics for both performance and power consumption, including specific test values such as FPS, CPU, GPU, Ftrace, and other device metrics.
Currently, the SmartPerf tool offers two usage modes: the HAP application visual operation mode (SmartPerf-Device) and the shell command-line mode (SmartPerf-Daemon). SmartPerf-Device supports visual operations, pause control via a floating window, and real-time data display through a floating window. SmartPerf-Daemon is primarily designed for screen-less devices and low-performance devices, while also maintaining compatibility with models like RK3568.