Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1982595.1982615acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Testing an optimising compiler by generating random lambda terms

Published: 23 May 2011 Publication History

Abstract

This paper considers random testing of a compiler, using randomly generated programs as inputs, and comparing their behaviour with and without optimisation. Since the generated programs must compile, then we need to take into account syntax, scope rules, and type checking during our random generation. Doing so, while attaining a good distribution of test data, proves surprisingly subtle; the main contribution of this paper is a workable solution to this problem. We used it to generate typed functions on lists, which we compiled using the Glasgow Haskell compiler, a mature production quality Haskell compiler. After around 20,000 tests we triggered an optimiser failure, and automatically simplified it to a program with just a few constructs.

References

[1]
L. Augustsson. Announcing Djinn, version 2004-12-11, a coding wizard. http://permalink.gmane.org/gmane.comp.lang.haskell.general/12747, 2005.
[2]
O. Bodini, D. Gardy, and B. Gittenberger. Lambda terms of bounded unary height. In Proc. of the 8th Workshop on Analytic Algorithmics and Combinatorics, 2011.
[3]
K. Claessen and J. Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. In Proceedings of the fifth ACM SIGPLAN International Conference on Functional Programming. ACM, 2000.
[4]
L. Damas and R. Milner. Principal type-schemes for functional programs. In Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, 1982.
[5]
B. Daniel, D. Dig, K. Garcia, and D. Marinov. Automated testing of refactoring engines. In Proc. of the 6th meeting of the European Software Engineering Conference and the ACM SIGSOFT Symp. on the Foundations of Software Engineering. ACM, 2007.
[6]
N. A. Danielsson and P. Jansson. Chasing bottoms: A case study in program verification in the presence of partial and infinite values. In MPC, 2004.
[7]
D. Drienyovszky, D. Horpácsi, and S. Thompson. Quickchecking refactoring tools. In Proceedings of the 9th ACM SIGPLAN workshop on Erlang. ACM, 2010.
[8]
R. Dyckhoff. Contraction-free sequent calculi for intuitionistic logic. Journal of Symbolic Logic, 57(3), 1992.
[9]
C. Klein, M. Flatt, and R. B. Findler. Random testing for higher-order, stateful programs. In Proc. of the ACM International Conference on Object Oriented Programming Systems Languages and Applications. ACM, 2010.
[10]
C. Lindig. Random testing of C calling conventions. In Proceedings of the 6th International Symposium on Automated Analysis-Driven Debugging. ACM, 2005.
[11]
M. Moczurad, J. Tyszkiewicz, and M. Zaionc. Statistical properties of simple types. Mathematical. Structures in Computer Science, 10, October 2000.
[12]
S. L. Peyton Jones. Compiling Haskell by program transformation: a report from the trenches. In Proc. of European Symp. on Programming. Springer-Verlag, 1996.
[13]
B. C. Pierce. Types and programming languages. MIT Press, Cambridge, MA, USA, 2002.
[14]
A. Rodriguez Yakushev and J. Jeuring. Enumerating well-typed terms generically. In Approaches and Applications of Inductive Programming, volume 5812 of LNCS. Springer Berlin / Heidelberg, 2010.
[15]
The GHC Team. The Glasgow Haskell Compiler. Software release. http://haskell.org/ghc/.
[16]
D. Vytiniotis and A. J. Kennedy. Functional pearl: every bit counts. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming. ACM, 2010.
[17]
J. Wang. Generating random lambda calculus terms. Technical report, Boston University, 2005.
[18]
M. Zaionc. Mechanical procedure for proof construction via closed terms in typed λ calculus. J. Autom. Reason., 4:173--190, June 1988.
[19]
S. Zakhour, S. Hommel, J. Royal, I. Rabinovitch, T. Risser, and M. Hoeber. The Java Tutorial: A Short Course on the Basics, 4th Edition. Prentice Hall PTR, 2006.

Cited By

View all
  • (2024)Cedar: A New Language for Expressive, Fast, Safe, and Analyzable AuthorizationProceedings of the ACM on Programming Languages10.1145/36498358:OOPSLA1(670-697)Online publication date: 29-Apr-2024
  • (2024)Generating Well-Typed Terms That Are Not “Useless”Proceedings of the ACM on Programming Languages10.1145/36329198:POPL(2318-2339)Online publication date: 5-Jan-2024
  • (2024)Property-Based Testing in PracticeProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639581(1-13)Online publication date: 20-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
AST '11: Proceedings of the 6th International Workshop on Automation of Software Test
May 2011
124 pages
ISBN:9781450305921
DOI:10.1145/1982595
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 May 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. random testing
  2. software testing

Qualifiers

  • Research-article

Conference

ICSE11
Sponsor:
ICSE11: International Conference on Software Engineering
May 23 - 24, 2011
HI, Waikiki, Honolulu, USA

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)49
  • Downloads (Last 6 weeks)1
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Cedar: A New Language for Expressive, Fast, Safe, and Analyzable AuthorizationProceedings of the ACM on Programming Languages10.1145/36498358:OOPSLA1(670-697)Online publication date: 29-Apr-2024
  • (2024)Generating Well-Typed Terms That Are Not “Useless”Proceedings of the ACM on Programming Languages10.1145/36329198:POPL(2318-2339)Online publication date: 5-Jan-2024
  • (2024)Property-Based Testing in PracticeProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639581(1-13)Online publication date: 20-May-2024
  • (2023)A formal model of Checked C1Journal of Computer Security10.3233/JCS-23004031:5(581-614)Online publication date: 13-Oct-2023
  • (2023)QuickerCheck: Implementing and Evaluating a Parallel Run-Time for QuickCheckProceedings of the 35th Symposium on Implementation and Application of Functional Languages10.1145/3652561.3652570(1-12)Online publication date: 29-Aug-2023
  • (2023)Usando Esquema GraphQL para Geração de Consultas de Forma AleatóriaProceedings of the XXVII Brazilian Symposium on Programming Languages10.1145/3624309.3624321(17-24)Online publication date: 25-Sep-2023
  • (2023)Don’t Go Down the Rabbit Hole: Reprioritizing Enumeration for Property-Based TestingProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609730(59-71)Online publication date: 30-Aug-2023
  • (2023)Etna: An Evaluation Platform for Property-Based Testing (Experience Report)Proceedings of the ACM on Programming Languages10.1145/36078607:ICFP(878-894)Online publication date: 31-Aug-2023
  • (2023)Reflecting on Random GenerationProceedings of the ACM on Programming Languages10.1145/36078427:ICFP(322-355)Online publication date: 31-Aug-2023
  • (2023)Merging Inductive RelationsProceedings of the ACM on Programming Languages10.1145/35912927:PLDI(1759-1778)Online publication date: 6-Jun-2023
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media