Loading…

A type-directed algorithm to generate random well-typed Java 8 programs

Property-based testing of compilers or programming language semantics is difficult to accomplish because it is hard to design a random generator for valid programs. Most compiler test tools do not have a well-specified way for generating type-correct programs, which is a requirement for such testing...

Full description

Saved in:
Bibliographic Details
Published in:Science of computer programming 2020-09, Vol.196, p.102494, Article 102494
Main Authors: Feitosa, Samuel, Ribeiro, Rodrigo, Du Bois, Andre
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Property-based testing of compilers or programming language semantics is difficult to accomplish because it is hard to design a random generator for valid programs. Most compiler test tools do not have a well-specified way for generating type-correct programs, which is a requirement for such testing activities. In this project, we formalize a type-directed procedure to generate random well-typed Java 8 programs in the context of Featherweight Java, extending it with interfaces, λ-expressions and default methods. We implement the approach using the Haskell programming language and verify it against relevant properties using QuickCheck, a library for property-based testing. •Definition of a type-directed algorithm for constructing random Java 8 programs.•Proving that the specification is sound with respect to Featherweight Java typing rules.•Using QuickCheck as a lightweight approach to verify safety properties.•Compiling generated code with Oracle Java compiler.•Checking code coverage using Haskell HPC tool.
ISSN:0167-6423
1872-7964
DOI:10.1016/j.scico.2020.102494