This repository contains all the artifacts (including the source code of PBFDroid, the APK files of all app subjects, and the defined DMF specifications for all app subjects) in our study.
home
|
|--- src: The source code of PBFDroid
|
|--- start.py: The entry of PBFDroid, which accepts the tool parameters
|--- fuzzing.py: The main module of our property-based fuzzing approach
|--- record.py: The main module of DMF instantiator
|
|--- apks: The apk files of 17 open source apps used in our experiment
|--- dmf_datas: The defined DMF specifications for all the apps
|
PBFDroid is an automated GUI testing tool to support the application of our property-based fuzzing approach, which can effectively find data manipulation errors.
git clone https://github.com/Hardwell369/PBFDroid.git
If your system has the following support, you can directly run PBFDroid
- Android SDK: API 26+
- Python 3.7
We use some python libraries, you can install them with uv:
# Install uv if you haven't installed it yet
pip install uv
# Check uv version to make sure it is installed successfully
uv --version
# cd to the PBFDroid directory
cd ./PBFDroid/
# Create a virtual environment
uv venv PBFDroid
# Activate the virtual environment in bash (Linux/Mac)
source PBFDroid/bin/activate
# or in PowerShell (Windows)
.\PBFDroid\Scripts\Activate.ps1
# Install the required packages
uv pip sync uv.lock
You need to create an emulator before running PBFDroid. See this link to find out how to create avd using avdmanager. The following sample command illustrates how to create an emulator:
sdkmanager "system-images;android-26;google_apis;x86"
avdmanager create avd --force --name Android8.0 --package 'system-images;android-26;google_apis;x86' --abi google_apis/x86 --sdcard 512M --device "pixel_xl"
Next, you can start an emulator with the following commands:
emulator -avd Android8.0 -read-only -port 5554
Detect DMEs (video tutorial)
If you have downloaded our project and configured the environment, you only need to enter "download_path/home" to execute our sample app with the following command:
python src/start.py -app_path apks/anymemo.apk -json_name _anymemo -device_serial emulator-5554 -root_path download_path/home -choice 1 -event_num 400 -max_time 57600 -result_path output
Here,
-app_pathpath of the app under test (AUT).-json_namename of the folder that stores the AUT's DMFs-root_pathup-level directory of the folder that stores all DMFs-choice1: run property-based fuzzing to detect DMEs, 2: record DMFs-event_numnumber of events in each test-max_timeallocates the running time of PBFDroid (in seconds)
Record DMF (video tutorial)
You can start the DMF instantiator module for defining DMF with the following command:
python src/start.py -root_path dmf_datas/ -choice 2 -app_path apks/anymemo.apk -json_name _anymemo -device_serial emulator-5554
Before conducting user study, we created a user manual for PBFDroid, you can find it here.