android-unit-testing
Installation
SKILL.md
Android Unit Testing Excellence ๐งช๐ก๏ธ
The ultimate guide to writing robust, reliable, and maintainable unit tests for Android applications using modern tools like MockK, Turbine, and Coroutine Test.
โก When to Use
- Business Logic Verification: Testing Use Cases or ViewModels.
- Data Layer Testing: Testing Repositories or Data Sources (with Fakes).
- Reactive Stream Testing: Verifying emitted values from
FlowandStateFlow. - Logic Refactoring: Ensuring no regressions during code changes.
- TDD (Test-Driven Development): Writing tests before implementation.
๐๏ธ Core Tools
1. JUnit 5 (Modern Standard)
- Use
@Test,@BeforeEach, and@DisplayNamefor clear tests. - Rule: Prefer JUnit 5 for new projects, but JUnit 4 is common in legacy.