Deriving Compositional Random Generators

Gespeichert in:
Bibliographische Detailangaben
Titel: Deriving Compositional Random Generators
Autoren: Mista, Claudio Agustin, 1991, Russo, Alejandro, 1978
Quelle: WebSec: Säkerhet i webb-drivna system Octopi: Säker Programering för Sakernas Internet 31st Symposium on Implementation and Application of Functional Languages, Singapore, Singapore ACM International Conference Proceeding Series. 25 September 2019
Schlagwörter: random testing, type-level programming, Haskell
Beschreibung: Generating good random values described by algebraic data types is often quite intricate. State-of-the-art tools for synthesizing random generators serve the valuable purpose of helping with this task, while providing different levels of invariants imposed over the generated values. However, they are often not built for composability nor extensibility, a useful feature when the shape of our random data needs to be adapted while testing different properties or sub-systems. In this work, we develop an extensible framework for deriving compositional generators, which can be easily combined in different ways in order to fit developers’ demands using a simple type level description language. Our framework relies on familiar ideas from the à la Carte technique for writing composable interpreters in Haskell. In particular, we adapt this technique with the machinery required in the scope of random generation, showing how concepts like generation frequency or terminal constructions can also be expressed in the same type-level fashion. We provide an implementation of our ideas, and evaluate its performance using real world examples.
Zugangs-URL: https://research.chalmers.se/publication/515533
https://research.chalmers.se/publication/526735
https://research.chalmers.se/publication/528371
https://research.chalmers.se/publication/525220
Datenbank: SwePub
Beschreibung
Abstract:Generating good random values described by algebraic data types is often quite intricate. State-of-the-art tools for synthesizing random generators serve the valuable purpose of helping with this task, while providing different levels of invariants imposed over the generated values. However, they are often not built for composability nor extensibility, a useful feature when the shape of our random data needs to be adapted while testing different properties or sub-systems. In this work, we develop an extensible framework for deriving compositional generators, which can be easily combined in different ways in order to fit developers’ demands using a simple type level description language. Our framework relies on familiar ideas from the à la Carte technique for writing composable interpreters in Haskell. In particular, we adapt this technique with the machinery required in the scope of random generation, showing how concepts like generation frequency or terminal constructions can also be expressed in the same type-level fashion. We provide an implementation of our ideas, and evaluate its performance using real world examples.
DOI:10.1145/3412932.3412943