Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

pi/agent/skills/testing/references/integration-testing.md

Raw
Rendered preview

Integration testing

Related labels: module/component, API/service, contract, artifact-consumption, system, end-to-end. Identify real collaborations, doubles, and consumer contracts; labels are not interchangeable.

  • Prefer representative consumer workflows over duplicated helper checks.
  • Exercise connected modules/APIs with real inputs, outcomes, relevant failures and side effects.
  • Test delivered artifacts: load, install, parse, link, or invoke built output in a representative consumer environment. Source-workspace success does not prove package resources are present or usable.
  • Doubles remove confidence in the replaced interaction. Establish fidelity through existing contracts or representative real integration where required.
  • Narrow integration can be fast; live services and full-stack environments are not prerequisites.
  • Keep expensive broad journeys few and focused, not giant opaque scenarios.
  • Keep cheap tests for distinct combinatorial logic and edge cases.
  • Amortize setup only where isolation, deterministic state, independence, and cleanup survive. Reuse project tiers and selectors.

During curation, consolidate helper checks into consumer scenarios only when failure protection remains. Check doubles, resources, serialization, and side effects before inferring confidence from green results. Judge confidence, speed, maintenance, and diagnosis together; no universal ratio.

Sources

# Integration testing

Related labels: module/component, API/service, contract, artifact-consumption, system, end-to-end.
Identify real collaborations, doubles, and consumer contracts; labels are not interchangeable.

- Prefer representative consumer workflows over duplicated helper checks.
- Exercise connected modules/APIs with real inputs, outcomes, relevant failures and side effects.
- Test delivered artifacts: load, install, parse, link, or invoke built output in a representative consumer environment.
  Source-workspace success does not prove package resources are present or usable.
- Doubles remove confidence in the replaced interaction.
  Establish fidelity through existing contracts or representative real integration where required.
- Narrow integration can be fast; live services and full-stack environments are not prerequisites.
- Keep expensive broad journeys few and focused, not giant opaque scenarios.
- Keep cheap tests for distinct combinatorial logic and edge cases.
- Amortize setup only where isolation, deterministic state, independence, and cleanup survive.
  Reuse project tiers and selectors.

During curation, consolidate helper checks into consumer scenarios only when failure protection remains.
Check doubles, resources, serialization, and side effects before inferring confidence from green results.
Judge confidence, speed, maintenance, and diagnosis together; no universal ratio.

## Sources

- [Write tests. Not too many. Mostly integration.](https://kentcdodds.com/blog/write-tests)
- [Testing Trophy: application/UI context and interpretation](https://kentcdodds.com/blog/the-testing-trophy-and-testing-classifications)
- [Fowler: narrow and broad integration](https://martinfowler.com/bliki/IntegrationTest.html)