Skip to content

Add comprehensive test coverage analysis and improvement proposals#749

Open
dangershony wants to merge 1 commit intomainfrom
docs/test-coverage-analysis
Open

Add comprehensive test coverage analysis and improvement proposals#749
dangershony wants to merge 1 commit intomainfrom
docs/test-coverage-analysis

Conversation

@dangershony
Copy link
Copy Markdown
Member

Summary

Full analysis of the test suite across all 4 test projects (~294 tests), identifying coverage gaps and proposing concrete improvements.

Documents Added

Document Description
TEST_COVERAGE_ANALYSIS.md Overview of current coverage, database layer gaps, data flow analysis, and priority ranking
TEST_IMPROVEMENTS.md Specific improvements to the 7 existing E2E integration tests (DB assertions, balance deltas, cross-profile validation)
TEST_NEW_PROPOSALS.md 10 new E2E test proposals: wallet import/delete, many investors, DB integrity, subscribe type, cancellation, cache behavior, edge cases
TEST_SDK_PROPOSALS.md 8 new SDK-level test classes that can run in CI without network (LiteDB round-trips, WalletFactory, DatabaseManagementService, PortfolioService, etc.)
TEST_EDGE_CASES.md 15+ edge cases cataloged with risk levels, plus 3 bugs discovered during analysis
TEST_SDK_PARITY_ANALYSIS.md Cross-reference of SDK call comparison gaps: 7/9 resolved, 2 remaining (Lightning, tx preview), integration test coverage status for each

Key Findings

  • Database layer has near-zero test coverage -- 8 document collections, none tested for round-trip persistence
  • Wallet import/delete never tested E2E -- only "Generate" path covered
  • 3 bugs documented: orphaned DerivedProjectKeys on wallet delete, dead LiteDbDocumentMapping code, no duplicate wallet guard
  • SDK parity: 7/9 gaps from the SDK call comparison have been resolved in code, but only 1/7 has integration test coverage
  • 2 SDK gaps remain open: Lightning payments (placeholder only) and transaction draft preview (no EstimateFeeAndSize calls)

Priority Recommendations

  1. LiteDB round-trip tests (CI-friendly, no network needed)
  2. WalletFactory integration tests (CI-friendly)
  3. Wallet Import + Project Scan (E2E)
  4. Wallet Delete + Reimport (E2E)
  5. Database Integrity test (E2E)
  6. Many Investors scenario (E2E)
  7. Strengthen existing tests with DB assertions
  8. Investment cancellation, subscribe type, edge cases

Analyze all 4 test projects (~294 tests) and identify coverage gaps:
- Improvements to 7 existing E2E integration tests (DB assertions, balance deltas, cross-profile validation)
- 10 new E2E test proposals (wallet import/delete, many investors, DB integrity, subscribe type, etc.)
- 8 new SDK-level test classes (LiteDB round-trips, WalletFactory, DatabaseManagementService, PortfolioService)
- 15+ edge cases cataloged with risk assessment
- SDK call parity analysis: 7/9 gaps resolved, 2 remaining (Lightning, tx preview), only 1/7 has test coverage
- 3 bugs documented (orphaned DerivedProjectKeys on delete, dead LiteDbDocumentMapping code, no duplicate wallet guard)
@nikunjkumar05
Copy link
Copy Markdown
Contributor

Can I pick up bugs found in test_edge_cases.md ?

@dangershony
Copy link
Copy Markdown
Member Author

Can I pick up bugs found in test_edge_cases.md ?

You can do the key deletion form database

dangershony added a commit that referenced this pull request Apr 4, 2026
Implement two new E2E integration tests based on PR #749 test coverage
analysis:

- WalletImportAndProjectScanTest: validates seed import UI flow, wallet
  identity determinism (same seed = same WalletId), balance preservation,
  and ScanFounderProjects discovery after device loss recovery.

- InvestmentCancellationTest: validates above-threshold pending investment
  cancellation, fund release back to investor, and successful re-investment
  after cancel (CancelInvestmentRequest had zero E2E coverage).

Both tests follow the multi-profile WithProfileWindow pattern and include
companion markdown documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants