<?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: Kartik Sharma</title>
    <description>The latest articles on DEV Community by Kartik Sharma (@kartik_sharma_).</description>
    <link>https://dev.to/kartik_sharma_</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%2F4059890%2F0cebc016-2a72-4f67-a6a4-8a5c4f83f131.jpg</url>
      <title>DEV Community: Kartik Sharma</title>
      <link>https://dev.to/kartik_sharma_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kartik_sharma_"/>
    <language>en</language>
    <item>
      <title>Hallucination Testing: Check What AI Does When the Answer Is Missing</title>
      <dc:creator>Kartik Sharma</dc:creator>
      <pubDate>Thu, 03 Sep 2026 09:32:57 +0000</pubDate>
      <link>https://dev.to/testscenario/hallucination-testing-check-what-ai-does-when-the-answer-is-missing-28an</link>
      <guid>https://dev.to/testscenario/hallucination-testing-check-what-ai-does-when-the-answer-is-missing-28an</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4tgyln4fls9jb39m1nv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4tgyln4fls9jb39m1nv.png" alt="A dark blue AI-themed illustration featuring a thoughtful white robot with a glowing question mark above its head. The design highlights the title “Hallucination Testing” with supporting text about checking how AI responds when an answer is missing. A blank puzzle-piece space and an “Answer?” card visually represent uncertainty, missing information, and AI hallucination." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
Hallucination testing becomes more useful when the system is tested with questions it cannot confidently answer from the available information.&lt;/p&gt;

&lt;p&gt;A normal AI Testing flow may check whether generated responses are correct. Hallucination testing goes further by checking whether the model invents facts, sources, names, numbers, or explanations when evidence is missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create situations where the AI should say "I don't know"
&lt;/h2&gt;

&lt;p&gt;Suppose an AI assistant can access three internal policy documents.&lt;br&gt;
Ask:&lt;/p&gt;

&lt;p&gt;What percentage of customers requested refunds last quarter?&lt;/p&gt;

&lt;p&gt;If the documents do not contain that number, the system should not create one.&lt;/p&gt;

&lt;p&gt;Depending on the product requirements, acceptable behaviour may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stating that the information is unavailable&lt;/li&gt;
&lt;li&gt;asking for another source&lt;/li&gt;
&lt;li&gt;explaining what information is available&lt;/li&gt;
&lt;li&gt;clearly marking uncertainty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A confident but unsupported percentage should be treated as a failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test fabricated entities
&lt;/h2&gt;

&lt;p&gt;Another useful approach is to introduce believable but nonexistent information.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fake product names&lt;/li&gt;
&lt;li&gt;fictional employees&lt;/li&gt;
&lt;li&gt;nonexistent research papers&lt;/li&gt;
&lt;li&gt;made-up API methods&lt;/li&gt;
&lt;li&gt;invented company policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ask the AI to explain or reference them.&lt;/p&gt;

&lt;p&gt;The test checks whether the system challenges the false assumption or begins building an answer around something that does not exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify citations separately
&lt;/h2&gt;

&lt;p&gt;If the AI provides citations, do not assume the response is grounded simply because links or references appear.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Does the source exist?&lt;/li&gt;
&lt;li&gt;Does it contain the claimed information?&lt;/li&gt;
&lt;li&gt;Does the cited section actually support the statement?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A real source attached to an unsupported claim is still a problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repeat important scenarios
&lt;/h2&gt;

&lt;p&gt;Generative systems may behave differently across repeated runs.&lt;/p&gt;

&lt;p&gt;A model may correctly refuse to invent information several times and then fabricate an answer later.&lt;/p&gt;

&lt;p&gt;Run important hallucination cases repeatedly, especially for financial, healthcare, security, or business-critical workflows.&lt;/p&gt;

&lt;p&gt;Hallucination testing is only one part of evaluating AI behaviour. Teams building broader coverage can use the full &lt;a href="https://www.testscenario.com/ai-testing-checklist/" rel="noopener noreferrer"&gt;&lt;strong&gt;AI Testing Checklist&lt;/strong&gt;&lt;/a&gt; to connect these checks with factual accuracy, RAG testing, context handling, regression, security, and response quality.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>hallucinationtesting</category>
      <category>softwaretesting</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
