team-24

Quality Requirement Tests

Each quality requirement test (QRT) is automated and runs in CI. Tests are stored in normal repository test locations and linked below.


QRT-01 — AI Backend Failure Returns HTTP 503

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:

CI: Runs as part of pytest src/backend/tests/ in the CI pipeline.


QRT-02 — Recommendation Endpoint Responds Within 500 ms

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.


QRT-03 — Invalid Inputs Are Rejected With Correct HTTP Status

Linked QR: QR-03 – Input Validation

Type: Automated integration tests (pytest + HTTPX TestClient)

Locations:

What it tests:

CI: Runs as part of pytest src/backend/tests/ in the CI pipeline.