+ All Categories
Home > Documents > Dragonfly: Encapsulating Android for Instrumentation University of Málaga

Dragonfly: Encapsulating Android for Instrumentation University of Málaga

Date post: 23-Feb-2016
Category:
Upload: hester
View: 46 times
Download: 0 times
Share this document with a friend
Description:
Dragonfly: Encapsulating Android for Instrumentation University of Málaga. Ana Rosario Espada María del Mar Gallardo Damián Adalid. Index. Introduction Android Overview Formalization Dragonfly Design Static Monitor Dynamic Monitor Conclusions. - PowerPoint PPT Presentation
Popular Tags:
33
Dragonfly: Encapsulating Android for Instrumentation University of Málaga Ana Rosario Espada María del Mar Gallardo Damián Adalid
Transcript
Page 1: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

Dragonfly: Encapsulating Android for Instrumentation

University of Málaga

Ana Rosario EspadaMaría del Mar Gallardo

Damián Adalid

Page 2: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

2

Index

• Introduction• Android Overview• Formalization• Dragonfly Design• Static Monitor• Dynamic Monitor• Conclusions

Page 3: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

3

INTRODUCTIONA Runtime Verification Framework for ANDROID Applications

Page 4: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

4

Introduction

More than 6 million ofdifferent applications

Different kinds of applications in the market

Page 5: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

5

Verification Techniques

Runtime VerificationRV is based on the observation of the traces generated by the execution of

a system to detect errors of its behavior.

RV types• Synchronous

Asynchronous• Internal External• Offline Online

Page 6: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

6

ANDROID OVERVIEWA Runtime Verification Framework for ANDROID Applications

Page 7: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

7

Android ArchitectureApplication

Built-in(phone, contacts, browser), Third-party/Custom

Application FrameworkTelephone Manager, Location Manager, Notification Manager, Content

providers, Windowing, Resource Manager, etc.

LibrariesGraphics, media, database, WebKit, etc.

Android RuntimeDalvik Virtual

Machine

Linux KernelPower, File system, drivers, process, management, etc.

Page 8: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

8

Android System

Page 9: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

9

Android System

Each application may be composed of different components:

•Activity: an independent visual screen for the user

•Service: particular task embedded inside a specific application

•Content provider: allows to provide data from one application to another

•Broadcast receiver: manages the messages sent by the system or the applications

Page 10: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

10

FORMALIZING ANDROIDA Runtime Verification Framework for ANDROID Applications

Page 11: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

11

Formalizing Android

We consider that applications may be in one of the following states:

•Inactive: the main thread does not yet exist.

•Active: the main thread of the application has been initialized and some service or activity is active.

•Paused: the application is initialized but none of its components is active.

Page 12: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

12

Formalizing Android

The configuration of an Android application is given by a tuple:

•ID: the application identifier.

•State: active, inactive or paused.

•Event queue: each of which may be directed to one or several components of a system application.

•Components: a list of activities, services, content providers or broadcast receivers.

Page 13: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

13

Formalizing AndroidAndroid is basically an event-driven OS. The whole system, its applications and its components evolve through events.

We formalize those events as transition rules, referred to the whole system, an application or a component.

Each element extracted from the event queue of an application may release concrete events for any component of the applications.

Page 14: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

14

Formalizing Android

Once the event has arrived at the event queue, it is distributed to the corresponding components.

Page 15: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

15

DRAGONFLY DESIGNA Runtime Verification Framework for ANDROID Applications

Page 16: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

16

Functionality

Events

Monitor throwing eventsAnd listening the traces

Verification with observers

Page 17: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

17

Dragonfly ArchitectureMonitor

INST

RUM

ENTA

TIO

N

Threads

Allocated Objects

Profiling data

Application Manager

Android Monitor Engine

Observer

Event Generators

Source

Emulator

Emulator

Emulator Android Model

Error Reports

Page 18: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

18

Application Manager

• Generates random events using Monkey

Source

Emulator

Emulator

Emulator

Application ManagerEvent Generators

$ adb shell monkey -p your.package.name -v 500

Page 19: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

19

Monitor Engine

Threads

Allocated Objects

Profiling data

Sour

ce

INST

RUM

ENTA

TIO

N

Abstract Monitor Engine

Android Monitor Engine

Generic Model

Android Model

Manager

Manager

Android Monitor Engine

Tools to extract information• DDMlib -> adb• JDI

•DDMlib allow us to start Android Debug Bridge and get useful information from the sources.•JDI (Java Debug Interface) is needed to detect method entry event and other specific events.

Page 20: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

20

Instrumentation and observers

Error Reports

INST

RUM

ENTA

TIO

N

Android Monitor Engine

Observer

Android Observers

Observer

Generic Observer

Android Model

Generic Model

Observer

Aspect Oriented Paradigm

Instrumentation : Spring AOPDSL: Lambdaj + AspectJ

Page 21: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

21

EXAMPLEA Runtime Verification Framework for ANDROID Applications

Page 22: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

22

Activity Life Cycle

Page 23: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

23

Activity Life Cycle

Page 24: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

24

STATIC MONITORA Runtime Verification Framework for ANDROID Applications

Page 25: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

25

Static Monitor

Static data are properties or values from the:

• Smart-phone: battery status, serial number…

• I/O’s: GPS status, camera status, signal strength…

• Applications: identifiers, names, main threads…

• Components: types, set of states…

Page 26: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

26

Static Monitor

Source

DDMlibANDROID

MODELStatic info Build

Page 27: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

27

DYNAMIC MONITORA Runtime Verification Framework for ANDROID Applications

Page 28: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

28

Dynamic Monitor

Dynamic data correspond to the sequence ofevents fired by the system or by the user. Wedefine three types of events:

•Actions related to the state of components

•Method calls

•Exceptions

LISTENERS

Page 29: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

29

Dynamic Monitor

SourceMonitor

Application Manager

Android Monitor Engine

Android Model

USB or Wireless

Stimulation events

Return events

Page 30: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

30

CONCLUSIONS & FUTURE WORKA Runtime Verification Framework for ANDROID Applications

Page 31: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

31

Conclusions

• We have developed a tool capable of:

– Verifying Android Applications on runtime

– Extending the verification to other platforms

– Saving a lot of verification properties

– Writing the properties in a semantic language

Page 32: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

32

Future Work

• Improve the DRAGONFLY’s capabilities combining DDMlib with other tools

• Improve DRAGONFLY’s efficency trying other types of instrumentations and DSL’s

Page 33: Dragonfly:  Encapsulating Android for Instrumentation University of  Málaga

Thanks!!

Questions?


Recommended