← Back to context

Comment by worksonmine

3 months ago

If I already have passing tests for anything function A might do, I can safely assume it will behave the same when called from B, C and D.

In some languages A might free a memory allocation e.g. after communicating with some server.

If B also frees that memory then there is a bug. Presumably this means B's tests are wrong/incomplete. If B was mocking A to avoid the IO, you might not find out.