Sobes.tech
Junior — Middle

What types of automated tests do you know and can you apply?

sobes.tech AI

Answer from AI

Main types of automated tests in Android development:

  • Unit tests — test individual methods and classes without dependence on the Android framework. Usually written using JUnit.
  • Instrumented tests — run on a device or emulator, testing interaction with Android API, UI, and components.
  • UI tests — automate the verification of the user interface, for example using Espresso.

Example of a simple unit test in Kotlin with JUnit:

@Test
fun addition_isCorrect() {
    assertEquals(4, 2 + 2)
}