[Haskell-cafe] What is the state of the art in testing code generation?

Justin Bailey jgbailey at gmail.com
Fri Jul 11 23:52:22 UTC 2014


Do you want to share your library yet? Sounds pretty cool.

On Fri, Jul 11, 2014 at 10:58 AM, Tom Ellis
<tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> I am implementing an EDSL that compiles to SQL and I am wondering what is
> the state of the art in testing code generation.
>
> All the Haskell libraries I could find that deal with SQL generation are
> tested by implementing multiple one-off adhoc queries and checking that when
> either compiled to SQL or run against a database they give the expected,
> prespecified result.
>
>  * https://github.com/prowdsponsor/esqueleto/blob/master/test/Test.hs
>  * https://github.com/m4dc4p/haskelldb/blob/master/test/TestCases.hs
>  * https://github.com/yesodweb/persistent/blob/master/persistent-test/SumTypeTest.hs
>
> I couldn't find any tests for groundhog.
>
>  * https://github.com/lykahb/groundhog
>
> I also had a look at Javascript generators.  They take a similar adhoc,
> one-off approach.
>
>  * https://github.com/valderman/haste-compiler/tree/master/Tests
>  * https://github.com/faylang/fay/tree/master/tests
>
> Is this the best we can do in Haskell?  Certainly it seems hard to use a
> QuickCheck/SmallCheck approach for this purpose.  Is there any way this kind
> of testing can be automated or made more robust?
>
> Thanks,
>
> Tom
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Haskell-Cafe mailing list