Test Strategy
Test StrategyStrategy: Drop — Fintech Payment App
Project:
{{PROJECT_NAME}}Drop — Remittance + QR Payments Version:{{VERSION}}1.0 Date:{{DATE}}2026-02-23 Author:{{AUTHOR}}John (AI Director) Status:Draft | In Review |Approved Reviewers:{{REVIEWERS}}Alem Bašić (CEO)
Document History
| Version | Date | Author | Changes |
|---|---|---|---|
| 0.1 | Initial |
1. Testing Philosophy & Principles
Core Principles:
- Tests are first-class code — reviewed, maintained, refactored like production code
- Test the behavior, not the implementation — tests enable safe refactoring
- Fast feedback —
unitunit/integration tests run in seconds; blocking tests run in <53 minutes - Tests document intent — a failing test explains what broke and why it matters
- Shift left — find bugs as early as possible, before they reach users
- Security-by-testing — all security invariants (no balance column, no CVV, bcrypt-only) are encoded as automated tests
Testing philosophy: {{PHILOSOPHY}}Drop follows the test pyramid with a fintech-specific emphasis: critical financial invariants (no stored balances, PCI-DSS compliance, pass-through model) are verified in the unit/integration layer on every commit. E2E tests cover the 5 critical user journeys (registration, login, remittance, QR payment, merchant registration). We do not aim for 100% E2E coverage — instead we validate the most valuable and highest-risk paths.
2. Test Pyramid
pyramid
title Test Distribution
accTitle: Test Distribution by Layer
"Unit Tests (70%)" : 70
"Integration Tests (20%)" : 20
"E2E Tests (10%)" : 10
graph TB
subgraph E2E["E2E Tests — 10%Playwright (3 projects)"]
E2E_DESC["Critical5 critical user journeys<br/>Browseruser-flows /+ APIfull-flows end-to-end+ input-chaos<br/>Slow, expensive, high-confidence"]
end
subgraph INT["Integration Tests — 20%Vitest (api-endpoints, db, middleware)"]
INT_DESC["Service-to-serviceAPI request/response contracts<br/>DB +schema cacheintegrity + externalFK APIsconstraints<br/>MediumRate speed,limiter high-value"+ auth middleware"]
end
subgraph UNIT["Unit Tests — 70%Vitest (auth, validation, transactions)"]
UNIT_DESC["Functions,bcrypt classes,hashing, modulesJWT verification<br/>PureFee businesscalculations, logicinput validation<br/>Fast, cheap, developer-owned"]
end
subgraph PERF["Performance Tests — Vitest benchmarks"]
PERF_DESC["api-benchmarks.test.ts<br/>bcrypt timing, query latency<br/>50 concurrent rate limit calls"]
end
2.1 Unit Tests
| Attribute | Value |
|---|---|
| Scope | Individual |
| External dependencies | Mocked (no real DB, |
| Framework | npm run test) |
| Coverage target | ≥ |
| Execution time | Full suite < |
| Runs on | Every commit, pre-commit |
| Written by |
What to unit test:
BusinessverifyPasswordlogic—andbcryptalgorithmscorrectness; SHA-256 hash rejectionEdgesignJWTcases/andverifyJWTerror—conditionsJWT signing, tampered token rejectionDataFeetransformationscalculationand—validations0.5% remittance fee, 1% QR feeUtilityInputfunctionsvalidation — age ≥ 18, Norwegian phone (+47), password length, XSS/injection rejection
What NOT to unit test:
- Framework boilerplate (Next.js API routes scaffolding)
- Third-party library internals (jose, bcrypt)
- Simple
propertydatagetters/settersfetchingwith nowithout logic Framework boilerplate
2.2 Integration Tests
| Attribute | Value |
|---|---|
| Scope | |
| External dependencies | Real |
| Framework | |
| Coverage target | All |
| Execution time | Full suite < |
| Runs on | Every PR, blocking merge |
| Written by |
What to integration test:
Databaseapi-endpoints.test.tsqueries—andallORM26mappingsroutes: status codes, response shapes, auth gatingAPIdb.test.tsendpoint—request/responseschemacontractsinvariants: no balance column, no card_number/cvv, FK constraints, transaction type enumMessagemiddleware.test.tsqueue—publish/consumerate limiting (10 req/min auth; 429 on 11th); JWT auth; CSRF protectionCacheauth.test.tsread/write—behaviorbcrypt Authenticationroundsmiddleware12; SHA-256 rejection; JWT tampered token rejection
2.3 E2E Tests
| Attribute | Value |
|---|---|
| Scope | Critical user journeys through the real |
| External dependencies | Real |
| Framework | |
| Coverage target | |
| Execution time | Full suite < |
| Runs on | Post-staging deploy, pre-production gate |
| Written by | QA + |
Critical journeys tocovered E2Eby test:E2E:
{{JOURNEY_1}}User registration (3 steps: email+DOB → OTP → PIN){{JOURNEY_2}}User login + dashboard access{{JOURNEY_3}}Remittance (NOK → RSD/BAM/PKR/TRY/PLN/EUR)- QR payment (scan → confirm → receipt)
- Merchant registration + QR code generation
3. Testing Tools
| Type | Tool | Version | Purpose | Config File |
|---|---|---|---|---|
| Unit |
|
|||
|
||||
| Coverage | Vitest (@vitest/coverage-v8) |
Built-in | Coverage reports | vitest.config.ts |
| Performance | Vitest (bench) | Built-in | Benchmark tests | api-benchmarks.test.ts |
| Mocking | vi.mock) |
Mock BaaS, Sumsub, external deps | Built-in | |
| ||||
| ||||
| ||||
| ||||
| ||||
|
4. Test Environments & Data Management
Test Environments
| Test Type | Environment | Database | External Services |
|---|---|---|---|
| Unit | Local (no env) | None / in-memory | Mocked via vi.mock |
| Integration | Local + |
:memory: or temp file) |
NEXT_PUBLIC_SERVICE_MODE=mock) |
| E2E | Staging (Fly.io, Stockholm) | ||
| Performance |
Test Data Management
| Approach | Used For | Tool | Notes | ||
|---|---|---|---|---|---|
| Fixtures |
Unit + integration tests | beforeEach/afterEach |
Reset per test | ||
| Database seeding | E2E tests | |
Reset per test run | ||
| All tests | Hardcoded test data | | real |||
| Shared test accounts | E2E ( |
Never modified by tests |
Data cleanup policy: All test data cleaned up after test run (via Vitest afterEach teardown hookshooks. orSQLite transactiontest rollback)DB wiped between runs.
5. Test Automation Strategy
| Test Type | Automation | Trigger | Tooling |
|---|---|---|---|
| Unit tests | 100% automated | Pre-commit + CI | |
| Integration tests | 100% automated | CI on PR | |
| E2E (critical paths) | 100% automated | Post-staging deploy | |
| E2E ( |
|||
| Performance tests | Automated baseline | ||
| Security ( |
100% automated | Every PR | npm audit |
| Manual exploratory | Manual |
6. Manual Testing Scope
Manual testing is required for:
NewCEOfeature(Alem)exploratoryUAT walkthrough before Phase 1 production launch- BankID SCA flow (Phase 2 — not yet integrated)
- Real BaaS payment flow (Phase 2 — mock only in MVP)
- Mobile device testing on physical iOS/Android hardware (
firstPlaywrightsprintcoversof375pxa feature) Usability and UX reviewviewport)- Accessibility
testingusability(beyondonautomatedactualchecks)assistive Complex multi-step business scenarios not yet automatedThird-party integrations with limited test environmentsDevices/browsers outside automated matrixtechnology
Manual testing is NOT required for:
- Regression of
previouslyalltestedautomatedfeaturestest(automate these)paths CRUDFeeoperationscalculationson(fullystandardautomatedformsin unit tests)Unit-levelInputlogicvalidation (covered by input-chaos Playwright project)- DB compliance checks (fully automated
testsin db.test.ts)
7. Code Coverage Requirements
| Layer | Lines | Branches | Functions | Notes |
|---|---|---|---|---|
| Strictly enforced — financial security | ||||
| Transaction processing | 100% | 100% | 100% | Strictly enforced — financial correctness |
| API handlers | ≥ |
≥ |
≥ |
|
| ≥ |
≥ |
Security-critical | ||
| ≥ |
— | ≥ |
||
| Overall minimum | ≥ |
— | — | CI gate — build fails below |
Coverage enforcement: CI pipeline fails if coverage drops below minimum80% overall
Coverage report: Published toas {{COV_REPORT_URL}}CI artifact on every PR
8. Quality Gates
PR Merge Gate (must pass before merge)
- All unit tests pass (
npm run test) - All integration tests pass
- Coverage ≥
minimum80%thresholds(≥ 100% for auth + transaction paths) - No HIGH/CRITICAL security findings (
SAST/SCA)npm audit) - No secrets detected (pre-commit hook)
- TypeScript compiles (
npm run type-check) - Linting passes
Type checking passes(ifnpm)typedrunlanguage)lint
Staging Deploy Gate (must pass before staging deploy)
- All PR gates passed
- Build artifact created and
signedpushed to Fly.io
Production Deploy Gate (must pass before production deploy)
- All Playwright E2E tests pass on staging (user-flows, full-flows, input-chaos)
- Performance baseline not degraded >
{{PERF_REGRESSION}}%10% (api-benchmarks.test.ts) - Manual
QAUAT sign-off from Alem Bašić (if sprint includes new features)CEO) -
ManualSecurityapprovalauditinscoreCI≥pipeline80/100
9. Responsibility Matrix
| Test Type | Writes Tests | Reviews Tests | Maintains Tests | Signs Off | |
|---|---|---|---|---|---|
| Unit tests | |||||
| Integration tests | |||||
| E2E tests | |||||
| Performance tests | |||||
| Security tests | John (AI Director) | ||||
| DB compliance tests (db.test.ts) | Builder agent | Validator agent | Builder agent | John (AI Director) | |
| UAT (manual) | N/A | John | N/A | Alem Bašić (CEO) |
10. Test Reporting & Metrics
| Metric | Target | Reporting |
|---|---|---|
| Test pass rate | ≥ |
CI dashboard |
| Flaky test rate | < |
|
| Test execution time (unit+integration) | < |
CI dashboard |
| Coverage trend | Stable or improving | PR comments |
11. Continuous Testing in CI/CD
See CI/CD Pipeline for full pipeline details.
| Stage | Tests Run | Blocking |
|---|---|---|
| Pre-commit (local) | Unit tests, |
Yes |
| PR open / update | Unit + integration + SAST npm ) |
Yes — blocks merge |
| Staging deploy | Yes — blocks production | |
| Production deploy | Smoke |
Yes — auto-rollback on failure |
| Scheduled (nightly) | Full E2E |
No — alerts only |
Current test inventory (14 test files):
- Unit:
auth.test.ts,validation.test.ts,transactions.test.ts,rates.test.ts - Integration:
api-endpoints.test.ts,db.test.ts,middleware.test.ts - Performance:
api-benchmarks.test.ts - Regression:
regression-suite.test.ts,feature-flags.test.ts,sumsub-integration.test.ts,cards-integration.test.ts - E2E:
user-flows.spec.ts,full-flows.spec.ts,input-chaos.spec.ts
Related Documents
- Test Plan
- E2E Test Plan
- Performance Test Plan
- Definition of Done
CI/CDTestingPipelineGuide- Test Inventory
Approval
| Role | Name | Date | Signature |
|---|---|---|---|
| Author | John (AI Director) | 2026-02-23 | Approved (AI) |
| Validator Agent | 2026-02-23 | Approved (AI) | |
| John | 2026-02-23 | Approved | |
| CEO (Alem) | Alem Bašić | TBD |