Affiliation:
1. University of Pennsylvania, USA
Abstract
Occasionally, developers need to ensure that the compiler treats their code in a specific way that is only visible by
inspecting
intermediate or final compilation artifacts. This is particularly common with carefully crafted compositional libraries, where certain usage patterns are expected to trigger an intricate sequence of compiler optimizations – stream fusion is a well-known example.
The developer of such a library has to manually inspect build artifacts and check for the expected properties. Because this is too tedious to do often, it will likely go unnoticed if the property is broken by a change to the library code, its dependencies or the compiler. The lack of automation has led to released versions of such libraries breaking their documented promises.
This indicates that there is an unrecognized need for a new testing paradigm,
inspection testing
, where the programmer declaratively describes non-functional properties of an compilation artifact and the compiler checks these properties. We define inspection testing abstractly, implement it in the context of the Haskell Compiler GHC and show that it increases the quality of such libraries.
Funder
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference25 articles.
1. Lennart Augustsson. 2008. djinn: Generate Haskell code from a type. http://hackage.haskell.org/package/djinn. (2008). Lennart Augustsson. 2008. djinn: Generate Haskell code from a type. http://hackage.haskell.org/package/djinn. (2008).
2. Joachim Breitner. 2014. list-fusion-probe: testing list fusion for success. http://hackage.haskell.org/package/list-fusion-probe. (2014). Joachim Breitner. 2014. list-fusion-probe: testing list fusion for success. http://hackage.haskell.org/package/list-fusion-probe. (2014).
3. Joachim Breitner. 2018. ghc-justdoit: A magic typeclass that just does it. http://hackage.haskell.org/package/ghc-justdoit. (2018). Joachim Breitner. 2018. ghc-justdoit: A magic typeclass that just does it. http://hackage.haskell.org/package/ghc-justdoit. (2018).
4. Manuel M. T. Chakravarty Gabriele Keller Simon L. Peyton Jones and Simon Marlow. 2005. Associated types with class. In POPL. ACM. Manuel M. T. Chakravarty Gabriele Keller Simon L. Peyton Jones and Simon Marlow. 2005. Associated types with class. In POPL . ACM.
5. Koen Claessen and John Hughes. 2000. QuickCheck: a lightweight tool for random testing of Haskell programs. In ICFP. ACM. Koen Claessen and John Hughes. 2000. QuickCheck: a lightweight tool for random testing of Haskell programs. In ICFP . ACM.