← Back to Blog
    AI

    how to test a chatbot before client launch

    October 11, 20268 min

    To test a chatbot before client launch, verify its answers, business rules, integrations, privacy controls, and failure behavior against a documented test set. Run realistic conversations in staging, test malicious and unexpected inputs, measure response quality and latency, and get client approval on clear acceptance criteria before enabling production access.

    Key takeaways

    • Define measurable launch criteria before testing, including prohibited actions and escalation rules.
    • Test complete conversations, not just individual prompts or friendly demonstration questions.
    • Separate answer quality from integration safety: a correct response can still trigger the wrong action.
    • Check retrieval, prompt injection, data isolation, accessibility, and spending limits.
    • Launch gradually with monitoring, a rollback plan, and named owners for unresolved issues.

    What should you agree with the client before testing starts?

    The first step in how to test a chatbot before client launch is defining what “working” means. A sales assistant, internal knowledge bot, and appointment-booking agent need different acceptance criteria. Without that agreement, testing becomes a subjective debate about whether replies sound good.

    Create a launch acceptance sheet

    1. List supported jobs: answering product questions, qualifying leads, retrieving account information, or scheduling appointments.
    2. Define boundaries: subjects it cannot answer, actions requiring confirmation, and situations requiring a human.
    3. Identify authoritative sources: approved pricing pages, policies, product documentation, and connected systems.
    4. Set measurable gates: required scenario pass rates, acceptable latency, and maximum cost per conversation.
    5. Assign approval: name the client stakeholder authorized to accept remaining limitations.

    For example, require every unauthorized-account-access test to pass, while allowing minor wording issues in low-risk FAQs. Treat these as project-specific acceptance targets, not universal industry benchmarks.

    Tools and budget: Google Sheets, Notion, or GitHub Issues can handle the initial checklist, often within an existing subscription. Allow approximately two to four team hours for a small bot’s scope review; complex workflows need more.

    Pitfall: “Never hallucinate” is not a useful standalone requirement. Specify that unsupported policy answers must be withheld, explained, and routed to an approved source or human.

    How do you build a realistic chatbot test set?

    Start with questions from support tickets, sales calls, onboarding documents, and stakeholder interviews. Remove personal information before importing examples into testing tools. Include what users actually type: fragments, misspellings, contradictory requests, and follow-up questions without context.

    Cover these conversation categories

    • Happy paths: common questions with clear, approved answers.
    • Ambiguity: “Can I change it?” before the user identifies an order.
    • Multi-turn changes: a user changes the requested date after availability is checked.
    • Unsupported requests: guarantees, unpublished discounts, or advice outside scope.
    • Failure paths: expired sessions, unavailable APIs, missing documents, and empty search results.
    • Abuse: attempts to extract private records or override instructions.

    For a narrowly scoped assistant, an initial set of 60–100 scenarios is a practical planning range, not proof of reliability. Expand it whenever testing reveals a new failure category.

    Each case should record the input, relevant conversation history, expected behavior, acceptable sources, forbidden actions, and severity if it fails. Use behavioral assertions rather than demanding identical wording.

    Tools and budget: Store cases in CSV or JSON and run them with promptfoo or pytest. Local test tooling can be free, but model calls are not. Reserve an initial $10–$50 API testing allowance for a small text-only bot, then recalculate from actual token usage.

    Pitfall: Do not write every test to match the prompt’s vocabulary. Keep a separate holdout set that was not used while tuning the assistant.

    How do you verify answer accuracy and knowledge retrieval?

    Evaluate the final answer and the evidence used to produce it. A retrieval-augmented generation chatbot can fail because it retrieved the wrong document, missed an exception, or generated a claim that the retrieved material never supported.

    1. Inspect retrieved passages: confirm the relevant policy or product detail appears in the context.
    2. Check authority and freshness: verify that current approved documents take precedence over archived versions.
    3. Validate the answer: compare prices, eligibility rules, dates, and conditions against the source.
    4. Test missing evidence: remove the relevant document and confirm the bot acknowledges the gap.
    5. Check citations: open linked sources and verify that they support the specific claim.

    Score correctness, completeness, grounding, and appropriate uncertainty separately. Automated model-based grading can help identify weak responses, but a human should review critical decisions and disputed grades.

    Testing optionBest useCost considerationsMain limitation
    Spreadsheet and human reviewPolicy accuracy and client approvalOften no extra software cost; requires reviewer timeSlow for repeated regression runs
    promptfooRepeatable assertions and prompt comparisonsLocal open-source runs plus model API usageChecks are only as good as their definitions
    LangSmith or LangfuseTracing retrieval, prompts, and tool callsFree entry options or usage-based paid plans; verify current pricingTraces need privacy controls and interpretation
    pytestDeterministic retrieval and application checksOpen-source tooling; hosting and API costs may applySemantic answer quality needs additional evaluation

    Pitfall: A fluent answer is not necessarily accurate. Repeat high-risk scenarios because identical inputs can produce different outputs, especially after changes to models, prompts, or retrieved content.

    How do you test integrations without affecting real customers?

    Use a staging environment with separate credentials, test records, and restricted permissions. Verify the system’s state after every action, not just the chatbot’s confirmation message.

    Test the full action lifecycle

    1. Create synthetic contacts, appointments, tickets, and orders.
    2. Check that required fields are collected and validated before calling a tool.
    3. Require explicit confirmation for consequential actions where appropriate.
    4. Simulate timeouts, rate limits, permission errors, and malformed responses.
    5. Repeat submissions and retries to verify that duplicate records or charges are prevented.
    6. Confirm that failed operations are reported honestly and routed correctly.

    Use Stripe test mode for payment workflows, a dedicated Google Calendar for scheduling, and mocked CRM endpoints when a vendor sandbox is unavailable. Postman is useful for checking APIs independently of the conversation layer.

    Tools and budget: Postman and pytest support low-cost starting workflows. For a small staging service, budget roughly $10–$50 per month for lightweight hosting if an existing environment is unavailable; database, queue, and vendor sandbox charges may be additional.

    Pitfall: A timeout does not prove an action failed. The downstream service may have completed it. Use idempotency keys where supported and reconcile uncertain outcomes before retrying.

    How do you test chatbot security, privacy, and disclosure?

    Treat user messages, uploaded files, web pages, and retrieved documents as untrusted input. Instructions hidden inside any of them should not override application permissions or authorize sensitive tool calls.

    • Prompt injection: ask the bot to ignore its rules, expose credentials, or follow malicious instructions embedded in a document.
    • Data isolation: try to retrieve another test user’s records by changing account identifiers.
    • Tool permissions: request actions outside the authenticated user’s role.
    • Secret handling: inspect traces, browser responses, errors, and logs for exposed tokens.
    • Retention: confirm what gets stored, who can access it, and whether deletion controls work.

    Authorization must be enforced by the backend, not entrusted to the model’s willingness to refuse. Keep secrets out of prompts and restrict tool access using server-side checks.

    For US-facing deployments, verify applicable privacy obligations with qualified counsel. If the chatbot makes affiliate recommendations, test that material relationships receive clear, conspicuous FTC-aligned disclosures near the recommendation. Regulated workflows need additional specialist review.

    Tools and budget: OWASP’s guidance for generative AI applications, browser developer tools, and Gitleaks offer useful starting points without software licensing fees. Independent security reviews need separate, scope-based quotes.

    Pitfall: Passing a few jailbreak prompts does not establish security. Test the consequences an attacker could achieve, particularly unauthorized reads and writes.

    How do you measure speed, reliability, cost, and usability?

    Test under expected traffic and plausible spikes using synthetic data. Measure both time to first response and time to completed answer or action. Streaming can make a bot feel fast while its underlying workflow remains slow.

    1. Establish a baseline: record latency, errors, token usage, and tool-call duration for representative conversations.
    2. Increase concurrency gradually: watch application queues, provider limits, and database connections.
    3. Inject dependency failures: verify timeouts, bounded retries, and useful fallback messages.
    4. Test the interface: check mobile layouts, keyboard navigation, screen readers, and interrupted sessions.
    5. Enforce budgets: limit message length, conversation length, tool loops, and per-user request rates.

    Use k6 or Locust for load generation and Playwright with axe-core for browser and automated accessibility checks. Include manual keyboard and screen-reader testing; automated scans cannot establish complete accessibility.

    Budget: Local tools are available free. Cap an initial small load test at a defined API spend, such as $25–$100, and start with mocked model responses before exercising paid endpoints. Real costs depend heavily on model choice, context size, and concurrency.

    Pitfall: Average latency hides slow sessions. Track percentile latency and inspect expensive conversations individually. Calculate cost per completed task, including retries and tool calls, rather than counting only the first answer.

    What must pass before the client signs off?

    Run the final regression suite against the exact configuration intended for production. Record the model version where available, prompt revision, knowledge snapshot, application commit, and integration settings so the result is reproducible.

    Use a release checklist

    • No unresolved critical security, privacy, or unauthorized-action defects.
    • Agreed quality and performance thresholds met on the holdout set.
    • Human handoff tested, including outside support hours.
    • Monitoring, spending alerts, and incident ownership confirmed.
    • Known limitations documented and accepted by the client.
    • Rollback or chatbot-disable procedure rehearsed.

    Invite client staff to perform realistic tasks without coaching. Then launch to a restricted audience or limited traffic share before broader access. Monitor failures, escalations, and unsupported questions while minimizing stored personal data.

    Tools and budget: GitHub Actions can automate regression checks; Sentry can surface application failures. Both offer entry-level options, with charges depending on usage. Reserve actual staff time for launch monitoring, not just software subscriptions.

    Pitfall: Client approval is not the end of testing. Changes to documents, tools, prompts, or providers should trigger targeted regression checks.

    Frequently asked questions

    How many chatbot test cases do I need?

    A narrow FAQ bot can start with 60–100 deliberately varied scenarios, but that is a planning baseline, not a reliability guarantee. Add coverage for every permission boundary, integration, policy exception, and failure discovered.

    Can AI evaluate another chatbot’s answers?

    Yes, model-based evaluators can flag likely relevance, grounding, and completeness problems. Validate their judgments against human-reviewed examples and do not make them the sole approval mechanism for high-risk behavior.

    Should I test with real customer conversations?

    Real conversations can reveal useful phrasing and edge cases when you have appropriate authorization to use them. Redact personal and confidential information, confirm vendor data-handling settings, and use synthetic records for actions.

    What is the difference between staging tests and a pilot launch?

    Staging provides controlled testing without intentionally affecting production customers or records. A pilot exposes a restricted production audience to the bot, so it requires monitoring, support coverage, and a working shutdown mechanism.

    When should launch be delayed?

    Delay launch if the chatbot exposes private data, performs unauthorized actions, fabricates critical policies, or lacks a safe failure path. Lower-risk wording defects may be accepted if they are documented and do not violate agreed criteria.

    Muhammad Tariq at Tariq Services builds AI products, agents, and automations with testing and operational safeguards. Explore AI development services if you need help preparing a client chatbot for a controlled launch.

    Ready to ship your SaaS in weeks?

    Book a Free Call