AI quality engineering
AI Testing Lab
Work through realistic AI-system failures before opening the evidence-based solution. Progress follows your account when signed in.
Lab completion
Mark a task complete only after you can explain the test oracle, evidence, and release decision.
Build a versioned prompt regression gate
A support-answer prompt changes weekly. Build a gate that catches factual, refusal, and format regressions without exact-string assertions.
Setup
You have 40 reviewed cases with required facts, forbidden claims, and a JSON response contract.
- 1Define case-level rubrics and hard contracts
- 2Run each case repeatedly against the candidate prompt
- 3Aggregate pass rates with confidence bounds
- 4Block only on agreed safety and quality thresholds
Keep schema checks deterministic
Version the prompt, model, dataset, and evaluator together
Isolate retrieval from generation failures
A policy assistant gives a wrong answer. Design diagnostics that identify whether retrieval, context assembly, or generation failed.
Setup
The system exposes retrieved document IDs, ranked chunks, assembled context, citations, and final response.
- 1Create evidence-labeled queries
- 2Measure retrieval recall and ranking separately
- 3Verify context retention and access filters
- 4Evaluate groundedness and answer completeness
A good answer with the wrong evidence is still a failure
Include unanswerable and permission-restricted cases
Create a contract-faithful LLM test double
Unit tests are slow and flaky because every orchestration test calls a hosted model. Replace it without pretending mocks prove model quality.
Setup
The application supports structured outputs, tool calls, refusals, rate limits, and streamed text.
- 1Model the provider boundary
- 2Create fixtures for every response class
- 3Simulate malformed and partial streams
- 4Keep separate live-model evaluations
Mock protocol behavior, not intelligence
Include ordering and duplicate-event cases
Red-team indirect prompt injection in RAG
An indexed document contains instructions telling the assistant to reveal secrets and ignore access controls.
Setup
The assistant retrieves internal documents and can call read-only account tools.
- 1Create direct and indirect injection payloads
- 2Vary payload placement and encoding
- 3Assert authorization outside the model
- 4Verify safe refusal and audit evidence
Retrieved text is untrusted data
A prompt instruction is not an authorization boundary
Detect PII leakage across prompts, traces, and outputs
A test-data generator uses support tickets. Prove that personal data is not sent, logged, or reproduced.
Setup
Synthetic tickets include names, emails, phone numbers, account IDs, and canary secrets.
- 1Map every data sink
- 2Inject unique canaries
- 3Inspect outbound requests and telemetry
- 4Test output memorization and deletion paths
Redaction after logging is too late
Regex alone misses contextual identifiers
Test structured output and tool-call contracts
An agent creates invalid tool arguments and occasionally repeats a payment-side effect after a retry.
Setup
The orchestration layer validates JSON Schema and requires approval for mutating tools.
- 1Generate valid and invalid argument boundaries
- 2Test unknown and missing fields
- 3Simulate retries and duplicate call IDs
- 4Assert approval and idempotency rules
Validation must happen before execution
The model is not trusted to guarantee exactly-once behavior
Enforce quality, latency, and cost budgets
A release improves answer quality but doubles p95 latency and triples token cost. Build a balanced release gate.
Setup
You have per-request token usage, model latency, end-to-end latency, cache status, and quality scores.
- 1Define service-level indicators
- 2Segment by request class
- 3Compare baseline and candidate
- 4Set hard safety gates and negotiated performance budgets
Averages hide tail latency
Cache hits and misses need separate reporting
Detect model, data, and behavior drift
Quality drops slowly after knowledge updates and provider model changes. Design monitoring that detects drift without logging sensitive prompts.
Setup
The platform records version IDs, privacy-safe features, evaluation outcomes, user corrections, latency, and costs.
- 1Separate drift types
- 2Create stable canary evaluations
- 3Monitor production slices
- 4Define alert and rollback policy
A provider alias can change behavior
Aggregate quality can hide one damaged customer segment
Cluster automation failures without hiding root causes
A regression run produces 600 failures. Use AI-assisted triage while preserving evidence and human accountability.
Setup
Artifacts include stack traces, normalized errors, test metadata, screenshots, DOM snapshots, and deployment changes.
- 1Normalize deterministic signatures
- 2Cluster with explainable evidence
- 3Summarize each cluster
- 4Measure assignment precision and analyst correction
Start with deterministic grouping
Never let a summary replace source artifacts
Review AI-generated tests before merge
A coding assistant produces 30 passing UI tests. Build a review checklist that prevents false confidence and maintenance debt.
Setup
Generated tests compile and pass against the current environment but were not reviewed for intent or fault detection.
- 1Trace every test to a risk or requirement
- 2Inspect assertions and negative paths
- 3Mutation-check important tests
- 4Review isolation, data, waits, locators, and ownership
Passing is not evidence the test can fail correctly
Count unique risks, not generated test methods
Design metamorphic tests for variable answers
There is no single expected wording for a summarizer. Define transformations whose relationships should still hold.
Setup
The summarizer must preserve facts, ignore formatting noise, respect requested language, and omit irrelevant boilerplate.
- 1Choose valid input transformations
- 2Define expected output relations
- 3Run repeated trials
- 4Investigate relation violations with source evidence
Do not assume every paraphrase is semantically identical
Some transformations legitimately change emphasis
Design an enterprise AI quality architecture
Multiple teams are shipping assistants with inconsistent prompts, evaluations, traces, and release criteria.
Setup
Products differ in risk, data sensitivity, model provider, retrieval stack, and deployment cadence.
- 1Define shared contracts and evidence
- 2Provide reusable evaluation infrastructure
- 3Allow risk-tier policy profiles
- 4Create ownership and incident workflows
Central standards should not force one prompt framework
High-risk actions need stronger controls than summarization