Googlers, see go/clank-test-strategy.
In summary:
Use real dependencies when feasible and fast. Use mocks or fakes when necessary. Use Mockito’s @Mock
most of the time, but write fakes for frequently used dependencies.
Do not use Robolectric Shadows for Chromium code. Instead, use setForTesting()
methods so that it is clear that test facilities exist.
Use Robolectric when possible (when tests do not require native or rendering). Other times, use on-device tests with the @Batch
annotation.
Write integration tests when bugs are more likely to be in how/when code is called or due to interactions with other code. In other words, use integration tests when code is:
--
You received this message because you are subscribed to the Google Groups "java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/java/CABiQX1Wo%3DENmC6Q1TXKNeZNYAgr9R-dri%2B-La0kvM9-ToqDLFQ%40mail.gmail.com.