├── .gitignore └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | bin/ 10 | build/ 11 | develop-eggs/ 12 | dist/ 13 | eggs/ 14 | lib64/ 15 | parts/ 16 | sdist/ 17 | var/ 18 | *.egg-info/ 19 | .installed.cfg 20 | *.egg 21 | 22 | # Installer logs 23 | pip-log.txt 24 | pip-delete-this-directory.txt 25 | 26 | # Unit test / coverage reports 27 | .tox/ 28 | .coverage 29 | .cache 30 | nosetests.xml 31 | coverage.xml 32 | 33 | # Rope 34 | .ropeproject 35 | 36 | # ide 37 | .idea/ 38 | 39 | # OS generated 40 | .DS_Store 41 | .DS_Store? 42 | .Spotlight-V100 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Sapienz Prototype (Out-of-date) 2 | Sapienz: Multi-objective Automated Testing for Android Applications 3 | 4 | This is a prototype of the Sapienz approach for multi-objective automated testing for Android applications. 5 | Please note that this repository is no longer maintained. 6 | 7 | Publication: 8 | ``` 9 | @InProceedings{mao:sapienz:16, 10 | author = "Ke Mao and Mark Harman and Yue Jia", 11 | title = "Sapienz: Multi-objective Automated Testing for {Android} Applications", 12 | booktitle = "Proc. of ISSTA'16", 13 | year = "2016", 14 | pages = {94--105} 15 | } 16 | ``` 17 | 18 | ## Installation 19 | 20 | Simply download the artefact [here](https://github.com/Rhapsod/sapienz/archive/d0f06c30800332bbafa7cf0ed32379fe1abcad5d.zip) and apply the following environment configuration: 21 | 22 | ### Environment Configration 23 | * Python: 2.7 24 | 25 | * Android SDK: 26 | API 19 27 | 28 | * Linux: 29 | sudo apt-get install libfreetype6-dev libxml2-dev libxslt1-dev python-dev 30 | 31 | * Mac OS: 32 | brew install coreutils for gtimeout 33 | 34 | Install Python dependencies: 35 | 36 | sudo pip install -r requirements.txt 37 | 38 | 39 | ## Usage 40 | python main.py 41 | 42 | where apk\_path is path to the subject apk under test 43 | or you can specify source\_folder\_path for the subject app with source code 44 | 45 | ### Subject Requirement: 46 | * instrumented apk should be compiled and named with suffix "-debug.apk" 47 | * closed-source/non-instrumented apk name should end with ".apk" 48 | 49 | ### Settings 50 | * ANDROID\_HOME and WORKING\_DIR in settings.py should be set before starting Sapeinz. 51 | 52 | ### Output 53 | * for open-sourced apps, outputs are stored under the given source folder 54 | * for closed-sourced apps, output are stored under _output 55 | 56 | Output content: 57 | 58 | /coverages - Coverage reports are stored here 59 | 60 | /crashes - Crash reports and corresponding test cases that lead to the crashes 61 | (and also recorded videos files when using real devices) 62 | 63 | /intermediate - Generated test event sequences for each generation; logbook of the genetic evolution; 64 | and line charts showing the variation trend for each objectives. 65 | 66 | 67 | ## Notes 68 | * This implementation has been tested with Android 4.4, running on Ubuntu 14.04 and Mac OS 10.10 69 | * If measure statement coverage for open-sourced apps, the subjects need to be processed to support EMMA instrumentation: 70 | (Please refer to Dynodroid https://code.google.com/archive/p/dyno-droid/) 71 | * This version is only for emulators running on a physical PC. 72 | 73 | 74 | ## Contact 75 | 76 | --------------------------------------------------------------------------------