News for hackers. Stuff that matters.
Re:Ask HN: Why do you make class members private? by tejohnso on Monday July 25, 2022 @02:40PM (#32228991)
> you could completely re-do the guts...all your tests will still work

That's optimistic. I suspect there are some people who would be confused by your statement if they've been exposed mostly to tests that verify the steps taken by the implementation.

Re:Ask HN: Why do you make class members private? by jacquesm on Monday July 25, 2022 @02:40PM (#32229005)
That's what I would call 'brittle tests'.
Re:Ask HN: Why do you make class members private? by tejohnso on Monday July 25, 2022 @02:59PM (#32229289)
Yeah, "brittle", or "fragile", or "tightly coupled to the implementation"

In any case, it's not good. Also not uncommon.

Re:Ask HN: Why do you make class members private? by jacquesm on Monday July 25, 2022 @03:02PM (#32229333)
> Also not uncommon.

Fair enough.

Typically this is a case of people not really getting what unit tests are for, so they end up testing the implementation rather than the behavior.