MZoltar's DeMobile 2013 Paper

Downloads

CharCountExample.zip - Android project of the example application used in the paper

FaultFramework.jar - Framework used to inject faults in the subject applications

Fault.java - Sourcecode of the injection framework (FaultFramework.jar)

MZoltarTestRunner.java - Customised InstrumentationTestRunner used

Instructions

To inject a fault, using our framework, the syntas is the following:

this.let += Fault.fail(<id>, <expectedResult>, <incorrectResult>);

Let's suppose one needs to inject a fault where the counter should be incremented by one, but is instead incremented by two:

this.let += 1; // correct code (no fault injected)
this.let += 2; // incorrect code (with fault injected)
this.let += Fault.fail(1,1,2); //framework code

To activate the fault(s), the MZoltarTestTunner must be in the source of the test application and declared in its AndroidManifest.xml:

<instrumentation
android:name="mzoltar.testrunner.MZoltarTestRunner"
android:targetPackage="example.charactercount" />

Last, when running the tests the argument injectedFaults should be passed, containing the ids of the faults to activate, in the form of comma-separated values

adb shell instrument -w -e injectedFaults 1,2,3 example.charactercount.test\mzoltar.testrunner.MZoltarTestRunner