From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4207E7F736 for ; Tue, 15 Sep 2015 16:45:10 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ceastlund@janestreet.com; spf=Pass smtp.mailfrom=ceastlund@janestreet.com; spf=None smtp.helo=postmaster@mxout4.mail.janestreet.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ceastlund@janestreet.com) identity=pra; client-ip=38.105.200.233; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="ceastlund@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ceastlund@janestreet.com designates 38.105.200.233 as permitted sender) identity=mailfrom; client-ip=38.105.200.233; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="ceastlund@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout4.mail.janestreet.com) identity=helo; client-ip=38.105.200.233; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="postmaster@mxout4.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AIAgDZLfhVnOnIaSZdFoNhaQaCXrxygkGDNgKBNQc8EAEBAQEBAQERAQEBAQEGFglPhCMBAQECAQEMBhEEGQEBNwEECwkCCw0qAgIhARIBBQEcBhMih3cDCggDCph/j0aBMD4xilVxhGUBBYpKDYReAQEBAQEBBAEBAQEBAQEBAQEBEQYKhmmEfYJQHoE2ZQQHgmmBQ5VhhRCGBYFughORNoVxEiOBFziCLw0cgXBVAQGKKAEBAQ X-IPAS-Result: A0AIAgDZLfhVnOnIaSZdFoNhaQaCXrxygkGDNgKBNQc8EAEBAQEBAQERAQEBAQEGFglPhCMBAQECAQEMBhEEGQEBNwEECwkCCw0qAgIhARIBBQEcBhMih3cDCggDCph/j0aBMD4xilVxhGUBBYpKDYReAQEBAQEBBAEBAQEBAQEBAQEBEQYKhmmEfYJQHoE2ZQQHgmmBQ5VhhRCGBYFughORNoVxEiOBFziCLw0cgXBVAQGKKAEBAQ X-IronPort-AV: E=Sophos;i="5.17,536,1437429600"; d="scan'208";a="177722134" Received: from mxout4.mail.janestreet.com ([38.105.200.233]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Sep 2015 16:45:08 +0200 Received: from tot-qpr-mailcore2.delacy.com ([172.27.56.106] helo=tot-qpr-mailcore2) by mxout4.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1ZbrTo-0002gk-7K for caml-list@inria.fr; Tue, 15 Sep 2015 10:45:08 -0400 X-JS-Flow: external Received: by tot-qpr-mailcore2 with JS-mailcore (0.1) (envelope-from ) id BV-C7z-AAAGrT-ej; 2015-09-15 10:45:07.978470-04:00 Received: from mail-io0-f176.google.com ([209.85.223.176]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1ZbrTn-0006r4-RB for caml-list@inria.fr; Tue, 15 Sep 2015 10:45:07 -0400 Received: by ioii196 with SMTP id i196so202091421ioi.3 for ; Tue, 15 Sep 2015 07:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=r1u91Q/yXgstdSCJ49G0MaoMkw7ppI17cZLhB0yXq8M=; b=tNYOQDMpKIFyXhHOd+aVu7a7rZ/d1xnsvXMH5Z6AdVT9OOhRwKiWQtYc+Yzw/lpqL0 v0kEMlf+GBFqvKW27xySD3VVbj0SvkturDbnLR/IfAsXFz6nbVtinmz2W4p1d4tqCuUf 3eWibZg74j+HDU2L7nDm/bJ6BRlsPyksQq7sQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=r1u91Q/yXgstdSCJ49G0MaoMkw7ppI17cZLhB0yXq8M=; b=Z7IJaa1lZycaUIqE7IvRpMV1YgrZj9eJCV8zZu9h+3MaxMg08L8vrnUAmHchb2FOFL eTi0TSoJ5pAKsG7DSXtF36HppPGE+y0MVdBXKhVUUR7Fq9FiAe2ksl5S/ua4G3tH4KfM /Cs5dvfAbz34BKllcYqyotnXDqfE3qkBVb+rONO4Tk70sPlQNxbrc9Ey96WORBaopJUQ aUWpkZZPM9L/KADosVV5YdF5ZjNiCffQEZ4U9xO8jsAM7vZWNq4VpBYtxwuOfnXNdraM 56Ot8Jk4g9EOWf2uIZi4l1p7VBMvDPBJBuW67eGJJHyBGpfRdPjFXFD+Dor3jpKHjTae C9XA== X-Gm-Message-State: ALoCoQmQi+kBtmQu884LISp32V91T7EJ1FmBiD8EC0q4Fzxea1HCZtwWJTIMNGmLVhb8wv/GxuuccQycwfQn6x3rBYEPgSW+zPVlm/cJ9Y5OheeN5V0dYTR2t2XsJT3QQuSbKQvCjOo8 X-Received: by 10.107.160.67 with SMTP id j64mr32875348ioe.128.1442328307381; Tue, 15 Sep 2015 07:45:07 -0700 (PDT) X-Received: by 10.107.160.67 with SMTP id j64mr32875289ioe.128.1442328307049; Tue, 15 Sep 2015 07:45:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.181.85 with HTTP; Tue, 15 Sep 2015 07:44:27 -0700 (PDT) In-Reply-To: <20150915143044.GA22560@carty> References: <55F536EE.5010901@etorok.net> <20150913155224.GE16946@carty> <20150915143044.GA22560@carty> From:Carl Eastlund Date: Tue, 15 Sep 2015 10:44:27 -0400 Message-ID: To:Simon Cruanes Cc:Gabriel Scherer , Yaron Minsky , "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a1140ed9c6445d1051fca3a2a X-JS-Processed-by: mailcore Subject: Re: [Caml-list] Quick Check like testing for OCaml? --001a1140ed9c6445d1051fca3a2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Currently generators and shrinkers (and observers, which generate functions -- the analog to CoArbitrary in Haskell) are all written manually. I do intend to add syntax for them, but that's been pending on a few other updates, especially our switch from camlp4 to ppx syntax extensions. We do print counterexamples using s-expressions, as you say. Our shrinkers use the type ('a -> 'a Sequence.t), where Sequence.t is a lazy, unmemoized sequence type in Core. On Tue, Sep 15, 2015 at 10:30 AM, Simon Cruanes wrote: > I am working on adding shrinking into qtest > (https://github.com/vincent-hugot/iTeML/), and I'm curious about what > design choices you did. Haskell literate mentions > > shrink: 'a -> 'a list > > to shrink values, but on large counter-examples like large lists, it > might be very slow. I'm trying to use iterators to generate shrunk(?) > values lazily. > > Also, do Core users write random generators or shrinking functions > themselves, or do you have a deriver for them? I assume you use "with sex= p" > to display counter-examples. > > Cheers, > > Le Tue, 15 Sep 2015, Carl Eastlund a =C3=A9crit : > > Glad you like it. Our Quickcheck implementation is new and its design = is > > still somewhat of an experiment, so I can't claim it's a mature library > as > > originally asked for in this thread, but of course we appreciate feedba= ck > > from early adopters. As Yaron said, I'm writing up a blog post that wi= ll > > go into more detail about it. > > > > We just had an intern, Daniel Spencer, implement shrinking. That will > make > > its way to the public release shortly. > > > > On Tue, Sep 15, 2015 at 10:06 AM, Gabriel Scherer < > gabriel.scherer@gmail.com > > > wrote: > > > > > > > >> > https://github.com/janestreet/core_kernel/blob/master/src/quickcheck_gene= rator.mli > > >> > > >> > https://github.com/janestreet/core_kernel/blob/master/src/quickcheck_obse= rver.mli > > >> > > > > > > This is very nice. > > > I hope the library will also get shrinking support, because it not so > easy > > > to do, and important in practice. > > > > > > On Tue, Sep 15, 2015 at 3:09 PM, Yaron Minsky > > > wrote: > > > > > >> Core_kernel has a recently added quickcheck library. Carl Eastlund, > who > > >> is the main author, is finishing up a blog post describing it, but > you can > > >> start with the documentation in this file: > > >> > > >> > > >> > https://github.com/janestreet/core_kernel/blob/master/src/quickcheck_gene= rator.mli > > >> > > >> On Sun, Sep 13, 2015 at 11:52 AM, Simon Cruanes < > > >> simon.cruanes.2007@m4x.org> wrote: > > >> > > >>> There is also qtest (also called iTeML on github) which is a bit > > >>> special: it's a testing framework providing unit testing through > OUnit, > > >>> and simple random testing; its specificy is that tests can be > written in > > >>> comments within the module to test, so that the code itself has no > > >>> additional > > >>> dependencies or code bloat due to tests. It is very easy to write n= ew > > >>> tests, since you don't have to add specific test modules. > > >>> It is used, afaik, at least in Batteries and in containers. > > >>> > > >>> I am probably going to work on making qtest and qcheck a bit closer, > if > > >>> qtest's developper(s) agree. > > >>> > > >>> Cheers, > > >>> > > >>> Le Sun, 13 Sep 2015, T=C3=B6r=C3=B6k Edwin a =C3=A9crit : > > >>> > On 09/13/2015 11:09 AM, Keiko Nakata wrote: > > >>> > > Hi, > > >>> > > > > >>> > > I am looking for (reasonably matured and hopefully easy to > install) > > >>> QuickCheck-like property based testing software for OCaml code. > > >>> > > > > >>> > > Any information is appreciated! > > >>> > > > >>> > There is qcheck.0.4, quickcheck.1.0.2 and kaputt.1.2 on opam. > > >>> > qcheck has documentation in the mli, integration with OUnit and > quite > > >>> easy to get started with. > > >>> > Kaputt also has reducers (to produce smaller counterexamples), and > > >>> SmallCheck-like enumeration tests. > > >>> > > > >>> > I haven't tried quickcheck, and haven't found an equivalent to > > >>> SmartCheck's counterexample generalization [1] > > >>> > > > >>> > [1] https://www.cs.indiana.edu/~lepike/pubs/smartcheck.pdf > > >>> > > > > -- > Simon Cruanes > > http://weusepgp.info/ > key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA > 62B6 > --=20 Carl Eastlund --001a1140ed9c6445d1051fca3a2a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Currently generators and shrinkers (and observers, which g= enerate functions -- the analog to CoArbitrary in Haskell) are all written = manually.=C2=A0 I do intend to add syntax for them, but that's been pen= ding on a few other updates, especially our switch from camlp4 to ppx synta= x extensions.=C2=A0 We do print counterexamples using s-expressions, as you= say.

Our shrinkers use the type ('a -> 'a Se= quence.t), where Sequence.t is a lazy, unmemoized sequence type in Core.

On Tue, Sep 15, = 2015 at 10:30 AM, Simon Cruanes <simon.cruanes.2007@m4x.org&g= t; wrote:
I am working on adding s= hrinking into qtest
(https://github.com/vincent-hugot/iTeML/), and I'm cu= rious about what
design choices you did. Haskell literate mentions

shrink: 'a -> 'a list

to shrink values, but on large counter-examples like large lists, it
might be very slow. I'm trying to use iterators to generate shrunk(?) values lazily.

Also, do Core users write random generators or shrinking functions
themselves, or do you have a deriver for them? I assume you use "with = sexp"
to display counter-examples.

Cheers,

Le Tue, 15 Sep 2015, Carl Eastlund a =C3=A9crit :
> Glad you like it.=C2=A0 Our Quickcheck implementation is new and its d= esign is
> still somewhat of an experiment, so I can't claim it's a matur= e library as
> originally asked for in this thread, but of course we appreciate feedb= ack
> from early adopters.=C2=A0 As Yaron said, I'm writing up a blog po= st that will
> go into more detail about it.
>
> We just had an intern, Daniel Spencer, implement shrinking.=C2=A0 That= will make
> its way to the public release shortly.
>
> On Tue, Sep 15, 2015 at 10:06 AM, Gabriel Scherer <gabriel.scherer@gmail.com
> > wrote:
>
> >
> >> http= s://github.com/janestreet/core_kernel/blob/master/src/quickcheck_generator.= mli
> >>
> >> https= ://github.com/janestreet/core_kernel/blob/master/src/quickcheck_observer.ml= i
> >>
> >
> > This is very nice.
> > I hope the library will also get shrinking support, because it no= t so easy
> > to do, and important in practice.
> >
> > On Tue, Sep 15, 2015 at 3:09 PM, Yaron Minsky <yminsky@janestreet.com>
> > wrote:
> >
> >> Core_kernel has a recently added quickcheck library.=C2=A0 Ca= rl Eastlund, who
> >> is the main author, is finishing up a blog post describing it= , but you can
> >> start with the documentation in this file:
> >>
> >>
> >> http= s://github.com/janestreet/core_kernel/blob/master/src/quickcheck_generator.= mli
> >>
> >> On Sun, Sep 13, 2015 at 11:52 AM, Simon Cruanes <
> >> simon.cruanes.2= 007@m4x.org> wrote:
> >>
> >>> There is also qtest (also called iTeML on github) which i= s a bit
> >>> special: it's a testing framework providing unit test= ing through OUnit,
> >>> and simple random testing; its specificy is that tests ca= n be written in
> >>> comments within the module to test, so that the code itse= lf has no
> >>> additional
> >>> dependencies or code bloat due to tests. It is very easy = to write new
> >>> tests, since you don't have to add specific test modu= les.
> >>> It is used, afaik, at least in Batteries and in container= s.
> >>>
> >>> I am probably going to work on making qtest and qcheck a = bit closer, if
> >>> qtest's developper(s) agree.
> >>>
> >>> Cheers,
> >>>
> >>> Le Sun, 13 Sep 2015, T=C3=B6r=C3=B6k Edwin a =C3=A9crit :=
> >>> > On 09/13/2015 11:09 AM, Keiko Nakata wrote:
> >>> > > Hi,
> >>> > >
> >>> > > I am looking for (reasonably matured and hopefu= lly easy to install)
> >>> QuickCheck-like property based testing software for OCaml= code.
> >>> > >
> >>> > > Any information is appreciated!
> >>> >
> >>> > There is qcheck.0.4, quickcheck.1.0.2 and kaputt.1.2= on opam.
> >>> > qcheck has documentation in the mli, integration wit= h OUnit and quite
> >>> easy to get started with.
> >>> > Kaputt also has reducers (to produce smaller counter= examples), and
> >>> SmallCheck-like enumeration tests.
> >>> >
> >>> > I haven't tried quickcheck, and haven't foun= d an equivalent to
> >>> SmartCheck's counterexample generalization [1]
> >>> >
> >>> > [1] https://www.cs.indi= ana.edu/~lepike/pubs/smartcheck.pdf
> >>> >


--
Simon Cruanes

http= ://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3=C2=A0 7D8D 4AC0 1D08 49A= A 62B6



--
=
Carl Eastlund
--001a1140ed9c6445d1051fca3a2a--