Coder Social home page Coder Social logo

c0de3 / timemachine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from droidtest/timemachine

0.0 1.0 0.0 83.99 MB

Time-travel Testing

Home Page: https://www.comp.nus.edu.sg/~abhik/pdf/ICSE20TM.pdf

License: GNU Lesser General Public License v3.0

Shell 0.04% Python 99.96% Dockerfile 0.01%

timemachine's Introduction

TimeMachine

TimeMachine is an automated testing tool for Android apps, which can automatically jump to the most progressive state observed in the past when progress is slow.

TimeMachine leverages virtualization technology such as emulator to save an app state and restore it when needed. TimeMachine identifies an app state with GUI layout and memories all discovered states. When a state is considered interesting, e.g., new code is covered, TimeMachine saves the state. Meanwhile, TimeMachine observes most-recently-visited states to check whether progress is slow, e.g., being stuck in a state loop. Once progress is considered slow, TimeMachine restores the most progressive one from saved states for further exploration so that more program behavior is exercised in a short time.

Publication

The paper PDF can be found at https://www.comp.nus.edu.sg/~abhik/pdf/ICSE20TM.pdf

@InProceedings{zhendong:icse:2020,
author = {Dong, Zhen and B{\"o}hme, Marcel and Cojocaru, Lucia and Roychoudhury, Abhik},
title = {Time-travel Testing of Android Apps},
booktitle = {Proceedings of the 42nd International Conference on Software Engineering},
series = {ICSE '20},
year = {2020},
pages={1-12}}

Architecture

The figure above shows TimeMachine's architecture. The whole system runs in a docker container with the Ubuntu operating system. App under test is installed in an Android virtual machine. TimeMachine connects the virtual machine via ADB to test the app. Main Components are configured as followed:

  • Android SDK Version 25
  • Android-x86-7.1.r2
  • Virtualbox 5.1.38 or 5.0.18
  • Docker API v1.13 or above
  • Python 2.7.2

Todo

Ubuntu version needs to be specified in the current setting, Ubuntu 18.04 for now.
Develop a module to dynamically identify versions of the operation system for image building.

Setup

The following is required to set up TimeMachine:

  • at least 100 GB hard drive
  • 8 GB memory
  • Ububntu 18.04 64-bit

Step 1: clone repository

git clone https://github.com/DroidTest/TimeMachine.git

Step 2: install dependencies

install and configure docker

sudo apt-get install docker.io
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker 

step 3: build an docker image

docker build -t droidtest/timemachine:1.0 .

It takes serveral minutes. Note: you should build the docker image whenever your running Linux kernel has been changed(e.g. kernel updated).

Usage

TimeMachine takes as input apks instrumented with Android apps instrumenting tool Emma or Ella. Under folder two_apps_under_test are closed-source apks instrumented with Ella, i.e., Microsoft Word and Duolingo.

cd fuzzingandroid

Test example apps in a container

#USAGE: exec-single.bash APP_DIR OPEN_SOURCE DOCKER_IMAGE TIMEOUT [OUTPUT_PATH]

./exec-single-app.bash ../two_apps_under_test/ms_word/ 0 droidtest/timemachine:1.0 1800 ../word_output
./exec-single-app.bash ../two_apps_under_test/duolingo/ 0 droidtest/timemachine:1.0 1800 ../duolingo_output

Output

check method coverage

./compute_cov_aver.bash ../word_output/ ../two_apps_under_test/ms_word/
./compute_cov_aver.bash ../duolingo_output/ ../two_apps_under_test/duolingo/

check crashes

cat word_output/timemachine-output/crashes.log
cat duolingo_output/timemachine-output/crashes.log 

Need help?

  • If failed to connect VM, please check whether virtualbox is correctly installed. TimeMachine was tested on virtualbox 5.0.18 and virtualbox 5.1.38.
  • Contact Zhen Dong for further issues.

Contributors

  • Zhen Dong ([email protected])
  • Lucia Cojocaru
  • Xiao Liang Yu
  • Marcel Böhme
  • Abhik Roychoudhury

timemachine's People

Contributors

zhendong2050 avatar droidtest avatar yxliang01 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.