docs(android): add test coverage plan to reach the 50% gate #40

Merged
whitlocktech merged 1 commits from docs/android-coverage-plan into main 2026-07-22 19:30:07 +00:00
Member

What & why

With the JaCoCo→Sonar wiring live (Android-app#26), the Android app's coverage is now measured: 16.4% on new code — still under the 50% quality gate. This adds a concrete, phased plan to close that gap.

docs/android/COVERAGE_PLAN.md:

  • Gap analysis bucketed from Sonar's per-file uncovered_lines: ViewModels are the dominant lever (28 files, 1,153 lines, 0.1% covered — no ViewModel has a test); then DTOs (648 lines, 27%), repositories (274, 11%), core utils.
  • Two levers, together: (0) broaden sonar.coverage.exclusions to stop counting code a JVM unit test can't execute (pure-@Composable *Components.kt/renderers the *Screen.kt glob missed, push services, Keystore-backed Encrypted* stores); (1–4) test the logic — DTOs → ViewModels → repositories → core.
  • Test harness to add: a MainDispatcherRule + a hand-fake ViewModel test pattern (no new deps; matches the repo's no-mock convention).
  • Per-phase projections: Phase 0 ≈ 20%, +DTOs ≈ 34%, +ViewModels ≈ 65% clears the gate; repositories + core add margin.

Cross-linked from PLAN.md §12.1.

This is docs only — the actual tests land later as separate Android-app PRs (one per phase).


[x] AI-assisted: authored with Claude Code (Claude Opus 4.8). AI-authored commits carry a Co-Authored-By trailer.

🤖 Generated with Claude Code

## What & why With the JaCoCo→Sonar wiring live (`Android-app#26`), the Android app's coverage is now measured: **16.4% on new code** — still under the **50%** quality gate. This adds a concrete, phased plan to close that gap. `docs/android/COVERAGE_PLAN.md`: - **Gap analysis** bucketed from Sonar's per-file `uncovered_lines`: ViewModels are the dominant lever (28 files, 1,153 lines, **0.1%** covered — no ViewModel has a test); then DTOs (648 lines, 27%), repositories (274, 11%), core utils. - **Two levers, together:** (0) broaden `sonar.coverage.exclusions` to stop *counting* code a JVM unit test can't execute (pure-`@Composable` `*Components.kt`/renderers the `*Screen.kt` glob missed, push services, Keystore-backed `Encrypted*` stores); (1–4) *test* the logic — DTOs → ViewModels → repositories → core. - **Test harness** to add: a `MainDispatcherRule` + a hand-fake ViewModel test pattern (no new deps; matches the repo's no-mock convention). - **Per-phase projections:** Phase 0 ≈ 20%, +DTOs ≈ 34%, **+ViewModels ≈ 65% ✅ clears the gate**; repositories + core add margin. Cross-linked from `PLAN.md` §12.1. This is docs only — the actual tests land later as separate `Android-app` PRs (one per phase). --- > [x] **AI-assisted:** authored with Claude Code (Claude Opus 4.8). AI-authored commits carry a `Co-Authored-By` trailer. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wtclaude added 1 commit 2026-07-22 19:27:59 +00:00
Post-#26 the JaCoCo→Sonar wiring is live and coverage measures 16.4% on new
code — under the 50% gate. Add COVERAGE_PLAN.md: a bucketed analysis of the
gap (ViewModels 0.1%/1153 lines is the dominant lever; DTOs, repositories,
core utils next) and a phased plan — Phase 0 broadens coverage exclusions to
drop non-unit-testable UI/framework code, Phases 1–4 test DTOs, ViewModels,
repositories, and core. Includes a MainDispatcherRule harness + VM test
pattern and per-phase coverage projections (Phase 2 clears the gate at ~65%).
Cross-linked from PLAN.md §12.1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgyHnrNa8WwG3doxvxjuCr
whitlocktech approved these changes 2026-07-22 19:30:00 +00:00
whitlocktech merged commit f773a13c23 into main 2026-07-22 19:30:07 +00:00
whitlocktech deleted branch docs/android-coverage-plan 2026-07-22 19:30:07 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/docs#40
No description provided.