Dynodroid: Dynamic Analysis of Smartphone Apps

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Android Application Development A Tutorial Driven Course.
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Automating Software Module Testing for FAA Certification Usha Santhanam The Boeing Company.
1.A tool helps us mange the state of an emulator instance or Android-powered device 2.It is client-sever program that include three comopnents: 1). A.
Android OS : Core Concepts Dr. Jeyakesavan Veerasamy Sr. Lecturer University of Texas at Dallas
White Box and Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
Apache Struts Technology
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Agile Route Shopper Tracker Shopperception: Using a KINECT to build real world Google Analytics.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Android Tools & Wireless ADB Αντρέας Λύμπουρας Θεόφιλος Φωκάς Ζαχαρίας Χ’’Λάμπρου.
Dynodroid: An Input Generation System for Android Apps
Requirements Engineering n Elicit requirements from customer  Information and control needs, product function and behavior, overall product performance,
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Android Application Development. Agenda  Android Business Model  Why Android  Android application market space  Market Segments & Target customers.
Testing Components in the Context of a System CMSC 737 Fall 2006 Sharath Srinivas.
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Automation Fundamental Concepts &
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CS5103 Software Engineering Lecture 08 Android Development II.
Dynodroid: An Input Generation System for Android Apps
Chapter 6 System Engineering - Computer-based system - System engineering process - “Business process” engineering - Product engineering (Source: Pressman,
Presented by: Kushal Mehta University of Central Florida Michael Spreitzenbarth, Felix Freiling Friedrich-Alexander- University Erlangen, Germany michael.spreitzenbart,
Requirements Analysis
1 The Architectural Design of FRUIT: A Family of Retargetable User Interface Tools Yi Liu, H. Conrad Cunningham and Hui Xiong Computer & Information Science.
ITCS 6010 SALT. Speech Application Language Tags (SALT) Speech interface markup language Extension of HTML and other markup languages Adds speech and.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Grey Box testing Tor Stålhane. What is Grey Box testing Grey Box testing is testing done with limited knowledge of the internal of the system. Grey Box.
A Use Case Primer 1. The Benefits of Use Cases  Compared to traditional methods, use cases are easy to write and to read.  Use cases force the developers.
2131 Structured System Analysis and Design By Germaine Cheung Hong Kong Computer Institute Lecture 8 (Chapter 7) MODELING SYSTEM REQUIREMENTS WITH USE.
TESTING LEVELS Unit Testing Integration Testing System Testing Acceptance Testing.
.  A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate.  Taken advantage of Spring’s multi layer injection.
Xusheng Xiao North Carolina State University CSC 720 Project Presentation 1.
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays - done for rsrv in 3.14 Channel access priorities - planned to.
Mohit Anand, Software Engineer Adobe 1 Selecting GUI Automation Testing Tool for Mobile Domain.
G.Govi CERN/IT-DB 1 September 26, 2003 POOL Integration, Testing and Release Procedure Integration  Packages structure  External dependencies  Configuration.
By Mr. Muhammad Pervez Akhtar
Software Quality Assurance and Testing Fazal Rehman Shamil.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
Introduction to Software Testing Part1 Summary & Terms
Running a Forms Developer Application
Free for All! Assessing User Data Exposure to Advertising Libraries on Android Campbell Foskin.
Software Testing.
Control Flow Testing Handouts
John D. McGregor Session 9 Testing Vocabulary
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Introduction to Event-Driven Programming
Software Testing Techniques
Computer Aided Software Engineering (CASE)
Presented by Xiaohui (Amy) Lin
In-situ Visualization using VisIt
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Stacks Chapter 4.
John D. McGregor Session 9 Testing Vocabulary
CMPE419 Mobile Application Development
Virtual Machine Emulator Tutorial
UNIT-4 BLACKBOX AND WHITEBOX TESTING
John D. McGregor Session 9 Testing Vocabulary
Behavioral Models for Software Development
Network Profiler: Towards Automatic Fingerprinting of Android Apps
Application Development A Tutorial Driven Course
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Chapter 1 Computer System Overview
CSE 1020:Software Development
CMPE419 Mobile Application Development
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Dynodroid: Dynamic Analysis of Smartphone Apps

Introduction  Dynodroid is a system for automatically generating relevant inputs to Android apps It is capable of generating both UI inputs and system inputs. It also allows interleaving inputs from machine and human Dynodroid views an app as an event-driven program

Usage Dynodroid was evaluated with 50 open source android apps The same was evaluated using human exercising and Monkey tool Dynodroid, humans, and Monkey covered 55%, 60%, and 53% java code, respectively Monkey took 20X more events on average than Dynodroid. Dynodroid found bugs in top google apps

Dynodroid was built on following criteria Robust - Does the system handle real-world apps? Black-box - Does the system forgo the need for app sources and the ability to decompile app binaries? Versatile - Is the system capable of exercising important app functionality? Automated - Does the system reduce manual effort? Efficient - Does the system generate concise  inputs, i.e., avoid generating redundant inputs?

Working The main principle underlying Dynodroid is an observe- select-execute cycle. observes which events are relevant to the app in the current state. selects one of those events executes the selected event to yield a new state in which it repeats this process.

Dynodroid handles two types of events : UI events : Example - Touch , Gesture  System events  : Incoming message ,  request from another app. Satisfying the desirable criteria in the presence of system events is challenging  because.  a. Number of possible events is large  b. Many events have structured data Dynodroid addresses the problem of handling a very large number of possible system events by using the observation

System Architecture Algorithm 1 Overall algorithm of Dynodroid. INPUT: Number n > 0 of events to generate. OUTPUT: List L of n events. L := empty list e := event to install and start app under test s := initial program state for i from 1 to n do append e to L // Execute event e in current state s to yield updated state. s := executor(e, s) // Compute set E of all events relevant in current state s. E := observer(s) // Select an event e 2 E to execute in next iteration. e := selector(E) end for

Data flow Description The executor triggers a given event using Android Debug Bridge (adb) For UI events, the ADB host talks to the ADB daemon (adbd) on the emulator via the monkeyrunner tool. For system events, the ADB host talks to the Activity Manager tool (am) on the emulator. The observer computes the set of events that are relevant to the app under test and consists of two kinds of events  a. Hierarchy Viewer tool for UI events - E1  b.Instrumented SDK for system events - E2 provides the set of all relevant events E = E1 + E2 to the selector

EXECUTOR Allows human and machine to generate input to combine benefits of human and machine  The executor listens to commands from a console and starts in human mode.  RESUME command is received from the console. At this point, the executor switches to machine mode.  Generates events until the given bound n is reached or a PAUSE command is received from the console.   When Pause command is received , the executor switches to human mode again. Finally, the STOP command from the console stops Dynodroid

OBSERVER The observer computes the set of relevant events after an event is executed Note: an event relevant if triggering that event may result in executing code that is part of the app a.UI Events These are events generated by the SDK in response to interaction by users with the device's input mechanisms. Dynodroid supports two input mechanisms: touchscreen and navigation buttons The observer analyzes the app's current UI state in order to compute relevant UI events. The SDK provides two ways by which an app can react to inputs to a UI element: by overriding a method of the corresponding View object's class, or by registering a callback with it

The SDK dispatches each input on the touchscreen to the root node of the view hierarchy The observer obtains the view hierarchy from a service called ViewServer and considers View objects at leaf node Extracts two kinds of data from Objects :   (a) the set of callback methods registered and the set of methods overridden by the app,for listening to inputs to this UI element, and   (b) The location and size of the UI element on the touchscreen.

The observer uses the data in item (a) to compute which UI events are relevant. (b) to compute the parameters of each such event

System Events These are events generated by the SDK in response to non-UI    inputs, such as an incoming phone call, a change in  geolocation, etc. The SDK provides one of two means by which an app can receive each type of System event: broadcast receiver and system service     Observer used the same mechanism for extracting relevant inputs. A system event becomes relevant when an app registers to receive it and, conversely, it becomes irrelevant when an app unregisters it

Broadcast receiver events Android provides two ways for an app to register for system events via a broadcast receiver. Dynamically or statically In Dynamic : receiver's lifetime is from when Context.registerReceiver() is called to either until Context.unregisterReceiver() is called or until the lifetime of the registering app component. In the static case, the receiver is specified in file AndroidManifest.xml, and has the same lifetime as the app

System Service Events System services are a fixed set of processes that provide abstractions of different functionality of an Android device. These services are distinguished based on app provided data and Independent data and are called internally and externally triggered Example : AlarmManager service is internally triggered, as it depends on the alarm duration given by anapp, but the LocationManager service is externally triggered, as it depends on the device's geo-location. Dynodroid only controls externally triggered services

Selector The selector selects an event for the executor to execute from the set of relevant events E computed by the observer. There are 3 different  selection strategies  :  Frequency, UniformRandom, and BiasedRandom . Frequency : The Frequency strategy selects an event from E that has been selected least frequently by it so far . The idea is that infrequently selected events have a higher chance of exercising new app functionality.  The drawback is its deterministic nature leads the app to the same state in repeated runs.

UniformRandom : This strategy circumvents the above problem by selecting an event from E uniformly at random. This is the same Strategy used in Monkey Fuzz tool but there are differences A drawback of the UniformRandom strategy is that it does not take any domain knowledge into account , it does not distinguish between UI events and system events, nor between different contexts in which an event may occur, nor between frequent and infrequent events. Ex : an event that is always relevant (an incoming phone call event )stands to be picked disproportionately more often than an event that is relevant only in certain contexts (only on a particular screen of the app)

BiasedRandom  Like the Frequency strategy, it maintains a history of how often each event has been selected in the past in a context sensitive manner The context for an event e at a particular instant is the set E of all relevant events at that instant This history is recorded in global variable G that maps each pair (e;E) to a score. At any instant, the score for a pair (e;E) in the map is either -1, meaning event e is blacklisted in context E or it is a non-negative integer,

BiasedRandom Algorithm 2 Event selection algorithm BiasedRandom. 1: var G : map from (event, set of events) pairs to int 2: G := empty map 3: INPUT: Set E of relevant events. 4: OUTPUT: An event in E. 5: for each (e in E) do 6: if ((e;E) is not in domain of G) then 7: // Initialize score of event e in context E. 8: G(e;E) := init score(e) 9: end if 10: end for 11: var L : map from events to int 12: L := map from each event in E to 0 13: while true do 14: e := event chosen uniformly at random from E

15: if (L(e) = G(e;E)) then 16: // Select e this time, but decrease its chance of being 17: // selected in context E in future calls to selector. 18: G(e;E) := G(e;E) + 1 19: return e 20: else 21: // Increase chance of selecting e in next iteration in 22: // current call to selector. 23: L(e) := L(e) + 1 24: end if 25: end while 26: procedure init score(e) : int 27: case (e) of 28: Text event: return -1 29: non-Text UI event: return 1 30: system event: return 2 31: end case

EMPIRICAL EVALUATION Dynodroid was evaluated on real world Android apps, and compared it to two state-of-the-art approaches for testing such apps: manual test-ing and automated fuzzing. Two studies we performed: measuring app source code coverage and Finding bugs in apps Measuring Coverage - app coverage metrics by using Emma a popular Java source code coverage tool. Emma generates detailed line coverage metrics to the granularity of branches, and provides coverage reports in different formats that assist in analysis and gathering statistics

Evaluated approaches : Following were eveluated Dynodroid using each of the three selection strategies - 2000 events Monkey fuzz testing tool provided in the Android platform  - 10,000 events Manual testing conducted in a study involving ten users - unlimited events Dynodroid runs 5X slower than Monkey primarily due to performance issues On the plus side Dynodroid achieves peak code coverage much faster than Monkey, requiring far fewer than even the 2,000 events we generated

Dynodroid is an effective bug finding tool and is also robust Dynodroid exposed several bugs on the 1000 most popular free apps from Google play

Limitations Dynodroid needs significantly fewer number of events to converge than monkey but it is 5X times slower than monkey . Dynodroid restricts apps from communicating with other apps

References Aravind MacHiry, Rohan Tahiliani, and Mayur Naik. Dynodroid: An Input Generation System for Android Apps http://developer.android.com/index.html