Lifestate: Event-Driven Protocols and Callback Control Flow

06/12/2019
by   Shawn Meier, et al.
0

Developing interactive applications (apps) against event-driven software frameworks such as Android is notoriously difficult. To create apps that behave as expected, developers must follow complex and often implicit asynchronous programming protocols. Such protocols intertwine the proper registering of callbacks to receive control from the framework with appropriate application-programming interface (API) calls that in turn affect the set of possible future callbacks. An app violates the protocol when, for example, it calls a particular API method in a state of the framework where such a call is invalid. What makes automated reasoning hard in this domain is largely what makes programming apps against such frameworks hard: the specification of the protocol is unclear, and the control flow is complex, asynchronous, and higher-order. In this paper, we tackle the problem of specifying and modeling event-driven application-programming protocols. In particular, we formalize a core meta-model that captures the dialogue between event-driven frameworks and application callbacks. Based on this meta-model, we define a language called lifestate that permits precise and formal descriptions of application-programming protocols and the callback control flow imposed by the event-driven framework. Lifestate unifies modeling what app callbacks can expect of the framework with specifying rules the app must respect when calling into the framework. In this way, we effectively combine lifecycle constraints and typestate rules. To evaluate the effectiveness of lifestate modeling, we provide a dynamic verification algorithm that takes as input a trace of execution of an app and a lifestate protocol specification to either produce a trace witnessing a protocol violation or a proof that no such trace is realizable.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/12/2019

Lifestate: Event-Driven Protocols and Callback Control Flow (Extended Version)

Developing interactive applications (apps) against event-driven software...
research
09/08/2023

Historia: Refuting Callback Reachability with Message-History Logics (Extended Version)

This paper determines if a callback can be called by an event-driven fra...
research
02/17/2023

Columbus: Android App Testing Through Systematic Callback Exploration

With the continuous rise in the popularity of Android mobile devices, au...
research
02/23/2018

Stateful Behavioral Types for ABS

It is notoriously hard to correctly implement a multiparty protocol whic...
research
08/09/2018

Efficiently Manifesting Asynchronous Programming Errors in Android Apps

Android, the #1 mobile app framework, enforces the single-GUI-thread mod...
research
08/09/2018

Safe Stream-Based Programming with Refinement Types

In stream-based programming, data sources are abstracted as a stream of ...
research
05/21/2021

Functionals in the Clouds: An abstract architecture of serverless Cloud-Native Apps

Cloud Native Application CNApp (as a distributed system) is a collection...

Please sign up or login with your details

Forgot password? Click here to reset