Modern QA2026Template: The Complete Claude Code Session — tiles
Log inJoin
67 / 87 · 02 AI-Augmented Test Design · Claude Code Workflow: Spec-to-Suite← prev⊞ allnext →☰ Read as one page

10.5Template: The Complete Claude Code Session

Here is a complete session template you can adapt for any feature:

# 1. Reconnaissance
claude "Read app/routes/orders.py and docs/openapi.yaml (the /orders section).
Summarize: how many endpoints, what methods, what auth is required,
what fields are validated."

# 2. Style reference
claude "Read tests/test_users.py. Note the patterns:
- How fixtures are used
- How auth headers are set up
- The naming convention for test functions
- How parametrize is used
You will follow these patterns exactly."

# 3. Generation
claude "Generate a comprehensive test suite for the orders endpoints.
Cover:
- All documented success responses
- All documented error responses (4xx)
- Boundary values for quantity (1, 100, 0, 101, -1)
- Boundary values for price fields
- Auth: valid token, expired token, missing token, wrong role
- Idempotency: same request twice with same idempotency key
Save to tests/test_orders.py"

# 4. Execution + fix
claude "Run pytest tests/test_orders.py -v --tb=long.
Fix any test bugs (import errors, fixture issues, setup problems).
Do NOT weaken assertions. Report any real application bugs separately."

# 5. Coverage analysis
claude "Run pytest tests/test_orders.py --cov=app.routes.orders
--cov-report=term-missing. Generate additional tests for uncovered lines.
Add them to the same file."

# 6. Flaky check
claude "Run pytest tests/test_orders.py --count=3 -v.
If any test fails inconsistently, identify the cause and fix it.
Common causes: time dependency, random data, database state."

# 7. Final review
claude "Review all tests in tests/test_orders.py. For each test, ask:
would this test fail if the feature was broken? Flag any tautology tests
(tests that pass regardless of implementation correctness)."