<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Martina Stojmanovska</title>
    <description>The latest articles on DEV Community by Martina Stojmanovska (@martina_stojmanovska).</description>
    <link>https://dev.to/martina_stojmanovska</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266396%2F76b084c2-269e-41cb-bd77-6d65f3476f5e.jpg</url>
      <title>DEV Community: Martina Stojmanovska</title>
      <link>https://dev.to/martina_stojmanovska</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/martina_stojmanovska"/>
    <language>en</language>
    <item>
      <title>AI Testing and LLM Evaluation: A Practical Guide for Production Teams</title>
      <dc:creator>Martina Stojmanovska</dc:creator>
      <pubDate>Fri, 27 Nov 2026 09:23:12 +0000</pubDate>
      <link>https://dev.to/testdevlab/ai-testing-and-llm-evaluation-a-practical-guide-for-production-teams-7nd</link>
      <guid>https://dev.to/testdevlab/ai-testing-and-llm-evaluation-a-practical-guide-for-production-teams-7nd</guid>
      <description>&lt;p&gt;AI testing and LLM evaluation is the practice of measuring whether an AI feature behaves correctly, safely, and consistently, using automated checks, statistical scoring, and human review together. An LLM can return a different answer to the same input, so a passing HTTP 200 tells you very little about quality. Learn the five layers to test, how to build a release gate, how to check an AI agent's tool calls with working Python, and how to choose an AI testing partner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why conventional tests miss AI failures
&lt;/h2&gt;

&lt;p&gt;A conventional test asserts that a known input produces a known output. LLM-powered features break that assumption in three ways: outputs vary between runs, correctness depends on context the test never sees, and failures often look like success.&lt;/p&gt;

&lt;p&gt;Take a support assistant that answers questions from a policy library. A request returns HTTP 200 in under a second, the JSON matches the schema, and the answer reads well, so the test passes. Yet the assistant may have retrieved last year's refund policy, cited a document it never retrieved, or surfaced content the user was not allowed to see. None of that shows up in a status code.&lt;/p&gt;

&lt;p&gt;This is why AI testing combines three kinds of checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic checks&lt;/strong&gt; for schemas, permissions, and tool arguments, which have exact right answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Statistical evaluation&lt;/strong&gt; for relevance and groundedness, scored across a dataset instead of a single run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human review&lt;/strong&gt; for ambiguous, high-risk, or domain-specific outputs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rest of this guide splits &lt;a href="https://www.testdevlab.com/blog/how-to-test-llm-apps" rel="noopener noreferrer"&gt;LLM evaluation&lt;/a&gt; work across layers so every failure has a clear owner.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you evaluate an LLM application? Test five layers separately
&lt;/h2&gt;

&lt;p&gt;A wrong answer can come from several places, so test each layer on its own before judging the final response.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Question it answers&lt;/th&gt;
&lt;th&gt;Example checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Does the model handle our tasks well enough?&lt;/td&gt;
&lt;td&gt;Accuracy on a task-specific dataset, instruction following, structured output reliability, robustness to rephrased inputs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval&lt;/td&gt;
&lt;td&gt;Did the system fetch the right documents, and only permitted ones?&lt;/td&gt;
&lt;td&gt;Recall@K, precision@K, metadata filter accuracy, document freshness, permission enforcement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generation&lt;/td&gt;
&lt;td&gt;Is the answer correct and supported by its sources?&lt;/td&gt;
&lt;td&gt;Answer correctness, groundedness, citation accuracy, completeness, appropriate refusals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent actions&lt;/td&gt;
&lt;td&gt;Did the agent do the right thing in connected systems?&lt;/td&gt;
&lt;td&gt;Tool selection, argument validity, step order, authorization, retries, duplicate prevention, final system state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operations&lt;/td&gt;
&lt;td&gt;Does it hold up under real traffic and change?&lt;/td&gt;
&lt;td&gt;P95 latency, error and timeout rates, cost per successful task, score drift across versions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two practical rules follow from this table.&lt;/p&gt;

&lt;p&gt;First, evaluate retrieval and generation separately. If a RAG answer is wrong and you only score the final text, you may blame the model for a retrieval filter bug and fix the wrong component.&lt;/p&gt;

&lt;p&gt;Second, build your evaluation dataset from your own documents, terminology, and past incidents. Public benchmarks compare general model ability, but they know nothing about your refund policy, your clinical vocabulary, or your permission model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a repeatable LLM evaluation pipeline
&lt;/h2&gt;

&lt;p&gt;A useful LLM evaluation framework runs the same versioned dataset against every release candidate, then decides automatically whether the change can ship.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Versioned evaluation dataset
            |
            v
Application under test --&amp;gt; execution traces
            |
            +--&amp;gt; deterministic checks (schemas, permissions, tool calls)
            +--&amp;gt; semantic evaluation (relevance, groundedness)
            |
            v
Human review for flagged or high-risk cases
            |
            v
Release gate: pass = deploy, fail = investigate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rerun the suite whenever something that shapes model behavior changes. Different changes break different things, so match the checks to the change:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What changed&lt;/th&gt;
&lt;th&gt;What to re-check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt&lt;/td&gt;
&lt;td&gt;Correctness, instruction following, known regression cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model version&lt;/td&gt;
&lt;td&gt;Accuracy, structured output validity, latency, cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval settings or embedding model&lt;/td&gt;
&lt;td&gt;Retrieval relevance, permission filtering, citation quality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool or API&lt;/td&gt;
&lt;td&gt;Argument validity, authorization, retries, recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data refresh&lt;/td&gt;
&lt;td&gt;Document freshness, retrieval recall on the updated content&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Write the release gate as a rule
&lt;/h3&gt;

&lt;p&gt;A good gate has two parts. A relative rule blocks any release whose key scores fall more than a small tolerance below an approved baseline, for example groundedness dropping by more than two points. Absolute hard stops allow no exceptions, such as any unauthorized action in a test run. Set the numbers from business risk, dataset coverage, and statistical uncertainty, because there are no industry standards to copy. Also remember that zero security failures in a test set does not prove they cannot happen in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI agent evaluation: Check an agent's tool calls
&lt;/h2&gt;

&lt;p&gt;An agent can write a confident final message while calling the wrong tool, skipping an approval, or refunding the same order twice. The final text will not show any of that, so inspect the trace of tool calls directly.&lt;/p&gt;

&lt;p&gt;The harness below checks a refund agent against three rules: lookup before refund, valid arguments within a limit, and no duplicate refunds.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_agent_trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Return violations. An empty list means the trace passed."""&lt;/span&gt;
    &lt;span class="n"&gt;violations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"issue_refund"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c1"&gt;# 1. Order: look up the order before any refund&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="s2"&gt;"lookup_order"&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"issue_refund"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;violations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"refund issued before order lookup"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 2. Arguments: valid amount, and approval above the limit&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;violations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"invalid refund amount: {amount!r}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"approved_by"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;violations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"refund over 100 without approval"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 3. Duplicates: one refund per order&lt;/span&gt;
    &lt;span class="n"&gt;order_ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;violations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"duplicate refund for the same order"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;violations&lt;/span&gt;


&lt;span class="n"&gt;trace&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"lookup_order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"A-1042"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"issue_refund"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"A-1042"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"issue_refund"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"A-1042"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"approved_by"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"mgr-7"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;check_agent_trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['refund over 100 without approval', 'duplicate refund for the same order']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first refund broke the approval rule, and the second repeated an order that was already refunded. A plain "did the agent finish?" check would have marked this run as a success.&lt;/p&gt;

&lt;p&gt;Trace checks catch process failures. Pair them with a state check that queries the real system afterward, such as the refunds table, because an agent can report success without completing the job. Run the harness across a dataset of scenarios that includes missing lookups, oversized refunds, and interrupted workflows, then score the broader &lt;a href="https://www.testdevlab.com/blog/ai-agent-evaluation-metrics-benchmarks-methods" rel="noopener noreferrer"&gt;AI agent evaluation&lt;/a&gt; dimensions, such as task success, efficiency, and recovery, alongside the trace checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use LLM-as-a-judge without fooling yourself
&lt;/h2&gt;

&lt;p&gt;LLM-as-a-judge means asking one model to score another model's output against a rubric. It scales review of relevance, groundedness, and completeness, but judges have known weaknesses. They can favor longer answers, give inconsistent scores, and follow instructions hidden inside the text they are grading.&lt;/p&gt;

&lt;p&gt;Several habits keep a judge trustworthy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write an explicit rubric with defined score levels instead of asking for a general quality rating.&lt;/li&gt;
&lt;li&gt;Keep reference material separate from judge instructions, and treat the answer under review as untrusted input.&lt;/li&gt;
&lt;li&gt;Calibrate against a human-labeled sample, and track how often the judge agrees with it over time.&lt;/li&gt;
&lt;li&gt;Randomize answer order in pairwise comparisons.&lt;/li&gt;
&lt;li&gt;Repeat runs where score variance matters.&lt;/li&gt;
&lt;li&gt;Re-check the judge after every model update.&lt;/li&gt;
&lt;li&gt;Send low-confidence and high-risk cases to a person.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  LLM evaluation metrics worth tracking
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Formula&lt;/th&gt;
&lt;th&gt;Watch for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval recall&lt;/td&gt;
&lt;td&gt;Relevant documents retrieved ÷ known relevant documents&lt;/td&gt;
&lt;td&gt;Needs reliable relevance labels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Groundedness&lt;/td&gt;
&lt;td&gt;Claims supported by sources ÷ total claims&lt;/td&gt;
&lt;td&gt;Document the scoring method and scale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema validity rate&lt;/td&gt;
&lt;td&gt;Valid structured responses ÷ attempts&lt;/td&gt;
&lt;td&gt;A valid format does not mean correct content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task completion rate&lt;/td&gt;
&lt;td&gt;Tasks with the verified expected outcome ÷ tasks evaluated&lt;/td&gt;
&lt;td&gt;Verify real system state, not the agent's claim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unauthorized action rate&lt;/td&gt;
&lt;td&gt;Prohibited operations executed ÷ attempts&lt;/td&gt;
&lt;td&gt;Treat as a hard stop, not an average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost per successful task&lt;/td&gt;
&lt;td&gt;Total run cost ÷ successful tasks&lt;/td&gt;
&lt;td&gt;Include retries, retrieval, and human review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Regression rate&lt;/td&gt;
&lt;td&gt;Previously passing cases now failing ÷ previously passing cases&lt;/td&gt;
&lt;td&gt;Aggregate scores can hide it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Eight LLM failure scenarios to test before launch
&lt;/h2&gt;

&lt;p&gt;Each scenario below pairs a setup with the behavior you should verify. Teams that go further run &lt;a href="https://www.testdevlab.com/blog/ai-red-teaming" rel="noopener noreferrer"&gt;AI red teaming&lt;/a&gt; exercises, and the &lt;a href="https://www.nist.gov/itl/ai-risk-management-framework" rel="noopener noreferrer"&gt;NIST AI Risk Management Framework&lt;/a&gt; and the OWASP list in scenario four give a wider risk taxonomy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Irrelevant retrieval.&lt;/strong&gt; Ask questions where the retriever returns unrelated documents. Verify the app does not build an answer from them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing knowledge.&lt;/strong&gt; Ask something the sources cannot answer. Verify the app says it lacks the information instead of guessing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unauthorized access.&lt;/strong&gt; Create test users with different permissions and request restricted documents. Verify restricted content never reaches the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indirect prompt injection.&lt;/strong&gt; Plant adversarial instructions inside synthetic retrieved documents. Verify the app treats them as data and does not obey them. The &lt;a href="https://genai.owasp.org/llm-top-10/" rel="noopener noreferrer"&gt;OWASP Top 10 for LLM applications&lt;/a&gt; is a useful catalog of attack categories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Invalid tool arguments.&lt;/strong&gt; Simulate tool calls with missing fields or out-of-range values. Verify validation blocks execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate execution.&lt;/strong&gt; Interrupt a workflow after an external system has already committed an action, then retry. Verify the retry causes no duplicate business effect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provider timeout.&lt;/strong&gt; Cut off a model request or simulate an outage. Verify retry limits, fallbacks, and recovery behave as designed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regression after an update.&lt;/strong&gt; Change a prompt, model version, or retrieval setting, then rerun the suite against the approved baseline. Verify that no previously passing case now fails.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  LLM evaluation tools: Open-source and commercial options
&lt;/h2&gt;

&lt;p&gt;Tools run your tests, but they do not decide what "good" means for your product. Pick based on your stack, hosting needs, and how much of the pipeline you want to own.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://barkoagent.com/" rel="noopener noreferrer"&gt;BarkoAgent&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;AI-assisted test generation and execution on your own infrastructure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/confident-ai/deepeval" rel="noopener noreferrer"&gt;DeepEval&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Python-native LLM unit tests and metrics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/explodinggradients/ragas" rel="noopener noreferrer"&gt;Ragas&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Evaluating RAG retrieval and answer quality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.promptfoo.dev/docs/" rel="noopener noreferrer"&gt;Promptfoo&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Config-driven prompt comparison, regression tests, and adversarial checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/Arize-ai/phoenix" rel="noopener noreferrer"&gt;Arize Phoenix&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Open-source tracing and evaluation of LLM applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.langchain.com/langsmith/home" rel="noopener noreferrer"&gt;LangSmith&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Tracing, datasets, and experiments for LLM apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.braintrust.dev/docs" rel="noopener noreferrer"&gt;Braintrust&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Experiments, datasets, scoring, and production feedback&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How to choose AI testing services: In-house or a partner
&lt;/h2&gt;

&lt;p&gt;Building in-house usually works when one team owns the product, the failure modes are well understood, and you already have engineers who can build datasets and harnesses. A partner tends to help when you need independent evidence for procurement or compliance, when the workload spikes around a launch or a model migration, or when you lack reviewers with domain expertise. The two also combine well: your team runs the continuous suite while an outside party performs periodic independent assessments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Criteria for comparing AI testing providers
&lt;/h3&gt;

&lt;p&gt;The weights you give these depend on your product, so treat the list as a starting point.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;What to look for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AI evaluation expertise&lt;/td&gt;
&lt;td&gt;Understanding of retrieval, groundedness, agents, and judge calibration, beyond functional testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relevant experience&lt;/td&gt;
&lt;td&gt;Comparable products and industries, shown through sample reports or anonymized case studies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation and CI/CD fit&lt;/td&gt;
&lt;td&gt;Repeatable suites that run inside your pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security testing&lt;/td&gt;
&lt;td&gt;Prompt injection, data exposure, and authorization checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Methodology&lt;/td&gt;
&lt;td&gt;Dataset design, rubrics, metric selection, and reproducibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Human review&lt;/td&gt;
&lt;td&gt;Reviewer qualifications, consistency, and how disagreements are resolved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reporting and remediation&lt;/td&gt;
&lt;td&gt;Reproducible evidence, failure classification, and prioritized fixes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Questions to ask before you sign
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Have you evaluated production LLM products similar to ours?&lt;/li&gt;
&lt;li&gt;How do you build representative datasets, and who owns them afterward?&lt;/li&gt;
&lt;li&gt;Do you evaluate retrieval and generation separately?&lt;/li&gt;
&lt;li&gt;Can you test multi-step agent execution, including the resulting system state?&lt;/li&gt;
&lt;li&gt;How do you calibrate automated judges against human review?&lt;/li&gt;
&lt;li&gt;Can your suite keep running in our CI/CD pipeline after the engagement ends?&lt;/li&gt;
&lt;li&gt;How do you test prompt injection and permission boundaries?&lt;/li&gt;
&lt;li&gt;How do you report uncertainty and the limits of your results?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ask for a sample report and a proposed methodology instead of general assurances about accuracy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common mistakes when outsourcing LLM evaluation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Scoring only the final answer, which hides retrieval, tool, and permission failures.&lt;/li&gt;
&lt;li&gt;Relying on an automated judge that was never calibrated against human review.&lt;/li&gt;
&lt;li&gt;Using generic benchmarks instead of your own workload.&lt;/li&gt;
&lt;li&gt;Testing security only through prompts, when authentication, data isolation, and tool permissions need their own tests.&lt;/li&gt;
&lt;li&gt;Leaving datasets, rubrics, and scripts with the vendor, so regression testing stops when the engagement ends.&lt;/li&gt;
&lt;li&gt;Treating evaluation as a one-time event instead of a check on every prompt, model, or data change.&lt;/li&gt;
&lt;li&gt;Mixing up testing and remediation, without deciding who fixes defects and who retests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What our work on non-AI products taught us about evaluating AI
&lt;/h2&gt;

&lt;p&gt;LLM evaluation is new, but the discipline behind it is not. Three of our engagements, on products with no language model at their core, show habits that this guide recommends.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.testdevlab.com/content-library/case-studies/whereby-audio-video-performance-benchmark" rel="noopener noreferrer"&gt;Whereby&lt;/a&gt;:&lt;/strong&gt; an independent benchmark of audio quality, video quality, bitrate recovery, and CPU, GPU, and memory use under constrained bandwidth and packet loss. It combined objective metrics with perceptual analysis and ended with a data-driven framework for ongoing monitoring, much as a calibrated judge and human review work together in LLM evaluation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.testdevlab.com/content-library/case-studies/indexo-banking-system-performance-testing" rel="noopener noreferrer"&gt;INDEXO&lt;/a&gt;:&lt;/strong&gt; load tests built on an existing automated suite, then rerun after a move to new infrastructure to confirm nothing had degraded. The same logic applies to evaluation: keep the dataset and scripts so you can rerun them whenever a model, prompt, or retrieval setting changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.testdevlab.com/content-library/case-studies/bondzai-reliability-functionality-improvement" rel="noopener noreferrer"&gt;Bondzai&lt;/a&gt;:&lt;/strong&gt; an edge AI company whose SDKs lacked unit and functional test coverage. We added Pytest unit tests and a demo application for UI automation, a reminder that the code around a model deserves deterministic tests too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these involved evaluating an LLM, but the habits carry over: measure with more than one lens, keep the suite so it can run again, and test the deterministic parts deterministically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start small and gate every release
&lt;/h2&gt;

&lt;p&gt;Production AI quality comes down to a few habits: test each layer separately, check actions and system state instead of trusting the final message, gate releases against an approved baseline, and keep a person in the loop where the stakes are high.&lt;/p&gt;

&lt;p&gt;Start small. Pick a few dozen scenarios drawn from real incidents and support tickets, add a trace checker like the one above, and write a release gate that blocks regressions. Expand coverage as each failure shows you what the suite was missing.&lt;/p&gt;

&lt;p&gt;If you are comparing providers or tools, our roundups of the &lt;a href="https://www.testdevlab.com/blog/best-ai-testing-tools" rel="noopener noreferrer"&gt;best AI testing tools&lt;/a&gt;, the &lt;a href="https://www.testdevlab.com/blog/best-ai-application-testing-companies" rel="noopener noreferrer"&gt;best AI application testing companies&lt;/a&gt;, and the &lt;a href="https://www.testdevlab.com/blog/best-agentic-ai-software-testing-companies" rel="noopener noreferrer"&gt;best agentic AI software testing companies&lt;/a&gt; are a good place to start.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>qa</category>
      <category>testing</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
