Test strategy
Example Lending’s test architect wrote this strategy in month 2, with the quality scenarios as the starting point. It follows the test portfolio approach: most confidence from fast tests at each service’s boundary, contract tests between services, and very few end-to-end tests.
Diagram
Section titled “Diagram”- Each service's own tests and its contracts with neighbors run on every commit, in minutes.
- Pull requests get a short-lived environment with virtual vendors; performance and failure tests run weekly and before each release.
- Releases go to a small share of traffic first, watched by the same SLOs that run in production.
Tests at each boundary
Section titled “Tests at each boundary”| Boundary | Test type | What it proves | Owner |
|---|---|---|---|
| Inside each service | Unit and component tests, dependencies replaced by test doubles | Business logic: application state machine, ledger arithmetic, pricing | Each team |
| Decision strategy | Regression against a library of 2,000 historical applications | A strategy change produces the expected outcomes and reasons; every difference is explained | Decisioning team with credit |
| Service to service | Consumer-driven contract tests (Pact) | The application service and the decision service still agree; event consumers match producers’ schemas | Both teams in each pair |
| Service to database | Integration tests with a real PostgreSQL in a container | Queries, migrations, transactions, the outbox | Each team |
| Service to vendors | Contract tests against recorded vendor responses, plus a weekly run against each vendor’s sandbox | Adapters handle real responses, errors and timeouts | Owning team |
| Whole journey | Six end-to-end tests in the ephemeral environment | Apply, decide, review, sign, fund, notify, on the critical paths only | Test architect |
| Browser | Accessibility checks and visual tests on each step of the application | WCAG 2.1 AA; no broken layouts on phones | Journey team |
Contracts that are tested on every commit
Section titled “Contracts that are tested on every commit”| Consumer | Provider | Contract |
|---|---|---|
| Customer web app | Application service (through the gateway) | Application API |
| Application service | Decision service | Decision API, including idempotency and reason codes |
| Review workbench | Decision service | Workbench API, including authorization by queue |
| Notice service | Decision service | DecisionMade.v2 event |
| Funding service | Application service | AgreementSigned.v1 event |
| Servicing adapter | Funding service | LoanFunded.v1 event |
| All event consumers | All producers | No restricted fields in any event (threat T-13) |
Test data
Section titled “Test data”- Synthetic applicants generated to a specification: income bands, credit profiles, edge cases such as thin credit files or recent address changes. No real personal data in any test environment.
- Virtual vendors for identity, bureau, e-signature and bank, returning realistic responses, errors and timeouts, recorded from the vendors’ sandboxes.
- The strategy regression library: 2,000 historical applications, approved for this use by compliance, with direct identifiers removed and kept only in the restricted decisioning test environment.
- Each test creates its own data; shared environments are reset nightly. See test environments and test data.
Every quality scenario has a proof
Section titled “Every quality scenario has a proof”| Scenario | Test | Where and when |
|---|---|---|
| QS-01 Decision speed | Load test at 100 decisions per minute with virtual bureau latency | Performance environment, weekly |
| QS-02 Phone experience | Performance budget in the pipeline; real-user monitoring | Every build; production |
| QS-03 Availability | Synthetic journeys every minute; SLOs | Production |
| QS-04 Monday peak | Spike test to 3× with autoscaling observed | Performance environment, monthly |
| QS-05 No duplicates | Retry and redelivery tests; kill the funding consumer after processing, before acknowledging | Ephemeral environment, every pull request touching consumers |
| QS-06 Regional failure | Full failover rehearsal | Twice a year |
| QS-07 Explaining a decision | Retrieval drill on a random sample of old decisions | Quarterly, with compliance |
| QS-08 Changing policy | Strategy regression library | Every strategy change |
| QS-09 Access to credit data | Authorization tests per role and queue | Every commit |
| QS-10 Bureau outage | Fault injection: virtual bureau down for 30 minutes, then recovered | Weekly |
What this strategy caught
Section titled “What this strategy caught”- The parallel run (ADR-011) found two rule translation errors: a debt-to-income threshold applied with “greater than” instead of “greater than or equal”, and a missing exclusion for one state. Neither reached a customer.
- The crash-before-acknowledgement test found that the first version of the servicing adapter created a duplicate loan when it was restarted mid-batch. The fix: record processed event IDs in the same transaction as the call’s outcome.
- The bureau fault test showed queued decisions resumed in 4 minutes, well inside QS-10.
What isn’t tested, deliberately
Section titled “What isn’t tested, deliberately”- The servicing system’s internals. It’s unchanged (R-04); the adapter’s contract is what’s tested.
- Vendor production APIs under load. Vendors don’t allow it; virtual vendors stand in.
Related pages
Section titled “Related pages”Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.