|
|
|
|
|
by sixstringtheory
860 days ago
|
|
This articulates the problem I’m having right now in an interesting way. I’m fine writing unit tests that validate business logic requirements or bug fixes, but writing tests that validate implementations to the point that they reimplement the same logic is a bit much. I want to figure out how to count the number of times a test has had to change with updated requirements vs how many defects they’ve prevented (vs how much wall clock time / compute resources they’ve consumed in running them). |
|
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.