Award Abstract # 1421243
SHF: Small: Random Testing for Language Design

NSF Org: CCF
Division of Computing and Communication Foundations
Recipient: TRUSTEES OF THE UNIVERSITY OF PENNSYLVANIA, THE
Initial Amendment Date: June 13, 2014
Latest Amendment Date: June 13, 2014
Award Number: 1421243
Award Instrument: Standard Grant
Program Manager: Anindya Banerjee
abanerje@nsf.gov
 (703)292-7885
CCF
 Division of Computing and Communication Foundations
CSE
 Directorate for Computer and Information Science and Engineering
Start Date: September 1, 2014
End Date: August 31, 2019 (Estimated)
Total Intended Award Amount: $500,000.00
Total Awarded Amount to Date: $500,000.00
Funds Obligated to Date: FY 2014 = $500,000.00
History of Investigator:
  • Benjamin Pierce (Principal Investigator)
    bcpierce@cis.upenn.edu
Recipient Sponsored Research Office: University of Pennsylvania
3451 WALNUT ST STE 440A
PHILADELPHIA
PA  US  19104-6205
(215)898-7293
Sponsor Congressional District: 03
Primary Place of Performance: University of Pennsylvania
PA  US  19104-6205
Primary Place of Performance
Congressional District:
03
Unique Entity Identifier (UEI): GM1XX56LEP58
Parent UEI: GM1XX56LEP58
NSF Program(s): Software & Hardware Foundation
Primary Program Source: 01001415DB NSF RESEARCH & RELATED ACTIVIT
Program Reference Code(s): 7923, 7943
Program Element Code(s): 779800
Award Agency Code: 4900
Fund Agency Code: 4900
Assistance Listing Number(s): 47.070

ABSTRACT

Title: SHF:Small:Random Testing for Language Design

PROPERTY-BASED RANDOM TESTING (PBRT) is a form of black-box testing in which executable partial specifications of a software artifact are used to check its behavior with respect to large numbers of randomly generated test cases. PBRT offers a range of benefits that complement the traditional strengths of full, formal verification; in particular, it (1) allows much more rapid iteration on designs, (2) encourages early focus on stating correct specifications, and (3) supports later proof efforts by allowing invariants to be debugged quickly. Popularized by the QuickCheck tool in Haskell, PBRT is now widely used in both research and industry. However, one area where current PBRT methodology has been less successful is where the data values used in testing come with have complex internal structure or intricate invariants. In particular, this is the case in testing of language designs and related artifacts such as compilers, where the test data are programs. Despite some promising preliminary efforts, random testing has proved difficult to apply to full-scale language designs. Many of the interesting properties of programming languages are "conditional," leading to a large number of discarded test cases when random testing is applied naively. This places a premium on the ability to construct good custom generation strategies, but generation strategies for ``interesting programs'' are neither well understood nor well supported by existing tools: better techniques are needed for writing and debugging test-data generators.

This project aims to significantly advance the state of the art in property-based random testing, with specific applications to testing fundamental properties of language definitions and related artifacts---properties such as type safety, security (e.g., ``secret inputs cannot influence public outputs''), and compiler correctness. The intellectual merits are: (1) developing new methodology for writing and debugging random generators for complex data, in particular a framework based on generating ``mutants'' of an artifact under test; (2) designing a domain-specific language for writing generators for random test data with complex invariants (3) distributing polished implementations, both as a compatible extension to the standard QuickCheck library and as a native random-testing tool for the Coq proof assistant; and (4) evaluating the usefulness of these tools by applying them to several significant case studies. The broader impacts of the project are twofold. First, better understood, more secure language designs will lead to better and more secure software, and hence to fewer bugs and vulnerabilities in everyday applications and in critical infrastructure. In particular, the project's main case studies aim to show how random testing can improve the design process for new languages with built-in support for guaranteeing fundamental security properties such as confidentiality, integrity, authorization, and access control. Second, beyond language design, random testing has proven extremely effective for improving software quality. The envisaged tools will significantly increase the power of random testing by offering new tools for writing and testing random data generators that can be used with QuickCheck, an existing industry-standard platform, and by offering native support for random testing within Coq, a popular specification and verification tool. Project results will be incorporated into the "Advanced Programming" course at Penn (which already emphasizes random testing) and will form the basis for a module on random testing of language properties at the Oregon Programming Languages Summer School.

PUBLICATIONS PRODUCED AS A RESULT OF THIS RESEARCH

Note:  When clicking on a Digital Object Identifier (DOI) number, you will be taken to an external site maintained by the publisher. Some full text articles may not yet be available without a charge during the embargo (administrative interval).

Some links on this page may take you to non-federal websites. Their policies may differ from this site.

Catalin Hritcu and Leonidas Lampropoulos and Antal Spector-Zabusky and Arthur Azevedo de Amorim and Maxime D\'{e}n\`{e}s and John Hughes and Benjam "Testing Noninterference, Quickly" Journal of Functional Programming , v.26 , 2016
Catalin Hritcu and Leonidas Lampropoulos and Antal Spector-Zabusky and Arthur Azevedo de Amorim and Maxime Denes and John Hughes and Benjamin C. Pierce and "Testing noninterference, quickly" J. Funct. Program. , v.26 , 2016 , p.e4 10.1017/S0956796816000058
Foner, Kenneth and Zhang, Hengchu and Lampropoulos, Leonidas "Keep Your Laziness in Check" Proc. ACM Program. Lang. , v.2 , 2018 , p.102:1--10 10.1145/3236797
Foner, Kenneth and Zhang, Hengchu and Lampropoulos, Leonidas "Keep Your Laziness in Check" Proc. ACM Program. Lang. (ICFP) , 2018
John Hughes, Benjamin C. Pierce, Thomas Arts, and Ulf Norell "Mysteries of Dropbox: Property-Based Testing of a Distributed Synchronization Service" International Conference on Software Testing , 2016
Leonidas Lampropoulos and Zoe Paraskevopoulou and Benjamin C. Pierce "Generating good generators for inductive relations" PACMPL , v.2 , 2018 , p.45:1--45: 10.1145/3158133
Leonidas Lampropoulos and Zoe Paraskevopoulou and Benjamin C. Pierce "Generating good generators for inductive relations" {PACMPL} , v.2 , 2018 , p.45:1--45: 10.1145/3158133
Leonidas Lampropoulos, Antal Spector-Zabusky, and Kenneth Foner "Urning Your Distributions" Haskell Symposium , 2017
Leonidas Lampropoulos, Diane Gallois-Wong, Catalin Hritcu, John Hughes, Benjamin C. Pierce, and Li-yao Xia "Beginner?s Luck: A Language For Property-Based Generators" Principles of Programming Languages , 2017
Zoe Paraskevopoulou, Catalin Hritcu, Maxime Denes, Leonidas Lampropoulos, and Benjamin C. Pierce "Foundational Property-Based Testing" Interactive Theorem Proving: 6th International Conference , 2015

PROJECT OUTCOMES REPORT

Disclaimer

This Project Outcomes Report for the General Public is displayed verbatim as submitted by the Principal Investigator (PI) for this award. Any opinions, findings, and conclusions or recommendations expressed in this Report are those of the PI and do not necessarily reflect the views of the National Science Foundation; NSF has not approved or endorsed its content.

PROPERTY-BASED RANDOM TESTING (PBRT) is a form of black-box testing in which executable partial specifications of a software artifact are used to check its behavior with respect to large numbers of randomly generated test cases. PBRT offers a range of benefits that complement the traditional strengths of full, formal verification; in particular, it (1) allows much more rapid iteration on designs, (2) encourages early focus on stating correct specifications, and (3) supports later proof efforts by allowing invariants to be debugged quickly. Popularized by the QuickCheck tool in Haskell, PBRT is now widely used in both research and industry.


However, one area where current PBRT methodology has been less successful is where the data values used in testing come with have complex internal structure or intricate invariants. In particular, this is the case in testing of language designs and related artifacts such as compilers, where the test data are programs.  Despite some promising preliminary efforts, random testing has proved difficult to apply to full-scale language designs. Many of the interesting properties of programming languages are "conditional," leading to a large number of discarded test cases when random testing is applied naively. This places a premium on the ability toconstruct good custom generation strategies, but generation strategies for``interesting programs'' are neither well understood nor well supported by existing tools: better techniques are needed for writing and debugging test-data generators.


This project focused on property-based random testing of language designs, with specific applications to testing fundamental properties of language definitions and related artifacts---properties such as type safety, security( e.g., ``secret inputs cannot influence public outputs''), and compiler correctness.  Specific accomplishments included (1) developing new methodology for writing and debugging random generators for complex data, inparticular a framework based on generating ``mutants'' of an artifact under test; (2) designing a domain-specific language for writing generators for random test data with complex invariants (3) distributing polished implementations, both as a compatible extension to the standard QuickCheck library and as a native random-testing tool for the Coq proof assistant; and( 4) evaluating the usefulness of these tools by applying them to severalsignificant case studies.


Our first product was a new domain-specificlanguage, called Luck, for writing random generators. We carried out two major case studies in Luck, replicating previous studies (using different technologies) on using PBRT to find bugs in information-flow analyses and functional-language compilers, showing that we can achieve comparable bug-finding effectiveness with much smaller effort, though (with the current prototype implementation) somewhat more slowly.


The major software product of the grant was a random testing tool called QuickChick for the Coq proof assistant.  This tool already existed in prototype form at the start of the grant, but during the grant period it was enormously improved, re-engineered, and applied to several significant case studies.  In particular, we built a "mutation testing" framework for QuickChick and used it in testing several pieces of software being developed outside of this project. We used it to aid development of the next design iteration of the Vellvm verified compiler framework, and we used it to help design and specify the DeepSpec web server.  QuickChick is now publicly released and included in Coq's continuous integration suite.


QuickChick is described in a new book written during the grant -- volume 4 in the Software Foundations series. We taught about 250 people to use it as part of the NSF-supported DeepSpec summer schools on verified software. 


Apart from work on Luck and QuickChick, we used the Erlang version ofQuickCheck to build a testable specification for distributed file synchronization services, which was able to find several bugs in Dropbox that were not known to the Dropbox engineers.  Finally, in ongoing work that began during the grant, we used the Haskell version of QuickCheck to help prototype, debug, and analyze several of the "micro policies" being developed at Draper Labs and Dover Microsystems for enforcing dynamic security policies using CoreGuard, a new tagged security coprocessor architecture.

 

 


Last Modified: 01/27/2020
Modified by: Benjamin C Pierce

Please report errors in award information by writing to: awardsearch@nsf.gov.

Print this page

Back to Top of page