A Framework for Automated Test Mocking of Mobile Apps

Mattia Fazzini, Alessandra Gorla, Alessandro Orso

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Mobile apps interact with their environment extensively, and these interactions can complicate testing activities because test cases may need a complete environment to be executed. Interactions with the environment can also introduce test flakiness, for instance when the environment behaves in non-deterministic ways. For these reasons, it is common to create test mocks that can eliminate the need for (part of) the environment to be present during testing. Manual mock creation, however, can be extremely time consuming and error-prone. Moreover, the generated mocks can typically only be used in the context of the specific tests for which they were created. To address these issues, we propose MOKA, a general framework for collecting and generating reusable test mocks in an automated way. MOKA leverages the ability to observe a large number of interactions between an application and its environment and uses an iterative approach to generate two possible, alternative types of mocks with different reusability characteristics: advanced mocks generated through program synthesis (ideally) and basic record-replay-based mocks (as a fallback solution). In this paper, we describe the new ideas behind MOKA, its main characteristics, a preliminary empirical study, and a set of possible applications that could benefit from our framework.

Original languageEnglish (US)
Title of host publicationProceedings - 2020 35th IEEE/ACM International Conference on Automated Software Engineering, ASE 2020
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages1204-1208
Number of pages5
ISBN (Electronic)9781450367684
DOIs
StatePublished - Sep 2020
Event35th IEEE/ACM International Conference on Automated Software Engineering, ASE 2020 - Virtual, Melbourne, Australia
Duration: Sep 22 2020Sep 25 2020

Publication series

NameProceedings - 2020 35th IEEE/ACM International Conference on Automated Software Engineering, ASE 2020

Conference

Conference35th IEEE/ACM International Conference on Automated Software Engineering, ASE 2020
Country/TerritoryAustralia
CityVirtual, Melbourne
Period9/22/209/25/20

Bibliographical note

Funding Information:
This work was partially supported by a gift from Facebook, NSF grant CCF-1563991, Spanish Government’s SCUM grant RTI2018-102043-B-I00, and the Madrid Regional project BLOQUES.

Publisher Copyright:
© 2020 ACM.

Keywords

  • Test mocking
  • mobile apps
  • software environment

Fingerprint

Dive into the research topics of 'A Framework for Automated Test Mocking of Mobile Apps'. Together they form a unique fingerprint.

Cite this