Skip to content

Proposal: Improve Test Coverage Infrastructure #3516

@ksalhab89

Description

@ksalhab89

Assalamu Alaikum,

I'm a new contributor interested in helping improve the test coverage for this project. After exploring the codebase, I noticed there's an opportunity to strengthen the testing foundation, which could help prevent regressions and make future contributions safer.

Current State

  • ~24 test files primarily in the app module
  • No code coverage tooling configured
  • Limited shared test utilities

Proposal

I'd like to contribute a testing infrastructure improvement in phases:

Phase 1: Foundation (Ready)

  • Add Kover plugin for code coverage reporting
  • Create common:test-utils module with shared test infrastructure:
    • TestDispatcherRule for coroutines testing
    • RxSchedulerRule for RxJava testing
    • Flow test extensions (Turbine-based)
    • TestDataFactory for Quran-specific test fixtures
  • Expand QuranInfo tests from 6 to 46 tests (boundary conditions, invalid inputs, edge cases)

Future Phases (if Phase 1 is welcomed)

  • Phase 2: Model layer tests (SuraAyah, bookmarks)
  • Phase 3: Repository/data layer tests
  • Phase 4: Presenter/ViewModel tests
  • Phase 5: Integration tests

Why This Approach

  1. Non-breaking: No changes to production code
  2. Incremental: Small, reviewable PRs
  3. Foundation-first: Utilities that make future testing easier
  4. Follows existing patterns: Matches project's code style and architecture

Questions for Maintainers

Before I submit a PR, I wanted to check:

  1. Is improving test coverage something you'd welcome?
  2. Any preferences on testing frameworks? (I used JUnit4, Truth, MockK, Turbine based on existing tests)
  3. Should the test-utils module live under common/ or elsewhere?
  4. Any specific areas you'd prioritize for testing?

I have Phase 1 ready locally and can submit a PR whenever you're ready to review. Happy to adjust the approach based on your feedback.

JazakAllahu Khairan for maintaining this beautiful project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions