Android Testing Flashcards
6 cards from real Android Development practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Android Testing flashcards as text
What is a test double in Android unit testing?
Answer: An object that substitutes a real dependency in a test (mock, stub, fake, spy)
A test double is any substitute object used in place of a real dependency during testing, including mocks, stubs, fakes, and spies.
Which annotation in JUnit 4 marks a method as a test case?
Answer: @Test
@Test annotation marks a public method as a JUnit test method that the test runner should execute.
What does the Espresso check() method verify in a UI test?
Answer: That a view meets a specified ViewAssertion condition
check() in Espresso verifies that the matched view satisfies a ViewAssertion, such as isDisplayed() or withText().
Which testing approach tests multiple integrated components together?
Answer: Integration testing
Integration testing verifies that multiple components like ViewModels, repositories, and databases work correctly together as a system.
What is the purpose of the @RunWith annotation in Android tests?
Answer: To specify the test runner class used to execute the tests
@RunWith specifies the test runner (e.g., AndroidJUnit4) that JUnit should use to run the test class.
What is snapshot testing in Android UI development?
Answer: Comparing rendered UI screenshots against stored reference images to detect visual regressions
Snapshot testing captures screenshots of UI components and compares them to stored baseline images to automatically detect unintended visual changes.