# Fastbot-Android Open Source Handbook
## Introduction
> Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems. It combines machine learning and reinforcement learning techniques to assist discovery in a more intelligent way.
> Related: [Fastbot-iOS](https://github.com/bytedance/Fastbot_iOS)
***More detail see at [Fastbot architecture](https://mp.weixin.qq.com/s/QhzqBFZygkIS6C69__smyQ)
## Features
* Fastbot is compatible with multiple Android OS systems, including original Android, Android 5-12 and a variation of modified Andriod-based system by domestic manufacturers.
* Inherited from original Monkey, Fastbot allows for fast action insertion as high as 12 actions per second.
* Expert system is equipped with the ability to customize deeply based on needs from different business lines.
* Fastbot is a model-based-testing tool. Model is build via graph transition with the consideration of high reward choice selection.
* Fastbot supports non-standard widgets by computer vision techniques such as YOLOv3, ocr and cv segmentation.
**update 2022.1**
* update Fastbot Revised License
* release AnyTrace, the Fastbot test management assistant: supports one-click Fastbot test start, crash analysis, etc. ([AnyTrace User Manual](https://www.volcengine.com/docs/6431/82895))
**update 2021.11**
* support android 12
* add some new GUI fuzzing & mutation features (inspired/supported by [Themis](https://github.com/the-themis-benchmarks/home))
**update 2021.09**
* Fastbot supports model reuse: see at `/sdcard/fastbot_[packagename].fbm`. This file is loaded by default if it exists when Fastbot starts. During execution, it is overwritten every 10 minutes. The user can delete or copy this file based on their needs.
## Usage
### Environment preparation
* Make sure Android version on your device or emulator is Android 5, 6, 7, 8, 9, 10, 11, 12
* Push `framework.jar fastbot-thirdpart.jar monkeyq.jar` into your device, most likely /sdcard, push `libs/* ` to `/data/local/tmp/`
```shell
adb push *.jar /sdcard
adb push libs/* /data/local/tmp/
```
### Run Fastbot with shell command
`
adb -s device_vendor_id shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin
com.android.commands.monkey.Monkey -p package_name --agent reuseq --running-minutes duration(min) --throttle delay(ms) -v -v
`
* before run the command,user can push the strings in apk to `/sdcard/` to improve the model
* `aapt2` or `aapt` depends your android sdk, a sample aapt path is ``` ${ANDROID_HOME}/build-tools/28.0.2/aapt2```
```shell
aapt2 dump --values strings [testApp_path.apk] > max.valid.strings
adb push max.valid.strings /sdcard
```
> For more Details, please refer to the handbook in [中文手册](./handbook-cn.md)
#### required parameters
``` shell
-s device_vendor_id # if multiple devices allowed, this parameter is needed; otherwise just optional
-p package_name # app package name under test, the package name for the app under test can be acquired by "adb shell pm list package", once the device is ensured for connection by "adb devices"
--agent robot # strategy selected for testing, no need to modify
--running-minutes duration # total amount time for testing
--throttle delay # time lag between actions
```
#### optional parameters
``` shell
--bugreport # log printed when crash occurs
--output-directory /sdcard/xxx # folder for output directory
```
#### optional fuzzing data
``` shell
adb push data/fuzzing/ /sdcard/
adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/fuzzing
```
### Results Explanation
#### Observed crash and ANR
* Observed Java crash, ANR and native crash will be written into /sdcard/crash-dump.log
* Observed ANR will be written into /sdcard/oom-traces.log
#### Activity coverage data
* Total activity list will be printed in shell after Fastbot job done, together with explored activity list and rate of coverage in this job run.
* Equation for total activity coverage: coverage = exploredActivity / totalActivity * 100%
* Be aware for totalActivity: The list totalActivity is acquired through framework interface PackageManager.getPackageInfo. Contained activities in the list includes many abandoned, invisible or not-reachable activities.
## Acknowledgement
* We appreciate the insights and code contribution from project APE by Dr. Tianxiao Gu and Prof. Zhendong Su (ETH Zurich) etc.
* We thank the useful discussions with Prof. Yao Guo (PKU) on Fastbot.
* We want to express our gratitude to Prof. Zhenhua Li (THU), Dr. Liangyi Gong (THU) and Prof. Ting Su (East China Normal University) for their helpful opinions on Fastbot.
* We are also grateful for valuable advices from Prof. Jian Zhang (Chinese Academy of Sciences).
## Publications
If you use our work in your research, please kindly cite us as:
1. Lv, Zhengwei, Chao Peng, Zhao Zhang, Ting Su, Kai Liu, Ping Yang (2022). “Fastbot2: Reusable Automated Model-based GUI Testing for Android Enhanced by Reinforcement Learning”. In proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (ASE 2022). ACM, To appear. [[pdf]](https://se-research.bytedance.com/pdf/ASE22.pdf)
```bibtex
@inproceedings{fastbot2,
title={Fastbot2: Reusable Automated Model-based GUI Testing for Android Enhanced by Reinforcement Learning},
author={Lv, Zhengwei and Peng, Chao and Zhang, Zhao and Su, Ting and Liu, Kai and Yang, Ping},
booktitle={Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (ASE 2022)},
year={2022}
}
```
2. Peng, Chao, Zhao Zhang, Zhengwei Lv, Ping Yang (2022). “MUBot: Learning to Test Large-Scale Commercial Android Apps like a Human”. In proceedings of the 38th International Conference on Software Maintenance and Evolution (ICSME 2022). IEEE, To appear. [[pdf]](https://se-research.bytedance.com/pdf/ICSME22B.pdf)
```bibtex
@inproceedings{mubot,
title={MUBot: Learning to Test Large-Scale Commercial Android Apps like a Human},
author={Peng, Chao and Zhang, Zhao and Lv, Zhengwei and Yang, Ping},
booktitle={Proceedings of the 38th International Conference on Software Maintenance and Evolution (ICSME 2022)},
year={2022}
}
```
3. Cai, Tianqin, Zhao Zhang, and Ping Yang. “Fastbot: A Multi-Agent Model-Based Test Generation System”. In Proceedings of the IEEE/ACM 1st International Conference on Automation of Software Test. 2020. [[pdf]](https://se-research.bytedance.com/pdf/AST20.pdf)
```bibtex
@inproceedings{fastbot,
title={Fastbot: A Multi-Agent Model-Based Test Generation System},
author={Cai, Tianqin and Zhang, Zhao and Yang, Ping},
booktitle={Proceedings of the IEEE/ACM 1st International Conference on Automation of Software Test},
pages={93--96},
year={2020}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
Fastbot -Monkey 测试工具
共94个文件
png:15个
strings:5个
so:4个
需积分: 0 5 下载量 97 浏览量
2023-06-14
17:12:09
上传
评论
收藏 166.18MB ZIP 举报
温馨提示
Monkey 测试工具 ---Fastbot
资源推荐
资源详情
资源评论
收起资源包目录
Fastbot_Android-main (1).zip (94个子文件)
Fastbot_Android-main
monkeyq.jar 76KB
doc
getpackagename.png 108KB
strings.png 13KB
scheme.png 63KB
activitys.png 119KB
usb1.png 310KB
actions2.png 83KB
permission.png 133KB
oppo1.png 142KB
actions.png 177KB
automatorview.png 169KB
vivo1.png 185KB
maximview.png 354KB
getactivity.png 58KB
black.png 53KB
data
fuzzing
image44.webp 194KB
video3.mpg 4.71MB
video10.swf 4.88MB
video2.flv 12.22MB
image22.vda 5.93MB
video1.avi 1.65MB
image2.png 2.3MB
image32.ps 12.02MB
image34.bmp 5.93MB
image30.pgm 5.93MB
image28.xbm 0B
image10.bw 5.93MB
image12.dib 5.93MB
video5.f4v 1.42MB
video6.mp4 12.91MB
video7.wmv 5.36MB
image39.apng 2.3MB
image19.j2k 2.57MB
image25.gif 1.53MB
image4.pdf 273KB
video13.mpeg 3.28MB
image38.rgba 5.93MB
image13.mpo 272KB
video14.m4v 5.08MB
image5.icb 5.93MB
image43.jfif 272KB
image35.icns 2.43MB
image6.tga 5.93MB
image21.tiff 5.93MB
image17.tif 5.93MB
image36.im 5.93MB
image29.jpe 272KB
music1.mp3 10.9MB
image16.j2c 2.57MB
image33.jp2 2.57MB
video9.vob 3.31MB
image3.jpg 272KB
image9.ppm 5.93MB
image11.vst 5.93MB
music2.mp3 1.15MB
image31.ico 78KB
image15.jpeg 272KB
image23.jpc 2.57MB
image8.pbm 5.93MB
image14.sgi 5.93MB
image42.pcx 5.76MB
image27.jpg 282KB
image41.heic 227KB
video11.mov 1.3MB
image40.msp 0B
video12.ts 4.45MB
image20.heif 227KB
image24.pnm 5.93MB
image37.eps 12.02MB
image18.palm 0B
video8.mkv 1.42MB
image7.jpf 2.57MB
image1.rgb 5.93MB
video4.3gp 1.29MB
image26.jpx 2.57MB
LICENSE 2KB
libs
armeabi-v7a
libfastbot_native.so 1.52MB
arm64-v8a
libfastbot_native.so 1.9MB
x86_64
libfastbot_native.so 2.02MB
x86
libfastbot_native.so 1.94MB
handbook-cn.md 17KB
test
max.xpath.actions 513B
ADBKeyBoard.apk 160KB
awl.strings 101B
max.fuzzing.strings 27KB
max.config 226B
abl.strings 75B
max.widget.black 219B
max.schema.strings 40B
max.tree.pruning 629B
max.strings 32B
README.md 7KB
fastbot-thirdpart.jar 84KB
framework.jar 1.1MB
共 94 条
- 1
资源评论
qq_44755552
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功