Why your test fake has four methods and uses one
transcript
You're writing a test fake. The interface has four methods. Your checkout calls one.
The vendor's gateway can charge a card. Refund, and pay out to a merchant. And download a settlement report. One interface, all four.
The checkout calls charge. Only charge. But the fake writes all four. Three just throw not supported. In Java or C plus plus, report changes typically rebuild it. It never calls the report. It gets rebuilt anyway.
Here's the catch. The checkout holds the whole gateway. So it can call payout, by accident. Nothing stops it.
Give each client the interface it needs. Checkout gets a Charger. Support gets a Refunder. One class can implement them all. A test fake writes one method. And a change to the report reaches only the finance job.
Clients shouldn't depend on methods they don't use. But a role isn't one method. Group what a client uses together. One interface per method is a fat interface in pieces.
Full breakdown in the lecture.