|
|
|
|
|
by tsycho
849 days ago
|
|
1. Define your APIs in terms of "what" it should do, not "how" (which is for the implementation). 2. Use protocols/interfaces in Swift/Java to define APIs. 3. Then write tests to the API's public contract, without using internal implementation details. Tests written in the above way will actually detect bugs, and stay stable to internal implementation changes that don't affect the external behavior. |
|