Code is not always meant to be run by strangers, if it's internal to a team. The interface for customers should be documented.
Re:Unit Tests as Documentation
by badmintonbaseba on Friday October 18, 2024 @06:19AM
(#41877941)
There are multiple problems with that:
1. The code uses internal interfaces, not meant to be used by users of the code.
2. The code might not use the high level public interfaces you are interested in. Those interfaces are meant to be used by users, and tested by tests.
Having said that reading the code itself is often fruitful. Not for example usages, but to just learn how the thing is implemented.
If you can't find examples of how to use the code in the code then why does the code even exist?