Each quality requirement test (QRT) is automated and runs in CI. Tests are stored in normal repository test locations and linked below.
Linked QR: QR-01 – Fault Tolerance
Type: Automated integration test
Location: src/backend/tests/test_ai_service.py
What it tests:
Mocks the OpenAI client to raise a connection error, then calls POST /display/recommendations.
Asserts that:
detail field (e.g. "AI service unavailable")CI: Runs as part of pytest src/backend/tests/ in the CI pipeline.
Linked QR: QR-02 – Response Time
Type: Automated performance test (pytest + time module)
Location: src/backend/tests/test_response_time.py
What it tests:
Sends a POST request to /display/recommendations with stub backend active.
Records wall-clock time before and after the call.
Asserts that elapsed time is less than 500 ms.
CI: Runs as part of pytest src/backend/tests/ in the CI pipeline.
Uses AI_BACKEND=stub to avoid network I/O.
Linked QR: QR-03 – Input Validation
Type: Automated integration tests (pytest + HTTPX TestClient)
Locations:
src/backend/tests/test_history_router.py — blank dish name → HTTP 422, missing X-User-Id header → HTTP 400src/backend/tests/test_budget_filter.py — negative budget filtered correctlyWhat it tests:
/history/orders with name: "" → must return HTTP 422/history/orders without X-User-Id header → must return HTTP 400max_budget=-5 → must return empty list (no crash)CI: Runs as part of pytest src/backend/tests/ in the CI pipeline.