A Formalization for Specifying and Implementing Correct Pull-Stream Modules

01/18/2018
by   Erick Lavoie, et al.
0

Pull-stream is a JavaScript demand-driven functional design pattern based on callback functions that enables the creation and easy composition of independent modules that are used to create streaming applications. It is used in popular open source projects and the community around it has created over a hundred compatible modules. While the description of the pull-stream design pattern may seem simple, it does exhibit complicated termination cases. Despite the popularity and large uptake of the pull-stream design pattern, there was no existing formal specification that could help programmers reason about the correctness of their implementations. Thus, the main contribution of this paper is to provide a formalization for specifying and implementing correct pull-stream modules based on the following: (1) we show the pull-stream design pattern is a form of declarative concurrent programming; (2) we present an event-based protocol language that supports our formalization, independently of JavaScript; (3) we provide the first precise and explicit definition of the expected sequences of events that happen at the interface of two modules, which we call the pull-stream protocol; (4) we specify reference modules that exhibit the full range of behaviors of the pull-stream protocol; (5) we validate our definitions against the community expectations by testing the existing core pull-stream modules against them and identify unspecified behaviors in existing modules. Our approach helps to better understand the pull-stream protocol, to ensure interoperability of community modules, and to concisely and precisely specify new pull-stream abstractions in papers and documentation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/31/2022

A Finite-Automaton Based Stream Cipher As a Quasigroup Based Cipher

In this paper we show that a recently published finite automaton stream ...
research
06/04/2019

Identification and Assessment of Software Design Pattern Violations

The validation of design pattern implementations to identify pattern vio...
research
03/22/2018

Pando: a Volunteer Computing Platform for the Web

Volunteer computing is currently successfully used to make hundreds of t...
research
07/18/2023

Stream Types

We propose a rich foundational theory of typed data streams and stream t...
research
07/30/2020

Description of the UPPAAL Models for SRP and CSRP and Verification of their Termination and Consistency Properties

The IEEE Audio Video Bridging (AVB) Task Group (TG) was created to provi...
research
10/24/2017

Macrogeneration and Automata Libraries For COSMA design environment

In ICS, WUT a COSMA design environment is being developed. COSMA is base...
research
02/06/2020

MAC Protocol Design Optimization Using Deep Learning

Deep learning (DL)-based solutions have recently been developed for comm...

Please sign up or login with your details

Forgot password? Click here to reset