concept stub in category design

This is an excerpt from Manning's book Object Design Style Guide.
While testing, you may replace an object’s actual dependencies with stand-ins known as test doubles (such as stubs and mocks).
A fake is one kind of test double, which can be characterized as showing “somewhat complicated” behavior, just like the real implementation that will be used in production. When testing, you could also use a stub to replace a real service. A stub is a test double that just returns hardcoded values. So whenever we’d call the exchangeRateFor() method, it would return the same value, as follows.
Listing 6.18. ExchangeRatesStub always returns the same value
final class ExchangeRatesStub #1 { public function exchangeRateFor( Currency from, Currency to ): ExchangeRate { return ExchangeRate.from(from, to, 1.2); #2 } }An important characteristic of stubs and fakes is that in a test scenario, you can’t and shouldn’t make any assertions about the number of calls made to them, or the order in which those calls are made. Given the nature of query methods, they should be without side effects, so it should be possible to call them any number of times, even zero times. Making assertions about calls made to query methods leads to tests that don’t keep sufficient distance from the implementation of the classes they’re testing.