On Tue, May 12, 2015 at 11:03:01PM +0200, Moritz Lenz wrote:

> I'm curious, what's a case where private state of a class needs to be
> tested, and tests agains the public interface are not enough?

> In my experience, testing against private parts only makes the tests
> more brittle (that is, every implementation change causes test failures,
> even if the public interface is unchanged).

Tests are supposed to be brittle so the code is not.

Any routine call could be a good test point--particularly when you need
to change an implementation though the public interface is unchanged.
White box testing has its value.

> Also, are you talking about an actual Perl 6 code base that needs
> testing, but that is too large for a refactoring? If yes, I'd be curious
> where such a beast exists.

The OP was Tom Browder; I was just asking about the merits of 'trust' 
vs.  'augment'.  I have seen code where such testing would be
good, but not yet in Perl 6.

Thanks,
Rob

Reply via email to