Testing in the D Standard Library

Mark via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Jan 22 12:18:11 PST 2017


On Friday, 20 January 2017 at 13:35:40 UTC, Mike Parker wrote:
> Jack Stouffer details how unit testing, code review, and code 
> coverage are handled in the development and maintenance of 
> Phobos. Thanks, Jack!
>
> Blog:
> https://dlang.org/blog/2017/01/20/testing-in-the-d-standard-library/
>
> Reddit:
> https://www.reddit.com/r/programming/comments/5p3vlq/testing_in_the_d_standard_library/

Very informative!

Have you considered adding randomized tests to Phobos? For 
instance, for the sum() example, you could generate a random 
array x, say, 100 times and assert:

sum(x) == x[0] + sum(x[1..$]);

which is pretty much the defining property of the summation 
function (along with sum(a)==a[0] for an array of length 1).


More information about the Digitalmars-d-announce mailing list