Android-powered devices nowadays cover a wide range,including smartphones,tablets,laptop computers,desktop computers and embedded devices such as car entertainment systems and smart TVs.Usually,more powerful handheld or stationary devices run around one hundred system and user applications while resource-restricted devices can also host over tens of applications.App developers need to test against such a wide range of device choices and the difference in OS version,hardware components often cause unanticipated bugs when the app is delivered to end users.In addition,Android applications need to handle system-wide and application-wide random events,such as incoming calls,alarm clock,screen rotation and user inputs.These random interrupts can interfere normal program logic and cause bugs that can hardly be detected in a lab environment.Also,collecting complete diagnostic information for such bugs is also a vital part for fixing these bugs.In this thesis,we first introduce bytecode instrumentation and gray-box app testing techniques and propose to apply instrumentation to create reproducible gray-box testing technique to detecting app bugs.We design the JazzDroid toolset as an innovative quality enhancement system for apps.This paper elaborates on fully automated bytecode instrumentation and repackaging,diagnostic information collection,environmental interference fuzzing,reproducible bug tracing and remote debugging modules in JazzDroid,implements a reproducible mobile application interference test method.This paper proposes the interference efficiency index EI value and designs its corresponding calculation formula,and achieves a quantitative method to optimize the efficiency of interference test.The proposed tools and methodology help app developers to locate bugs and pinpoint root causes.We design experiments on real-world apps to compare JazzDroid with conventional testing methods,explaining the useful of JazzDroid in detecting unknown bugs.JazzDroid is applied to hundreds of apps on the shelf.When applied on these apps with great complexity,JazzDroid detects 6x more defects than standard testing techniques,totaling 99 undiscovered bugs,and using JazzDroid reproduce method to reproduce all bugs.We manually evaluate those bugs and trace their root causes.We also conclude bug patterns from analyzing these undiscovered bugs.Finally,we proved that JazzDroid is a practical system for app production cycle and continuous integration flow. |