Unit testing on Android
summary
Defines unit test as isolating a single method, class or component and shows concrete examples wired in Gradle using Gradle + JUnit + Mockito + Robolectric to run tests on the JVM so Android code runs without a device, demonstrates @Mock, @InjectMocks and Spy behaviors with actual assertions, and runs coverage with JaCoCo shows line/branch/method/class coverage reporting green/yellow/red lines. Argues test-first or after is optional, claims unit tests act as living docs and force testable design, and measures when to stop based on coverage metrics.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:28ABOUT ME
- 1:37UNIT TEST
- 4:24WHY TEST YOUR CODE ?
- 6:55Test frameworks for Android
- 7:43JUnit JUnit is a simple framework to write repeatable tests.
- 9:58Initial Test Case With Annotations
- 10:43Assertions
- 11:11Test Suites
- 13:29mockitc
- 17:36Test Coverage JaCoCo is a free code coverage library for Java








