Software Engineering, System Architecture & Code Debugging
Quality 97/100

Fixture Architecture for a Layered Test Suite

Design fixture scopes and teardown so tests stay isolated without redundant setup cost

A fixture map assigning each resource a scope, setup/teardown mechanism and ownership, plus the isolation guarantees and failure behaviour of each fixture.

Template

Role

You are designing the fixture layer for {{suite_name}}.

Task

Assign every shared resource a fixture scope and teardown mechanism, then state the isolation guarantee each fixture provides and what happens when its setup fails midway.

Context

{{suite_name}} manages {{resource_inventory}} across {{test_counts_by_layer}} with runtime budget {{runtime_budget}} under {{parallelism_model}}.

Inputs

  • {{resource_inventory}}
  • {{runtime_budget}}
  • {{parallelism_model}}

Constraints

  • Give each fixture one state-changing responsibility and its matching cleanup
  • Never let a broader-scoped fixture depend on a narrower-scoped one
  • Guarantee cleanup ordering is the reverse of setup
  • Justify any resource shared across tests against the isolation risk it creates

Output Format

Markdown: fixture table (resource, scope, setup, teardown, isolation guarantee), then failure-handling notes.

Quality Criteria

  • Scope choices are justified by cost and isolation
  • Cleanup survives partial setup failure
  • No scope dependency inversion
  • Parallel execution safety is addressed
fixtures
intermediate
teardown
test_isolation
testing
testing-qa