World’s largest virtual agentic engineering & quality conference
Learn chatbot testing: 9 test types, practical test case templates, step-by-step process, CI/CD pipeline setup, and best practices for LLM and rule-based bots.

Devansh Bhardwaj
Author

Himanshu Sheth
Reviewer
Last Updated on: August 2, 2026
OVERVIEW
TL;DR
According to a Master of Code roundup of chatbot statistics, bots can manage around 80% of routine tasks and 30% of live chat communications. Everything inside that automated share reaches a customer with no human reviewing it first, so a single misread intent is a customer-facing failure rather than an internal one.
Volume is what makes it urgent. An intent the bot misreads even a small fraction of the time, "cancel my order" being the classic one, still fails a steady stream of real customers at production scale, and nobody sees those failures until the complaints arrive. Chatbot testing closes that gap before it becomes a customer service or revenue problem. The same applies to AI customer support agents built on platforms like Decagon.
This guide covers every layer of chatbot QA: what to test, how to build test cases, how to automate validation in CI/CD, and how to use TestMu AI to evaluate LLM-based chatbots against production quality standards. For broader context on how AI chatbots work, see the AI chatbot guide. If your agent takes calls rather than messages, the voice AI agent testing guide covers the audio, latency, and interruption layers that chat never has to deal with. This article focuses entirely on the testing methodology.
Chatbot testing is the process of verifying that a chatbot behaves correctly across all user inputs, conversation flows, and system integrations. It validates three distinct layers that each require different test strategies:
Chatbot testing differs from standard UI testing because the system under test is probabilistic. A button either clicks or it does not. A chatbot response to "reschedule my appointment" might be correct, partially correct, or wrong depending on phrasing, prior context, and model state. That non-determinism requires testing approaches built around intent validation, semantic scoring, and conversation-level assertions rather than exact DOM checks.
The scope of chatbot testing also expands with bot complexity. A simple FAQ bot with 10 intents needs functional and NLP testing. A customer service LLM chatbot integrated with a CRM also needs performance, security, adversarial, and regression testing across every model update cycle.
Deploying an undertested chatbot costs more than not deploying one at all. These are the failure modes that appear consistently when chatbot testing is skipped or done only manually before releases:
The goal of chatbot testing is not to achieve a perfect score in a controlled environment. It is to catch the failure modes that hurt users and the business before they reach production, and to detect regressions automatically so every deployment is validated rather than assumed to be safe.
Note: TestMu AI's agent testing platform evaluates your chatbot across 9 quality dimensions on every deployment. Try it free.
The architecture of your chatbot determines how you test it. Rule-based and LLM-based chatbots fail in fundamentally different ways and need different test strategies. Understanding the difference before building your test plan prevents applying the wrong approach to each layer.
| Dimension | Rule-Based Chatbot | LLM Chatbot |
|---|---|---|
| Response type | Deterministic: same input always produces the same output | Non-deterministic: same input may produce varied, contextual outputs |
| Assertion method | Exact-match string comparison | Semantic scoring, intent classification, quality rubrics |
| Primary failure modes | Missing intents, broken flows, integration errors | Hallucinations, bias, prompt injection, context drift |
| Regression risk | Breaking a flow is usually visible and traceable to a code change | Model updates can silently degrade quality across all responses |
| Test data volume | Small set of scripted dialogues usually sufficient | Large labeled datasets and adversarial prompt sets required |
| Tooling | Standard conversation testing frameworks, scripted dialogues | AI evaluation platforms with semantic scoring capabilities |
Most production chatbots blend both architectures: a rule-based routing layer selects conversation flows while an LLM handles natural language generation within each flow. Test these two layers separately. Treat the routing layer as deterministic using exact-match assertions on intent classification, and the generation layer as probabilistic using semantic quality scoring per response.
For a deeper look at testing AI applications more broadly, including LLM evaluation frameworks and AI quality gates, the testing AI applications guide covers how chatbot testing fits into the larger AI testing landscape.
A complete chatbot QA plan covers all nine of the following test types. The first three are the minimum for any production chatbot. The last two, regression and adversarial, are the ones most teams skip and the ones most likely to surface issues that damage users and the business.
Functional testing verifies that the chatbot correctly handles every intent it is designed to support. For each intent, write at least three test utterances: a canonical form, a paraphrase, and a misspelling. Confirm that all three map to the right intent and trigger the correct action or response.
Conversational flow testing validates the multi-turn dialogue structure. It checks whether the bot navigates correctly between steps, handles interruptions gracefully, and resolves ambiguity without looping. A user who says "the first one" in turn 5 expects the bot to remember what "the first one" referred to in turn 2.
NLP/NLU testing measures intent classification accuracy and entity extraction reliability. Build a labeled test dataset of at least 20-30 utterances per intent, covering varied phrasings, run it through the NLU engine, and calculate precision, recall, and F1 score per intent. Any F1 score below 0.85 on a production intent is a red flag that warrants retraining before launch.
The artifact all of this depends on is a Golden Dataset: a curated set of representative user inputs paired with the intent and response each one should produce. It is your ground truth, and every accuracy number you quote is really a statement about it. Without one you have no baseline, so "the model got better" is an opinion rather than a measurement.
Two things make a Golden Dataset worth having. Build it from real user logs rather than invented phrasings, because real users are messier than you imagine. And grow it deliberately: every production miss becomes a new labelled case, which is what turns the dataset into an asset that compounds instead of a one-off exercise.
UX testing evaluates whether the conversation feels natural and useful to a real user. It goes beyond functional correctness: a bot that gives the right answer in a robotic or confusing tone is a UX failure even if the logic is correct. The key metric is task completion rate, the percentage of sessions where the user reached their goal without live agent escalation.
Performance testing checks that the chatbot meets response-time SLAs under concurrent load. Response latency above 3 seconds triggers abandonment in most consumer contexts. For LLM-backed bots, first-token latency, the time to start streaming the first word, matters more than total generation time because it determines perceived responsiveness.
A note on terminology, since the phrase is overloaded. Stress testing here means pushing the chatbot beyond its expected concurrent user load to find the point where response times degrade or the service fails, and how it recovers afterwards. It is a software load-testing term and has nothing to do with the cardiac stress tests the same phrase returns elsewhere. In this context the types worth running are load testing (expected traffic), stress testing (beyond expected, to find the breaking point), spike testing (a sudden surge, such as a product launch), and soak testing (sustained traffic, to expose memory leaks).
Security testing for chatbots focuses on prompt injection, data exfiltration, and authentication bypass. A chatbot connected to a CRM, order system, or database becomes a potential attack surface if users can craft inputs that expose data outside their session or override system instructions.
Accessibility testing ensures the chatbot widget and its responses meet WCAG 2.1 AA standards. Most chatbot widgets ship with keyboard navigation gaps, missing focus management, and absent ARIA live regions, all of which affect users with disabilities and create legal exposure under ADA and EN 301 549.
aria-live="polite"Regression testing re-runs a fixed set of conversation test cases after every update to the chatbot's model, prompts, or connected APIs. This is the most important type to automate. LLM model updates from your provider, even minor version bumps, can silently change response behavior and degrade intent handling or response quality across the whole bot.
Adversarial testing submits intentionally hostile, nonsensical, or boundary-pushing inputs to find failure modes that standard functional tests miss. For LLM chatbots, adversarial testing is non-negotiable. Real users will attempt to jailbreak, confuse, or extract sensitive information from your bot in production.
The nine types above tell you what to test. This tells you how to structure the scenarios inside each one, and it is the classic QA split applied to a conversation. Most teams write the first category well, the second sometimes, and the third almost never, which is a problem because real users spend a surprising amount of time in the third.
Standard inputs, phrased the way you expect, doing what the bot was built for. "Where is my order?", "Book a table for two at 8pm", "Reset my password". These confirm the core journeys work and they are your smoke tests.
The trap is stopping here. Positive tests pass on the day you write them and keep passing, which feels like coverage and is actually the easiest part of the problem. A bot that only handles the happy path fails the moment it meets a real user.
Here you check that the bot fails gracefully rather than confidently. What matters is that it recognises it cannot help and says so, instead of guessing.
These are not malicious and not wrong, just outside the pattern you designed for. They are where the interesting defects live because nobody thought about them.
A workable split for a regression suite is roughly equal parts positive, negative, and edge case. A suite made up almost entirely of happy paths only proves the bot still works for users who behave exactly as specified, and those users do not exist.
Follow these six steps to build a repeatable chatbot testing process from scratch, or to formalize an ad-hoc approach that currently relies on manual pre-release checks. For platform-specific guidance on testing chatbots built on platforms like Kore.ai, see the dedicated Kore.ai testing guide.
The three templates below cover the most common chatbot test patterns. Adapt the utterances, intents, and expected criteria to your chatbot's domain. Each template shows the fields needed for both manual tracking and automated assertion.
This template covers a complete two-turn transaction where the bot collects a required entity before resolving the request.
test_name: order_status_happy_path
description: User asks for order status using natural language
turns:
- user: "Where is my order?"
expected_intent: check_order_status
expected_entity: null
assertion: intent_match
- bot: "Sure! What is your order number?"
assertion: response_asks_for_entity
- user: "It is ORD-2845"
expected_intent: provide_order_id
expected_entity:
order_id: "ORD-2845"
assertion: entity_extraction_correct
- bot: "Your order ORD-2845 is out for delivery and will arrive by 5 PM today."
assertion: response_includes_delivery_info
pass_criteria:
intent_accuracy: 1.0
entity_extraction_accuracy: 1.0
response_latency_p95_ms: 2000
no_clarification_loop: trueThis template verifies that the bot gracefully handles queries it was not designed to answer, without guessing or hallucinating an answer.
test_name: out_of_scope_fallback
description: User asks something outside the bot's defined scope
turns:
- user: "What is the capital of France?"
expected_intent: fallback
assertion: intent_match
- bot: "I am not able to help with that, but I can assist with
orders, returns, and account questions."
assertion:
fallback_triggered: true
offers_alternatives: true
does_not_hallucinate_answer: true
pass_criteria:
fallback_triggered: true
no_wrong_intent_match: true
response_offers_redirect: trueThis template validates that the chatbot retains entities and intent context across multiple turns without asking the user to repeat information already provided.
test_name: multi_turn_context_retention
description: Validate LLM context retention across a return and exchange flow
turns:
- user: "I want to return my blue sneakers."
expected_intent: initiate_return
expected_entity:
product: "blue sneakers"
- bot: "I can help with that return. What is the reason?"
assertion: context_retains_product_reference
- user: "They do not fit properly."
expected_intent: provide_return_reason
expected_entity:
reason: "size_issue"
- user: "Can I exchange them for a size 10 instead?"
assertion:
context_retained:
- "blue sneakers"
- "return"
- "size_issue"
offers_exchange_option: true
no_repeated_clarification_questions: true
pass_criteria:
context_retention_across_turns: true
no_entity_reask: true
response_offers_exchange: trueFor a broader set of chatbot automation testing tools that can execute conversation test scripts like these against your chatbot's API, the chatbot automation testing tools guide covers the full tooling ecosystem with verified feature comparisons.
Once you have those scenarios written, something has to run them on every build. There are two ways to automate a chatbot, and picking the wrong one is why so many chatbot regression suites end up disabled.
Drive the chat widget as a user does. Selenium or Playwright opens the page, finds the input field among the DOM elements, types the message, waits for the reply bubble to render, and asserts on its text.
What this genuinely proves is that the widget works: it renders, it accepts input, it displays the response, and it does so in a real browser. Nothing else tests that. What it costs you is speed and stability, because you are now exposed to page load, animation, async rendering, and every DOM change the frontend team makes.
Skip the browser and talk to the bot's endpoint directly. Send JSON payloads to the webhook and assert on the response, using Postman for exploration and your test framework in CI.
This tests the thing that actually holds the intelligence: intent recognition, entity extraction, dialogue state, and the response. It runs in milliseconds, it has no DOM to break against, and it survives a widget redesign untouched. It also cannot tell you the send button is broken.
| Parameters | UI-based (Selenium / Playwright) | API-based |
|---|---|---|
| What it drives | The chat widget in a real browser | The webhook or endpoint directly |
| Speed | Seconds per exchange | Milliseconds |
| Flakiness | Higher: DOM, timing, rendering | Low: no browser involved |
| Breaks when | The widget markup changes | The API contract changes |
| Proves | The user can actually use it | The bot understands and answers |
| Suits | A handful of critical journeys | The bulk of the regression suite |
The recommendation is not either/or, it is proportion. Put the bulk of your regression suite at the API layer, because that is where the conversational logic lives and where hundreds of scenarios can run on every commit in under a minute. Keep a small UI suite for the journeys that must be proven end to end, and run it less often.
Teams that automate everything through the UI end up with a suite that takes twenty minutes, fails intermittently for reasons unrelated to the bot, and gets skipped within a quarter. The API layer is what makes chatbot regression testing viable in CI at all.
Running chatbot tests only before releases means regressions from model updates, prompt edits, and API changes all go undetected between cycles. Integrating chatbot tests into CI/CD ensures every PR and every model update is validated automatically against your acceptance criteria.
The HyperExecute YAML configuration below runs a chatbot regression suite on every pull request. It connects to the staging chatbot endpoint, executes the conversation test suite, evaluates each response, and fails the pipeline if accuracy drops below the configured threshold.
version: 0.1
globalTimeout: 90
testSuiteTimeout: 90
testSuiteStep: 90
runson: linux
autosplit: false
env:
CHATBOT_ENDPOINT: $CHATBOT_STAGING_URL
CHATBOT_API_KEY: $CHATBOT_API_KEY
INTENT_ACCURACY_THRESHOLD: "0.90"
FALLBACK_RATE_MAX: "0.12"
pre:
- pip install chatbot-test-runner pytest pytest-json-report
testDiscovery:
type: raw
mode: static
commands:
- pytest tests/chatbot/ --collect-only -q
testRunnerCommand: >
pytest tests/chatbot/$test
--tb=short
--json-report
--json-report-file=results/$test_report.json
post:
- python scripts/check_thresholds.py results/
report: true
partialReports:
location: results
type: json
frameworkName: pytestThe check_thresholds.py post-step reads the JSON results and exits with code 1 when the run falls below the INTENT_ACCURACY_THRESHOLD or exceeds the FALLBACK_RATE_MAX declared in the env block above. Both are environment variables so the values can be tightened incrementally without changing the pipeline definition.
The CHATBOT_API_KEY variable should be stored as a CI secret rather than hardcoded in the YAML file. For teams getting started with TestMu AI's platform, the testing your first AI agent guide covers how to configure the CLI trigger and set up your first automated agent test run from scratch.
Three things to monitor once CI integration is running:
No single tool covers chatbot testing, because the problem has three separate layers: does the widget work, does the conversation flow correctly, and is the answer any good? Each layer has its own tooling, and confusing them is why teams end up with gaps.
DeepEval is an open-source framework for evaluating LLM outputs, and it works the way a developer expects: pytest-style test cases, run locally and in CI. Its value is that it scores the things a string comparison cannot, such as answer relevancy, faithfulness to the provided context, and hallucination.
That matters because an LLM chatbot never returns the same sentence twice. Asserting the reply equals an expected string fails immediately, and asserting it merely contains a keyword passes for answers that are subtly wrong. Semantic scoring is the only assertion that survives a non-deterministic bot.
Ragas is built specifically for RAG pipelines, which is what most enterprise support bots actually are: retrieve from a knowledge base, then answer from what was retrieved. It splits the evaluation in two, measuring retrieval quality (did we fetch the right documents?) separately from generation quality (did the answer stay faithful to them?).
That separation is the point. When a RAG bot answers badly, the cause is either that retrieval fetched the wrong context or that the model ignored the right context, and the fixes are entirely different. A single quality score cannot tell you which, so it sends you to debug the wrong half.
Botium is often described as Selenium for chatbots, and the analogy holds. It tests conversations as multi-turn scripts (user says this, bot should respond with that, then user says this) with connectors for the major platforms. It suits rule-based and intent-driven bots, where responses are deterministic and the risk is a broken dialogue path rather than a poor answer.
Selenium and Playwright are not chatbot tools, and that is fine: they cover the layer none of the above touch, which is whether the widget renders and works in a real browser. As covered above, keep this to a small number of critical journeys.
| Tool | Layer it tests | Best for |
|---|---|---|
| DeepEval | Answer quality (semantic) | LLM bots: relevancy, faithfulness, hallucination |
| Ragas | Retrieval and generation quality | RAG bots answering from a knowledge base |
| Botium | Conversational flow | Rule-based and intent-driven bots |
| Selenium / Playwright | The chat widget in the browser | Critical end-to-end journeys |
| Postman | The bot API | Exploring and asserting on the endpoint |
The choice follows from what your bot is. A rule-based bot has no answer-quality problem, since the answers are written by hand, so Botium plus a thin UI suite covers it. An LLM bot has the opposite profile: the flow is trivial and the answer quality is the entire risk, which is DeepEval and, if it retrieves, Ragas. Most production bots are a mix, and so is the tooling.
Whichever you pick, they all depend on the Golden Dataset described earlier. These frameworks score outputs against expected behavior, and if nobody has defined what the bot should say, there is nothing to score against.
TestMu AI's agent testing platform is purpose-built for validating AI chatbots and voice agents. Unlike generic testing tools that assert on HTML or API responses, the platform deploys an AI evaluator that interacts with your chatbot the way a real user would and scores each response across nine quality dimensions.
The platform is particularly valuable for LLM chatbots where traditional test frameworks cannot assert on semantic response quality. Instead of writing custom scoring scripts or maintaining evaluation rubrics by hand, the agent testing engine applies pre-trained evaluation criteria calibrated to production chatbot quality standards.
TestMu AI's AI testing tools suite also covers LLM testing beyond chatbots, including document Q&A agents, code generation agents, and voice-first AI systems. If your chatbot is part of a broader AI product, the platform provides a unified quality view across all AI surfaces. Teams whose support bot is built on a specific vendor can start from a platform guide instead, such as Ultimate AI testing for support agents.
Seven practices that consistently separate chatbots that hold up in production from those that generate complaints and support tickets:
The practical starting point is to automate the three test types that are cheapest to run and most likely to catch breaking changes: functional intent recognition, fallback handling, and multi-turn context retention. Get those three suites running in CI before expanding to the full nine-type coverage. For teams using TestMu AI, the KaneAI natural language test generation tool can accelerate building out the full test suite without requiring manual scripting of every conversation scenario.
Export last month's escalated conversations and turn the twenty most common into a golden dataset with the intent and response each one should have produced. That single artifact takes an afternoon and converts every later argument about chatbot quality from an opinion into a measurement.
Then run those conversations through the three cheap suites named above, at the API layer, on every prompt and model change. Report the results per intent rather than as a single accuracy figure, because a blended number hides the one intent that fails for a specific group of users.
To run that continuously rather than by hand, TestMu AI's agent testing platform generates scenarios from documents describing your bot and scores every response on each deployment. For the broader discipline this sits inside, AI agent testing covers how the same evaluation approach extends beyond chat.
Note: This article was researched and drafted with AI assistance, then reviewed, fact-checked, and published by Devansh Bhardwaj, Community Evangelist at TestMu AI, whose listed expertise includes Automation Testing and Software Testing. Every statistic, link, and product claim in this article was verified against primary sources before publication. Read our editorial process and AI use policy for details.
Author
Devansh Bhardwaj is a Community Evangelist at TestMu AI with 4+ years of experience in the tech industry. He has authored 30+ technical blogs on web development and automation testing and holds certifications in Automation Testing, KaneAI, Selenium, Appium, Playwright, and Cypress. Devansh has contributed to end-to-end testing of a major banking application, spanning UI, API, mobile, visual, and cross-browser testing, demonstrating hands-on expertise across modern testing workflows.
Reviewer
Himanshu Sheth is the Director of Marketing (Technical Content) at TestMu AI, with over 8 years of hands-on experience in Selenium, Cypress, and other test automation frameworks. He has authored more than 130 technical blogs for TestMu AI, covering software testing, automation strategy, and CI/CD. At TestMu AI, he leads the technical content efforts across blogs, YouTube, and social media, while closely collaborating with contributors to enhance content quality and product feedback loops. He has done his graduation with a B.E. in Computer Engineering from Mumbai University. Before TestMu AI, Himanshu led engineering teams in embedded software domains at companies like Samsung Research, Motorola, and NXP Semiconductors. He is a core member of DZone and has been a speaker at several unconferences focused on technical writing and software quality.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance