AI Evaluation and Quality Engineering A developer published a deep-dive guide on evaluation and quality engineering for LLM applications, arguing that teams should treat evaluation as the test suite of a probabilistic system rather than shipping on vibes. The guide covers golden datasets, exact-match and semantic-similarity scoring, faithfulness and groundedness, answer relevance, context precision and recall, hallucination detection, RAG evaluation, LLM-as-a-judge, human evaluation, prompt regression and adversarial testing, model comparison, and evaluation pipelines in CI/CD, with C# code using Microsoft.Extensions.AI, IChatClient, IEmbeddingGenerator and xUnit. It recommends building the dataset first, choosing the cheapest reliable metric per behavior, validating model-based metrics against human judgment, and gating quality in CI. A deep-dive walkthrough of measuring and protecting the quality of LLM applications — covering golden datasets, test cases for LLMs, exact-match evaluation, semantic similarity, faithfulness and groundedness, answer relevance, context precision and recall, hallucination detection, RAG evaluation, LLM-as-a-judge, human evaluation, regression testing for prompts, adversarial testing, model comparison, and evaluation pipelines in CI/CD. Traditional software has a comfortable contract: given the same input, the function returns the same output, so a unit test can assert equality and move on. LLM applications break that contract in three ways at once. The output is open-ended many different answers can be correct , the output is variable the same prompt can produce different text on different runs , and the quality is multidimensional an answer can be fluent but wrong, correct but unhelpful, helpful but unsafe, or grounded but irrelevant . Teams that ignore this ship on vibes. They try five prompts by hand, the answers look good, and the feature goes live. Then a prompt tweak fixes one complaint and silently breaks three other behaviors, a model upgrade changes the tone, and nobody can say whether the system got better or worse because nothing was ever measured. VIBES-BASED DEVELOPMENT EVALUATION-DRIVEN DEVELOPMENT "I tried it on a few examples and it looked fine" a versioned dataset of representative cases with expected behavior change the prompt, eyeball the result every change runs against the dataset; scores are compared to the last baseline quality = a feeling quality = named metrics with thresholds, trends, and confidence intervals regressions found by customers regressions found by CI, before merge model upgrade = a gamble model upgrade = a measured comparison on quality, cost, and latency one number "accuracy" a scorecard: correctness, faithfulness, relevance, safety, latency, cost The thesis of this guide, in one line: treat evaluation as the test suite of a probabilistic system — build the dataset first, choose the cheapest reliable metric for each behavior, validate any model-based metric against human judgment, and wire it all into CI so that quality is a gate, not a hope. This guide builds on Microsoft.Extensions.AI , RAG , AI Agents , AI Security , and AI Observability ; it avoids repeating them and goes deeper on measurement. Code uses C , IChatClient and IEmbeddingGenerator from Microsoft.Extensions.AI , xUnit, and, where relevant, the Microsoft.Extensions.AI.Evaluation libraries. A note on versions and tools. The evaluation tooling landscape moves quickly: the Microsoft.Extensions.AI.Evaluation packages quality, safety, and reporting evaluators , Azure AI Foundry's evaluation services, and open-source frameworks such as RAGAS, DeepEval, promptfoo, TruLens, and OpenAI Evals all evolve their APIs and metric definitions. The principles, metric definitions, and statistical practices here are the durable part. Verify package names, evaluator names, and API shapes against current documentation, and treat the code as templates. Thresholds shown are starting points to calibrate against your own data and human judgments. A golden dataset also called a gold set, eval set, or benchmark is a curated collection of inputs paired with whatever you need to judge outputs: reference answers, expected behaviors, required facts, source documents, or labels. Everything else in this guide metrics, judges, CI gates is only as good as this dataset. Prompts and models change monthly; a good dataset keeps its value for years. A GOOD EVAL CASE ANSWERS: "What should a correct, safe, helpful response to this input look like?" It need not contain one exact string. It may contain: - a reference answer - facts that MUST appear - facts that MUST NOT appear - the source passages that support the answer - expected tool calls and arguments - a category label for routing/classification - a rubric for a judge - an expected behavior "refuse", "ask a clarifying question", "answer with citation" public sealed record EvalCase { public required string Id { get; init; } // stable, never reused: "refund-window-017" public required string Input { get; init; } // the user question or task or a full message list public string? ReferenceAnswer { get; init; } // an example of a good answer not the only good answer public IReadOnlyList