News for hackers. Stuff that matters.
Re:Unit Testing is Overrated (2020) by onli on Thursday April 07, 2022 @07:18AM (#30943024)
That your public function calls private functions is an implementation detail. It does not matter, test the public function. Subsequently that tests the private functions for all relevant input.

There was recently a submission here on HN that talked about this and different perspectives on that topic. It's not a universally shared opinion, surprisingly.

Re:Unit Testing is Overrated (2020) by oxff on Saturday April 09, 2022 @03:13AM (#30965850)
This seems obviously correct to me and it's still not appreciated by many developer teams.

Then there's the world of behavior / property / invariant -based testing which slims down your tests to essentially data generation and testing observable behavior which seems like magic to people still.