Pick the fix
A team's 400 Espresso tests take 50 minutes in CI and are flaky. Most check ViewModel logic through the UI. Best move?
Hint 1 of 1
Does checking ViewModel logic need a device?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Move logic checks to local ViewModel tests with fakes and keep a few UI tests for key journeys
Correct. Logic tests run in seconds on the JVM; UI tests cover only what needs a device.
Why not the others?
- B Run the Espresso tests on more emulators. Faster, but still slow and flaky.
- C Delete the tests. Loses coverage.
- D Add Thread.sleep to stabilise them. Makes them slower and still flaky.