Automated Self-Testing as a Quality Gate: Evidence-Driven Release Management for LLM Applications
Abstract
LLM applications are AI systems whose nondeterministic outputs and evolving model behavior make traditional testing insufficient for release governance. We present an automated self-testing framework that introduces quality gates with evidence-based release decisions (PROMOTE/HOLD/ROLLBACK) across five empirically grounded dimensions: task success rate, research context preservation, P95 latency, safety pass rate, and evidence coverage. We evaluate the framework through a longitudinal case study of an internally deployed multi-agent conversational AI system with specific marketing capabilities in active development, covering 38 evaluation runs across 20+ internal releases. The gate identified two ROLLBACK-grade builds in early runs and supported stable quality evolution over a four-week staging lifecycle while exercising persona-grounded, multi-turn, adversarial, and evidence-required scenarios. Statistical analysis (Mann-Kendall trends, Spearman correlations, bootstrap confidence intervals), gate ablation, and overhead scaling indicate that evidence coverage is the primary severe-regression discriminator and that runtime scales predictably with suite size. A human calibration study (n=60 stratified cases, two independent evaluators, LLM-as-judge cross-validation) reveals complementary multi-modal coverage: LLM-judge disagreements with the system gate (kappa=0.13) are attributable to structural failure modes - latency violations and routing errors - invisible in response text alone, while the judge independently surfaces content quality failures missed by structural checks, consistent with a multi-dimensional gate design. The framework, supplementary pseudocode, and calibration artifacts are provided to support AI-system quality assurance and independent replication.
Figures & tables
| Aspect | Ours | STELLAR | MA-Comm. |
|---|---|---|---|
| Primary goal | Release gating | Failure discovery | Bug detection |
| Quality dims. | 5D gate | Linguistic feats. | Persona diversity |
| Release decision | P/H/R | Failure set | Consensus vote |
| Evidence cov. | Formal dim. | Not addressed | Not addressed |
| Safety as dim. | ✓ | Partial (SafeQA) | Adversarial persona |
| CI/CD | Native | Offline | Offline |
| Dimension | Threshold | Direction |
|---|---|---|
| Task Success Rate | Higher | |
| Research Context Preservation | Higher | |
| P95 Latency | ms | Lower |
| Safety Pass Rate | Higher | |
| Evidence Coverage | Higher |
| Dimension | Automated signal | Scoring rule | Known limitation and mitigation |
|---|---|---|---|
| Task Success Rate | Per-test validation over route, semantic, and issue-free completion checks; consolidates task success and response utility | passed-tests / total-tests | Rubric-design sensitivity; mitigated by issue taxonomy, question-bank snapshots, and human calibration (Sec. 6 ) |
| Research Context Preservation | Multi-turn research tests with conversation history and expected research routing | context-preserved / research-tests-with-history | Saturates at 100% in stable periods (observed throughout this study); mitigated by harder follow-up injection |
| P95 Latency | End-to-end wall-clock latency per test from evaluator trace | 95th percentile (ms) | Inflated by suite growth and rate limits; mitigated by per-test runtime reporting |
| Safety Pass Rate | Adversarial/boundary behavior via guardrail routing and safety issue checks | safety-tests-passing / safety-tests | May miss novel attacks; mitigated by adversarial tier expansion and spot checks |
| Evidence Coverage | Retrieval-required tests with explicit citation signal in response text or source IDs | web-tests-with-evidence / web-tests | Citation heuristic can be gamed; mitigated by source-ID tracking and low-confidence audits |
| Aspect | U/I | E2E | Self-Test |
|---|---|---|---|
| Deterministic logic | ✓ | ✓ | – |
| API contracts | ✓ | ✓ | – |
| UI flow validation | – | ✓ | – |
| Hallucination detection | – | – | ✓ |
| Context preservation | – | – | ✓ |
| Safety alignment | – | – | ✓ |
| Run | Tests | Task Success | P95 (ms) | Context | Safety | Evidence | Decision |
|---|---|---|---|---|---|---|---|
| 1 | 59 | 100.0% | 8487 | 100% | 97.0% | 50% | ROLLBACK |
| 2 | 59 | 100.0% | 12316 | 100% | 97.0% | 50% | ROLLBACK |
| 3 | 59 | 98.3% | 7970 | 100% | 97.0% | 100% | PROMOTE |
| 4 | 13 | 100.0% | 11522 | 100% | 100.0% | 100% | PROMOTE |
| 5 | 59 | 100.0% | 9401 | 100% | 97.0% | 100% | PROMOTE |
| 6 | 13 | 100.0% | 12397 | 100% | 100.0% | 100% | PROMOTE |
| Scenario | Promote | Hold | Rollback | Sev. |
|---|---|---|---|---|
| Full 5D Gate | 36 | 0 | 2 | 0 |
| No Evidence Coverage | 38 | 0 | 0 | 2 |
| No Safety Dimension | 36 | 0 | 2 | 0 |
| Task Success + Latency Only | 38 | 0 | 0 | 2 |
| Traditional CI only (no behavioral gate) | 38 | 0 | 0 | 2 |
| TaskSR | P95 | Safety | Evid | |
|---|---|---|---|---|
| TaskSR | 1.00 | -0.47 ∗ | 0.16 | 0.02 |
| P95 | -0.47 ∗ | 1.00 | 0.03 | -0.27 |
| Safety | 0.16 | 0.03 | 1.00 | -0.20 |
| Evid | 0.02 | -0.27 | -0.20 | 1.00 |
| Metric | Mean | 95% CI |
|---|---|---|
| Task Success Rate (%) | 97.9 | [97.2, 98.6] |
| P95 Latency (ms) | 11542.3 | [10969.7, 12083.1] |
| Research Context Preservation (%) | 100.0 | [100.0, 100.0] |
| Safety Pass Rate (%) | 97.1 | [96.8, 97.4] |
| Evidence Coverage (%) | 96.4 | [92.3, 99.5] |
| Metric | Trend | p-value | Sig. | |
|---|---|---|---|---|
| Task Success Rate (%) | decreasing | -0.320 | 0.0038 | Yes |
| P95 Latency (ms) | increasing | 0.374 | 0.0010 | Yes |
| Research Context Preservation (%) | no trend | 0.000 | 1.0000 | No |
| Safety Pass Rate (%) | no trend | -0.132 | 0.2037 | No |
| Evidence Coverage (%) | no trend | -0.024 | 0.7306 | No |
| Metric | Mean | Med. | SD | Min | Max | IQR |
|---|---|---|---|---|---|---|
| Task Success | 97.9 | 98.4 | 2.2 | 91.5 | 100.0 | 3.6 |
| P95 Latency | 11542.3 | 11715.5 | 1769.3 | 7970.0 | 14631.0 | 1777.2 |
| Research Ctx. Pres. | 100.0 | 100.0 | 0.0 | 100.0 | 100.0 | 0.0 |
| Safety Pass | 97.1 | 97.0 | 1.0 | 96.0 | 100.0 | 0.0 |
| Evidence Coverage | 96.4 | 100.0 | 11.6 | 50.0 | 100.0 | 0.0 |
| Suite | Runs | Med. s | Med./Test ms | P95 ms |
|---|---|---|---|---|
| 13 | 2 | 61.1 | 4702.7 | 11960 |
| 50 | 1 | 191.9 | 3837.6 | 8915 |
| 59 | 9 | 241.1 | 4086.7 | 9850 |
| 83 | 3 | 548.5 | 6608.5 | 14331 |
| 86 | 9 | 409.6 | 4763.2 | 11393 |
| 88 | 4 | 391.0 | 4443.1 | 11604 |
| Comparison | N | Agree. | |
|---|---|---|---|
| Human Evaluator 1 vs 2 | 60 | 83.3% | 0.359 |
| LLM Judge vs System Gate | 60 | 63.3% | 0.132 |
| Human 1 vs System Gate | 60 | 66.7% | 0.167 |
| Human 2 vs System Gate | 60 | 63.3% | 0.000 |
| LLM Judge vs Human 1 | 60 | 80.0% | 0.444 |
| LLM Judge vs Human 2 | 60 | 73.3% | 0.149 |
Automated Evaluation
Automated evaluation develops metrics, benchmarks, and AI judges to assess model outputs and system behavior at scale.
See all 396 papers