Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ecnusse/Kea
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangchenShen committed Jan 3, 2025
2 parents 4e03ede + b25cf1c commit 88aabe0
Show file tree
Hide file tree
Showing 210 changed files with 31,788 additions and 54 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/CoverReport'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ config.ymal

# virtual envirnment
kea_venv/

# locales backup
_locales/
100 changes: 47 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,80 @@
<div align="center">
<h1>Kea</h1>

<a href='https://dl.acm.org/doi/10.1145/3691620.3694986'><img src='https://img.shields.io/badge/acm-10.1145-blue.svg'></a> &nbsp;&nbsp;&nbsp;
<a href='LICENSE'><img src='https://img.shields.io/badge/License-MIT-orange'></a> &nbsp;&nbsp;&nbsp;
<a><img src='https://img.shields.io/badge/python-3.9, 3.10, 3.11, 3.12, 3.13-blue'></a> &nbsp;&nbsp;&nbsp;
<a href='https://kea-doc.readthedocs.io/en/latest/'><img src='https://img.shields.io/badge/doc-1.0.0-blue'></a>
<a href='https://kea-technic-docs.readthedocs.io/en/latest/part-theory/introduction.html'><img src='https://img.shields.io/badge/doc-1.0.0-blue'></a>
</div>

<div align="center">
<img src="kea/resources/kea_log(1).png" alt="kea_logo" style="border-radius: 18px"/>
</div>

<p>

</p>
### [中文文档](README_CN.md)

### Intro

Kea is a general and practical testing tool based on the idea of [property-based testing](https://en.wikipedia.org/wiki/Software_testing#Property_testing) for finding functional bugs in mobile (GUI) apps.
Kea currently supports Android and HarmonyOS.

📘 **[Kea's Paper@ASE 2024](https://xyiheng.github.io//files/Property_Based_Testing_for_Android_Apps.pdf)**

<p align="center">
<img src="kea/resources/kea-platforms.jpg" width="300"/>
</p>

### Publication

📘 **[Kea's Paper @ ASE 2024 (ACM Distinguished Paper)](https://xyiheng.github.io//files/Property_Based_Testing_for_Android_Apps.pdf)**

> "General and Practical Property-based Testing for Android Apps".
> Yiheng Xiong, Ting Su, Jue Wang, Jingling Sun, Geguang Pu, Zhendong Su.
> In ASE 2024.
You can find more about our work on testing/analyzing mobile apps at this [website](https://mobile-app-analysis.github.io).
You can find more about our work on testing/analyzing mobile apps at this [ECNU SE lab - mobile app analysis](https://mobile-app-analysis.github.io).

📘 **[User manual & Documentation](https://kea-doc.readthedocs.io/en/latest/)**

### [Demonstration Video (Chinese)](https://www.bilibili.com/video/BV1QPkoYREgh/?share_source=copy_web)

The apk file used in our evaluation can be downloaded from [here](https://drive.google.com/drive/folders/19Ysgnnwr1HDvrXBW7t1uYB_T7QdwkZKC?usp=sharing)
### Docs

## Setup
[Full Doc](https://kea-docs.readthedocs.io/en/latest/part-theory/introduction.html)

Requirements:
[User Manual](https://kea-docs.readthedocs.io/en/latest/part-keaUserManuel/envirnment_setup.html)

- Python 3.9+
- `adb` cmd avaliable (Android SDK)
- An emulator or devices connected to your PC
[Design Manual](https://kea-docs.readthedocs.io/en/latest/part-designDocument/intro.html)

[Test Report](https://kea-docs.readthedocs.io/en/latest/part-experiment/exp.html)

You can input following commands to grep and install the required packages.
[Coverage Report](https://ecnusse.github.io/Kea/)

```bash
git clone https://github.com/ecnusse/Kea.git
cd Kea
pip install -e .
```

You can create an emulator before running Kea. See [this link](https://stackoverflow.com/questions/43275238/how-to-set-system-images-path-when-creating-an-android-avd) for how to create avd using [avdmanager](https://developer.android.com/studio/command-line/avdmanager).
The following sample command will help you create an emulator, which will help you start using Kea quickly:
### Installation and Quickstart

```bash
sdkmanager "build-tools;29.0.3" "platform-tools" "platforms;android-29"
sdkmanager "system-images;android-29;google_apis;x86"
avdmanager create avd --force --name Android10.0 --package "system-images;android-29;google_apis;x86" --abi google_apis/x86 --sdcard 1024M --device "pixel_2"
```
**Prerequisites**

Next, you can start one emulator and assign their port numbers with the following commands:
- Python 3.9+
- `adb` or `hdc` cmd tools available
- Connect an Android / HarmonyOS device or emulator to your PC

```bash
emulator -avd Android10.0 -read-only -port 5554
```
[The setup guide for Android / HarmonyOS envirnments.](https://kea-technic-docs.readthedocs.io/en/latest/part-keaUserManuel/envirnment_setup.html)

**Installation**

## Getting Started
Enter the following commands to install kea.

### Quick example
```bash
git clone https://github.com/ecnusse/Kea.git
cd Kea
pip install -e .
```

If you have downloaded our project and configured the environment, you only need to enter "example/" to execute our sample property with the following command:
**Quick Start**

```
kea -f example.py -a omninotes.apk
kea -f example/example_property.py -a example/omninotes.apk
```

That's it! You can see the test results in the "output" directory.


## Functional bugs found by Kea

* OmniNotes: [#942](https://github.com/federicoiosue/Omni-Notes/issues/942), [#946](https://github.com/federicoiosue/Omni-Notes/issues/946), [#948](https://github.com/federicoiosue/Omni-Notes/issues/948), [#949](https://github.com/federicoiosue/Omni-Notes/issues/949), [#950](https://github.com/federicoiosue/Omni-Notes/issues/950), [#951](https://github.com/federicoiosue/Omni-Notes/issues/951), [#954](https://github.com/federicoiosue/Omni-Notes/issues/954), [#956](https://github.com/federicoiosue/Omni-Notes/issues/956), [#939](https://github.com/federicoiosue/Omni-Notes/issues/939), [#981](https://github.com/federicoiosue/Omni-Notes/issues/981), [#937](https://github.com/federicoiosue/Omni-Notes/issues/937), [#938](https://github.com/federicoiosue/Omni-Notes/issues/938), [#938](https://github.com/federicoiosue/Omni-Notes/issues/937), [#939](https://github.com/federicoiosue/Omni-Notes/issues/937), [#940](https://github.com/federicoiosue/Omni-Notes/issues/940), [#941](https://github.com/federicoiosue/Omni-Notes/issues/941), [#945](https://github.com/federicoiosue/Omni-Notes/issues/945),
* Markor: [#2153](https://github.com/gsantner/markor/issues/2153), [#2196](https://github.com/gsantner/markor/issues/2196), [#2197](https://github.com/gsantner/markor/issues/2197), [#2198](https://github.com/gsantner/markor/issues/2198), [#2199](https://github.com/gsantner/markor/issues/2199), [#2250](https://github.com/gsantner/markor/issues/2250)
* AmazeFileManager: [#3991](https://github.com/TeamAmaze/AmazeFileManager/issues/3991), [#4016](https://github.com/TeamAmaze/AmazeFileManager/issues/4016), [#4130](https://github.com/TeamAmaze/AmazeFileManager/issues/4130)
* AnkiDroid: [#15993](https://github.com/ankidroid/Anki-Android/issues/15993), [#15995](https://github.com/ankidroid/Anki-Android/issues/15995)
* transistor: [#488](https://codeberg.org/y20k/transistor/issues/488), [#489](https://codeberg.org/y20k/transistor/issues/489), [#495](https://codeberg.org/y20k/transistor/issues/495)
* Simpletask: [#1230](https://github.com/mpcjanssen/simpletask-android/issues/1230)

### Relevant Tools Used in Kea

1. [droidbot](https://github.com/honeynet/droidbot)
2. [uiautomator2](https://github.com/openatx/uiautomator2)
3. [hmdriver2](https://github.com/codematrixer/hmdriver2)
4. [hypothesis](https://github.com/HypothesisWorks/hypothesis)

### Contributors/Maintainers

The original authors of Kea are:
Expand All @@ -102,11 +84,23 @@ The original authors of Kea are:
[Jingling Sun](https://jinglingsun.github.io/),
[Geguang Pu](),
[Zhendong Su](https://people.inf.ethz.ch/suz/).

Now we have additional active contributors:
[Xiangchen Shen](https://xiangchenshen.github.io/),
[Xixian Liang](https://xixianliang.github.io/resume/),
[Mengqian Xu]()

### Relevant Tools Used in Kea

- [Droidbot](https://github.com/honeynet/droidbot)
- [HMDroidbot](https://github.com/ecnusse/HMDroidbot)
- [hypothesis](https://github.com/HypothesisWorks/hypothesis)
- [hmdriver2](https://github.com/codematrixer/hmdriver2)
- [uiautomator2](https://github.com/openatx/uiautomator2)


### References

<details>
<summary>Relevant References for Kea</summary>

Expand Down
127 changes: 127 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<div align="center">
<h1>Kea</h1>

<a href='LICENSE'><img src='https://img.shields.io/badge/License-MIT-orange'></a> &nbsp;&nbsp;&nbsp;
<a><img src='https://img.shields.io/badge/python-3.9, 3.10, 3.11, 3.12, 3.13-blue'></a> &nbsp;&nbsp;&nbsp;
<a href='https://kea-technic-docs.readthedocs.io/zh-cn/latest/part-theory/introduction.html'><img src='https://img.shields.io/badge/doc-1.0.0-blue'></a>
</div>

<div align="center">
<img src="kea/resources/kea_log(1).png" alt="kea_logo" style="border-radius: 18px"/>
</div>



### 简介

Kea 是一个通用的测试工具,通过[基于性质的测试](https://en.wikipedia.org/wiki/Software_testing#Property_testing) 发现移动(GUI)应用中的功能性错误。
Kea 目前支持 Android 和 HarmonyOS。


<p align="center">
<img src="kea/resources/kea-platforms.jpg" width="300"/>
</p>

### 论文

📘 **[Kea's Paper @ ASE 2024 (ACM Distinguished Paper)](https://xyiheng.github.io//files/Property_Based_Testing_for_Android_Apps.pdf)**

> "General and Practical Property-based Testing for Android Apps".
> Yiheng Xiong, Ting Su, Jue Wang, Jingling Sun, Geguang Pu, Zhendong Su.
> In ASE 2024.
你可以在 [ECNU SE lab - mobile app analysis](https://mobile-app-analysis.github.io) 找到我们的相关工作。


### [演示视频](https://www.bilibili.com/video/BV1QPkoYREgh/?share_source=copy_web)

### Docs

[文档](https://kea-docs.readthedocs.io/zh-cn/latest/part-theory/introduction.html)

[用户手册](https://kea-docs.readthedocs.io/zh-cn/latest/part-keaUserManuel/envirnment_setup.html)

[设计手册](https://kea-docs.readthedocs.io/zh-cn/latest/part-designDocument/intro.html)

[测试报告](https://kea-docs.readthedocs.io/zh-cn/latest/part-experiment/exp.html)

[覆盖报告](https://ecnusse.github.io/Kea/)


### 安装和使用

**环境配置**

- Python 3.9+
- `adb` or `hdc` cmd tools available
- Connect an Android / HarmonyOS device or emulator to your PC

[安卓/鸿蒙环境配置教程](https://kea-technic-docs.readthedocs.io/zh-CN/latest/part-keaUserManuel/envirnment_setup.html)

**工具安装**

输入以下命令安装 Kea。

```bash
git clone https://github.com/ecnusse/Kea.git
cd Kea
pip install -e .
```

**快速开始**

```
kea -f example/example_property.py -a example/omninotes.apk
```

### 作者/维护者

Kea的原作者是:
[Yiheng Xiong](https://xyiheng.github.io/),
[Ting Su](http://tingsu.github.io/),
[Jue Wang](https://cv.juewang.info/),
[Jingling Sun](https://jinglingsun.github.io/),
[Geguang Pu](),
[Zhendong Su](https://people.inf.ethz.ch/suz/).

目前 Kea 的核心维护者:
[Xiangchen Shen](https://xiangchenshen.github.io/),
[Xixian Liang](https://xixianliang.github.io/resume/),
[Mengqian Xu](), [Bo Ma]()

### Kea 参考的开源工具

- [Droidbot](https://github.com/honeynet/droidbot)
- [HMDroidbot](https://github.com/ecnusse/HMDroidbot)
- [hypothesis](https://github.com/HypothesisWorks/hypothesis)
- [hmdriver2](https://github.com/codematrixer/hmdriver2)
- [uiautomator2](https://github.com/openatx/uiautomator2)


### 相关阅读

<details>
<summary>Relevant References for Kea</summary>

📘 An Empirical Study of Functional Bugs in Android Apps. ISSTA 2023. [pdf](https://dl.acm.org/doi/10.1145/3597926.3598138)

📘 Property-Based Testing for Validating User Privacy-Related Functionalities in Social Media Apps. FSE 2024. [pdf](https://dl.acm.org/doi/10.1145/3663529.3663863)

📘 Property-Based Fuzzing for Finding Data Manipulation Errors in Android Apps. ESEC/FSE 2023. [pdf](https://dl.acm.org/doi/10.1145/3611643.3616286)

📘 Characterizing and Finding System Setting-Related Defects in Android Apps. TSE 2023. [pdf](https://ieeexplore.ieee.org/document/10064083)

📘 Understanding and Finding System Setting-related Defects in Android Apps. ISSTA 2021. [pdf](https://dl.acm.org/doi/10.1145/3460319.3464806)

</details>

<details>
<summary>References for Property-based Testing</summary>

📘 Property-Based Testing in Practice. ICSE 2024. [pdf](https://dl.acm.org/doi/10.1145/3597503.3639581)

📘 QuickCheck: a lightweight tool for random testing of Haskell programs. ICFP 2000. [pdf](https://dl.acm.org/doi/10.1145/357766.351266)

📘 Property-based testing: a new approach to testing for assurance. Software Engineering Notes 1997. [pdf](https://dl.acm.org/doi/pdf/10.1145/263244.263267)

</details>
22 changes: 22 additions & 0 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.11"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
Loading

0 comments on commit 88aabe0

Please sign in to comment.