Write directory title here
1. Problems
Many business lines and
complex business processes
Rely on some resources of traditional securities companies
1. For example, there are problems in the app
The content of the stock information field is missing or the data is abnormal.
Wechat sharing is unavailable.
When the user sends a request when the network is slow, the current page crashes after the user sends a request.
Some interfaces have different operating experience on the 4.4 and 5.0 systems.
The interface crashes
2. Solution
Automated solution
Quick product iteration
learning design pattern (PageObject)
manual solution
Correctness of interface fields: For example, stock-related data changes, a total of dozens of fields
Interface correctness: changes and content of back-end interface transmission data
Special test regression is difficult: memory leaks, robustness tests, weak network and other test processes have too many
regressions Heavy workload: if you don't return, you will miss the test
3. Improvement strategy
automated test
Cover the right path of the main business
Reduce the scale and minimize maintenance costs
manual testing
Coverage new feature testing
Exploratory testing
4. Automatic traversal test
code less: Use case maintenance costs are reduced to the lowest level
Automated: Automated coverage returns to business
5. Common traversal tools and techniques
google android native monkey, app crawler
Baidu smartmonkey
Tencent newmonkey
vigossijjj smart_monkey
macaca NoSmoke
headline zhangzhao maxim
seveniruby appcrawler
Advantages and disadvantages of monkey: It can be understood as a monkey jumping up and down, randomly and aimlessly executing some events; advantage: quickly execute some events; disadvantage: uncontrollable, making it impossible to execute a certain event.
2. Android maxim traversal test tool
Improve Android Monkey
Based on traversal rules
High performance
Strategy
mode-dfs --uiautomatordfs
Add depth traversal algorithm
mode-Mix --uiautomatormix
Use the accessibiltyserver to obtain the interface interface to analyze each control,
randomly select a control to perform the touch operation
, and mix it with other operations of the original monkey in proportion
use
Address: https://github.com/zhangzhao4444/Maxim
adb push framework.jar /sdcard
adb push monkey.jar /sdcard
Environmental preparation
Support Android 5, 6, 7, 8, 9, 10, 11 real phones and emulators;
push framework.jar, monkey.jar to a directory on the phone, suggest /sdcard
D:\auto_senior>adb push "D:\auto_senior\Maxim\monkey.jar" /sdcard
D:\auto_senior>adb push "D:\auto_senior\Maxim\framework.jar" /sdcard
You can view the installed packages through the adb shell
command line mode
cmd command:adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.panda.videoliveplatform --uiautomatormix --running-minutes 60 -v -v
adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.xueqiu.android --uiautomatormix --running-minutes 60 -v -v
tv.panda.test.monkey.Monkey: monkey entry class, do not modify
com.panda.videoliveplatform: tested app package name, need to modify
–uiautomatormix: traversal strategy
Strategy
1. Mode Mix (stress test based on event probability)
–uiautomatormix
directly uses the underlying accessibiltyserver to obtain the interface interface to analyze each control, and randomly selects a control to perform the touch operation.
At the same time, it is mixed with other operations of the original monkey in proportion. The
default accessibilityserver action accounts for 50%, and the rest of the actions are divided into the remaining 50%.
The accessibilityserver action proportion is configurable --pct-uiautomatormix n
2. Mode DFS
–uiautomatordfs
depth traversal algorithm
3. Mode Troy
–uiautomatortroy
control selection strategy performs deep traversal according to the high and low priorities configured by max.xpath.selector
4. Keep the original monkey
5. Total running time
--running-minutes 3 run for 3 minutes
6. --act-whitelist-file /sdcard/awl.strings defines the whitelist --act-blacklist-file
7. Other parameters are consistent with the original monkey
3. Android fastbot traversal test tool
Fastbot introduces
APP stability testing tool based on model-based testing combined with machine learning and reinforcement learning
use
Address: https://github.com/bytedance/Fastbot_Android
Clone code: git clone https://github.com/bytedance/Fastbot_Android.git
adb push *.jar /sdcard
adb push libs/* /data/local/tmp/
adb shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin com.android.commands.monkey.Monkey -p com.xueqiu.android --agent robot --throttle 200 -v -v 1000
D:\auto_senior\Fastbot_Android>adb shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin com.android.commands.monkey.Monkey -p com.xueqiu.android --agent robot --throttle 200 -v -v 1000