Describing Console I/O Behavior for Testing Student Submissions in Haskell

08/21/2020
by   Oliver Westphal, et al.
0

We present a small, formal language for specifying the behavior of simple console I/O programs. The design is driven by the concrete application case of testing interactive Haskell programs written by students. Specifications are structurally similar to lexical analysis regular expressions, but are augmented with features like global variables that track state and history of program runs, enabling expression of an interesting range of dynamic behavior. We give a semantics for our specification language based on acceptance of execution traces. From this semantics we derive a definition of the set of all traces valid for a given specification. Sampling that set enables us to mechanically check program behavior against specifications in a probabilistic fashion. Beyond testing, other possible uses of the specification language in an education context include related activities like providing more helpful feedback, generating sample solutions, and even generating random exercise tasks.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/10/2022

A Specification Logic for Programs in the Probabilistic Guarded Command Language (Extended Version)

The semantics of probabilistic languages has been extensively studied, b...
research
01/08/2019

StaBL - State Based Language for Specification of Web Applications

Context and motivation: Usage of Formal Specification languages is scarc...
research
10/17/2022

Contextuality in distributed systems

We present a lattice of distributed program specifications, whose orderi...
research
06/09/2019

Whither Programs as Specifications

Unifying theories distil common features of programming languages and de...
research
10/03/2022

Testing by Dualization

Software engineering requires rigorous testing to guarantee the product'...
research
06/05/2022

Geometric Theory for Program Testing

Formal methods for verification of programs are extended to testing of p...
research
05/13/2022

A Hoare Logic with Regular Behavioral Specifications

We present a Hoare logic that extends program specifications with regula...

Please sign up or login with your details

Forgot password? Click here to reset