Do everything in Java…

Wyatt via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 5 07:44:34 PST 2014


On Friday, 5 December 2014 at 14:53:43 UTC, Chris wrote:
>
> As I said, I'm not against unit tests and I use them where they 
> make sense (difficult output, not breaking existing tested 
> code). But I often don't bother with them when they tell me 
> what I already know.
>
> assert(addNumbers(1,1) == 2);
>
> I've found myself in the position when unit tests give me a 
> false sense of security.
>
Sure, you need to test the obvious things, but I find the real 
gains come from being able to verify the behaviour of edge cases 
and pathological input; and, critically, ensuring that that 
behaviour doesn't change as you refactor.  (My day job involves 
writing and maintaining legacy network libraries and parsers in 
pure C.  D's clean and easy unit tests would be a godsend for me.)

-Wyatt


More information about the Digitalmars-d mailing list