Good codebase are well tested, not necessarily in aiming towards 100% test coverage. But core algorithm are at least covered in unittests; and major system workflows, covered in integration tests. While it is a common practice to assume unit tests to be independent and stateless, it is not always true with integration tests.
In this short example we have an integration test where the flow is to first preprocess the item and then compute its score.