Testers use apps by hand all day.

Then the data is thrown away.

getevent · /dev/input/event0

Raw recordings are welded to one screen.

Events logged on a Nexus 4 won’t replay on a Galaxy S4.

Models only know what they’ve seen.

Feasible events missing from the traces never make it into a scenario.

Introducing
MonkeyLab
Record → Mine → Generate → Validate
01Record
02Mine
03Generate
04Validate

Just use the app.

Android’s getevent logs every touch while testers work as usual. No extra effort.

a · record · getevent log
[13331.457322] event0: 0003 0039 000007d1
[13331.457383] event0: 0003 0035 000002bf
[13331.457383] event0: 0003 0036 0000007e
[13340.831651] event0: 0003 0035 0000035a

Mine the GUI events.

Each touch becomes a token: screen, component, action. The APK adds feasible events nobody tried.

TaskListActivityid/contentCLICKFROM LOGS
EditTaskActivityid/text1CLICKFROM LOGS
EditTaskActivityid/button1CLICKFROM LOGS
EditTaskActivityid/delete_taskCLICKFROM THE APK

Learn the language of use.

n-gram models write natural scenarios, or flip the odds to chase corner cases.

next event, given … EditTask · text1 · CLICK
up · naturaldown · unnatural
0.200.11
event a
0.500.11
event b
0.100.55
event c
0.100.22
event d

Keep only what replays.

On a real device, the Chimp drops infeasible events and emits actionable scenarios.

d · validate · actionable scenario
adb shell input tap 29 308
adb shell input text 'h5'
ViewTask · id/edit · LONG_CLICK infeasible
adb shell input keyevent 4
adb shell input tap 684 167
Case study · Nexus 7 tablets
0
open-source Android apps
0
Ph.D. students recording usage
0
events per generated scenario
0
generated GUI events the human testers never exercised
5 of 5 appsinteractive mode beats a DFS GUI ripper’s coverage
4 of 5 appsinteractive mode beats Android UI Monkey’s coverage
2,561 vs 1,035methods covered better by MonkeyLab vs. by DFS

Mining Android App Usages for Generating Actionable GUI-based Execution Scenarios

Mario Linares-Vásquez · Martin White · Carlos Bernal-Cárdenas · Kevin Moran · Denys Poshyvanyk
MSR 2015 · IEEE Working Conference on Mining Software Repositories