AI Prompt (integration level)
Prompt
text
“Propose
integration test cases for how \[component A] interacts with \[component
B/service]. Include setup data, API contracts, dependency assumptions, and
validation points. Cover success, failure, and timeout scenarios.”
How to apply critical thinking
·
Understand the integration surface
·
What exact APIs/events/interfaces are used between
A and B?
·
What
are the guarantees on order, idempotency,
and eventual consistency?
·
Generate test cases for each interaction
·
Happy path: component A calls B with valid data; B responds as expected.
·
Contract mismatch: missing fields, versioned schemas,
optional vs required fields.
·
Failure modes:
B returns 4xx/5xx, malformed response, partial data.
·
Timeouts/retries: B is slow or unreachable; how does A behave?
·
Data consistency: verify that side effects (DB writes, messages)
are consistent across both components.
·
Questions on ambiguities
·
Who is the source
of truth for shared fields?
·
Expected behavior when one side is upgraded and the
other is not?
·
How long should A wait
before giving up on B?
·
What test ideas might be missed
·
Race conditions
when multiple A instances talk to B concurrently.
·
Integration behavior under partial outages (e.g.,
one region down).
·
Back-pressure
or throttling scenarios across components.
Output template (integration
testing)
Context: [component A, component B/service, integration style (REST, queue, db, event bus)]
Assumptions: [API version, auth mechanism, network reliability, contract stability]
Test Types: [integration]
Test Cases:
ID: [TC-IT-001]
Type: [integration]
Title: [e.g., "A saves order when B confirms payment"]
Preconditions/Setup:
- [Deploy A+B in test env]
- [Seed DBs or queues]
- [Configure stubs only for external systems, not between A and B]
Steps:
1. [Trigger A via API/event]
2. [A calls B as part of flow]
Variations:
- [B returns success]
- [B returns 4xx, 5xx]
- [B times out]
Expected Results:
- [A’s behavior: commit/rollback, messages emitted, logs, metrics]
Cleanup:
- [Clear DB, queues, reset configs]
Coverage notes:
- [Which integration paths and contracts are validated; untested paths]
Non-functionals:
- [Latency expectations across A↔B, retry limits]
Data/fixtures:
- [Shared IDs, domain objects, schema versions]
Environments:
- [Integration env with A+B only; prod-like configs]
Ambiguity Questions:
- [Ownership of fields, error-handling strategy, retry/backoff policy]
Potential Missed Ideas:
- [Multi-instance interactions, failover, schema evolution tests]