www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Damncheck - a property-based testing library

reply "George" <g1995z gmail.com> writes:
Hey everyone,

As my first take on D after spending around 2 weeks learning it I
thought I should write something useful that sort of encompasses
everything interesting about D (for me it was the flexibility of
working with types and lazy arguments).

After looking at dashcheck (https://github.com/mcandre/dashcheck)
I thought I'd improve it. While improving it I noticed that my
program is much different and decided to release my code as
another project; Damncheck (http://github.com/geezee/damncheck).

I was hoping to get some feedback from the community regarding
the quality of the code and if something can be written the
"D-way". I have also written a blog post about the process
(http://blog.zakhour.me/post/d/damncheck-on-building-a-property-based-testing-library-for-d/)

Thank you for your time,
George.
Sep 03 2014
next sibling parent Jacob Carlborg <doob me.com> writes:
On 04/09/14 07:39, George wrote:
 Hey everyone,

 As my first take on D after spending around 2 weeks learning it I
 thought I should write something useful that sort of encompasses
 everything interesting about D (for me it was the flexibility of
 working with types and lazy arguments).

 After looking at dashcheck (https://github.com/mcandre/dashcheck)
 I thought I'd improve it. While improving it I noticed that my
 program is much different and decided to release my code as
 another project; Damncheck (http://github.com/geezee/damncheck).
That looks like an interesting project. -- /Jacob Carlborg
Sep 03 2014
prev sibling next sibling parent reply "Idan Arye" <GenericNPC gmail.com> writes:
On Thursday, 4 September 2014 at 05:39:04 UTC, George wrote:
 Hey everyone,

 As my first take on D after spending around 2 weeks learning it 
 I
 thought I should write something useful that sort of encompasses
 everything interesting about D (for me it was the flexibility of
 working with types and lazy arguments).

 After looking at dashcheck 
 (https://github.com/mcandre/dashcheck)
 I thought I'd improve it. While improving it I noticed that my
 program is much different and decided to release my code as
 another project; Damncheck (http://github.com/geezee/damncheck).

 I was hoping to get some feedback from the community regarding
 the quality of the code and if something can be written the
 "D-way". I have also written a blog post about the process
 (http://blog.zakhour.me/post/d/damncheck-on-building-a-property-based-testing-library-for-d/)

 Thank you for your time,
 George.
You should make your generators accept seeds. Seedless randoms are bad for unit testing, since you can't replicate failed tests.
Sep 04 2014
parent "George" <g1995z gmail.com> writes:
On Thursday, 4 September 2014 at 12:31:47 UTC, Idan Arye wrote:
 On Thursday, 4 September 2014 at 05:39:04 UTC, George wrote:
 Hey everyone,

 As my first take on D after spending around 2 weeks learning 
 it I
 thought I should write something useful that sort of 
 encompasses
 everything interesting about D (for me it was the flexibility 
 of
 working with types and lazy arguments).

 After looking at dashcheck 
 (https://github.com/mcandre/dashcheck)
 I thought I'd improve it. While improving it I noticed that my
 program is much different and decided to release my code as
 another project; Damncheck 
 (http://github.com/geezee/damncheck).

 I was hoping to get some feedback from the community regarding
 the quality of the code and if something can be written the
 "D-way". I have also written a blog post about the process
 (http://blog.zakhour.me/post/d/damncheck-on-building-a-property-based-testing-library-for-d/)

 Thank you for your time,
 George.
You should make your generators accept seeds. Seedless randoms are bad for unit testing, since you can't replicate failed tests.
Thank you for the feedback, I added the ability to explicitly set the seed and to easily retrieve it after each test completion (it's now a property in the DamnStat struct which is returned when a test is completed)
Sep 05 2014
prev sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
George:

 I was hoping to get some feedback from the community regarding
 the quality of the code and if something can be written the
 "D-way". I have also written a blog post about the process
 (http://blog.zakhour.me/post/d/damncheck-on-building-a-property-based-testing-library-for-d/)
Eventually a QuickCheck-like library needs to become standard tool used to test most D projects. There are many other related ideas, like: http://www.cse.chalmers.se/~nicsma/quickspec.pdf Bye, bearophile
Sep 09 2014