Recall & Review
beginner
What are instrumented tests in Android development?
Instrumented tests run on a real device or emulator and can interact with the Android framework and UI components.
Click to reveal answer
beginner
Which Android testing framework is commonly used for instrumented tests?
Espresso is commonly used for instrumented UI tests in Android to simulate user interactions.
Click to reveal answer
beginner
Where are instrumented test files located in an Android project?
They are located in the src/androidTest/java directory of the project.
Click to reveal answer
intermediate
What annotation is used to mark an instrumented test class in Android?The @RunWith(AndroidJUnit4::class) annotation marks a class to run with the AndroidJUnit4 test runner.Click to reveal answer
beginner
Why do instrumented tests require a device or emulator to run?
Because they interact with Android system components and UI, which only exist on a device or emulator.
Click to reveal answer
Where do instrumented tests run?
✗ Incorrect
Instrumented tests run on a real device or emulator to access Android system components.
Which directory contains instrumented test code in an Android project?
✗ Incorrect
Instrumented tests are placed under src/androidTest/java to separate them from local unit tests.
Which annotation is used to specify the test runner for instrumented tests?
✗ Incorrect
@RunWith(AndroidJUnit4::class) tells the system to use the AndroidJUnit4 runner for instrumented tests.
What is Espresso used for in Android instrumented tests?
✗ Incorrect
Espresso is a testing framework to simulate user actions like clicks and typing in instrumented tests.
Why can't instrumented tests run on the local JVM alone?
✗ Incorrect
Instrumented tests need Android APIs and UI, which are not available on the local JVM.
Explain what instrumented tests are and why they are important in Android development.
Think about how you test the app like a user on a phone.
You got /4 concepts.
Describe the typical setup and annotations needed to write an instrumented test in Kotlin for Android.
Consider where the code lives and how the test runner is specified.
You got /4 concepts.