-
Make sure your code interacts with other components via abstractions. They make code easier to understand and easier to test.
-
Prefer function-field stubs over switch-statement stubs when the same method needs different behavior across test cases.
-
Stubs are useful for testing, but verify that usign one is helping you test your production code, not the stub itself.
-
Use httptest to validate that the HTTP clients in your code are both sending and receiving data correctly.
-
Separate unit tests from integration test via tags or environment variables.
Progress is saved on this device.