Automated Construction of Energy Test Oracles for Android

Energy efficiency is an increasingly important quality attribute for software, particularly for mobile apps. Just like any other software attribute, energy behavior of mobile apps should be properly tested prior to their release. However, mobile apps are riddled with energy defects, as currently there is a lack of proper energy testing tools. Indeed, energy testing is a fledgling area of research and recent advances have mainly focused on test input generation. This paper presents ACETON, the first approach aimed at solving the oracle problem for testing the energy behavior of mobile apps. ACETON employs Deep Learning to automatically construct an oracle that not only determines whether a test execution reveals an energy defect, but also the type of energy defect. By carefully selecting features that can be monitored on any app and mobile device, we are assured the oracle constructed using ACETON is highly reusable. Our experiments show that the oracle produced by ACETON is both highly accurate, achieving an overall precision and recall of 99%, and efficient, detecting the existence of energy defects in only 37 milliseconds on average.

How does ACETON work?

ACETON , consists of three major components: (1) Sequence Collector, (2) DL Engine, and (3) Attention Analysis. To construct the oracle, ACETON takes a labeled database of apps with energy defects accompanied with test suites as input. The Sequence Collector component executes each test case and captures SVs at a fixed rate during test execution to build the training dataset for ACETON. The training dataset is then fed to the DL Engine, which constructs the classifier that serves as our test oracle. To use the oracle, ACETON takes a test case as input and collects a sequence of SVs during its execution. The oracle takes the sequence as input and produces a fine-grained label for it, indicating whether the test has failed, and if so, the type of energy defect that was revealed by the test. To help us understand the nature of patterns learned by the model, the oracle also produces an Attention Weights vector. Attention Analysis component then takes the Attention Weights vector to determine the list of features that involved in the oracle's decision. These features essentially constitute the defect signature learned by the oracle.

[cobweb picture]

Artifacts

The artifacts are publicly available here.

Publications

More details about can be found in our publication below:


[seal's logo]
[uci's logo]