Does D have too many features?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Apr 29 20:03:44 PDT 2012


On Sun, Apr 29, 2012 at 11:39:02PM +0200, deadalnix wrote:
> Le 29/04/2012 22:54, Alex Rønne Petersen a écrit :
> >D unit tests were never really useful for anything beyond
> >single-library projects IMHO. They don't scale for large, real-world
> >application projects with lots of libraries and executables.
> >
> 
> +1 A good std.unittest + attributes is probably a better approach.

The only reason I actually write unittests for D code is because
unittest{} is so convenient. If I had to import std.unittest, most
likely my code will have no unittests at all.

I find that because unittest{} makes it so convenient to write
unittests, it's just embarrassing to not write them. Which is kinda the
point, 'cos in my experience the act of writing a unittest automatically
makes you think about corner cases in the code you just wrote (or just
about to write), which means there will be less bugs from the get-go.

Also, unittest is just that: for _unit_ tests. If you start needing an
entire framework for them, then you're no longer talking about _unit_
tests, you're talking about module- or package-level testing frameworks,
and you should be using something more suitable for that, not unittest.


T

-- 
Windows: the ultimate triumph of marketing over technology. -- Adrian von Bidder


More information about the Digitalmars-d mailing list