How to test an AI chatbot or LLM feature: a practical QA guide
Testing an AI feature is different from testing a normal one. Ask a regular feature the same question twice and you get the same answer. Ask a large language model (LLM) the same question twice and you may get two different answers, and both might be fine, or one might be confidently wrong.
That doesn’t mean AI features can’t be tested. It means you test them against rules and quality criteria rather than exact expected text. Here is the approach we use.
1. Define what “good” looks like
Before testing anything, write down what a good answer must do. For a support chatbot that might be:
- Answers only from your help content and policies
- Gives correct prices, dates and order details
- Says “I don’t know” and offers a human when it isn’t sure
- Never shares another customer’s data
- Uses your brand’s tone and stays polite
Each rule becomes something a tester can check and score.
2. Build a test set of real questions
Collect 50–200 questions from real support tickets, search logs and sales calls. Include the easy ones, the ones customers ask most, and the awkward ones. For each question, record the facts a correct answer must contain. This test set is the backbone of every test run.
3. Test accuracy and hallucinations
- Facts: are prices, policies, product details and numbers correct?
- Grounding: does every claim come from your sources, or is the model inventing details?
- Unknowns: when the answer isn’t in your content, does it admit that, or make something up?
- Out-of-date information: after you change a policy, does the bot still quote the old one?
4. Test safety and misuse
- Prompt injection: try inputs like “ignore your instructions and…” or instructions hidden inside uploaded documents and web pages the bot reads.
- Data leaks: can a user get the system prompt, internal notes or another customer’s details?
- Harmful or off-brand output: rude, biased or unsafe replies, and answers on topics the bot should refuse.
- Actions: if the AI can take actions such as refunds, bookings or emails, check that it can’t be talked into doing them without the right checks.
5. Test consistency
Ask each important question several times and in different wordings. The wording can change, but the facts and the decision (refund or no refund, eligible or not) must not.
6. Test the experience around the AI
- Response time, and what the user sees while waiting
- Long conversations: does it remember context, or lose track?
- Handover to a human: is it easy, and does the agent see the chat history?
- Errors and timeouts from the AI provider: does the app fail gracefully?
- Mobile layouts, accessibility and different languages if you support them
- Cost: unusually long prompts or loops can make every conversation expensive
7. Score results and track them over time
Score each answer against your rules: pass, partial or fail, with a note. Track the pass rate for each category (accuracy, safety, tone) per release. Automated checks, including using a second model to grade answers, help at scale, but have people review a sample of every run. Graders make mistakes too.
8. Re-test on every change
A new model version, a prompt edit or new source documents can quietly change behaviour. Run your test set on every change, the same way you run regression tests on normal features. Compare the scores and read the answers that changed.
A quick checklist
- Written quality rules for good answers
- A test set of real customer questions with required facts
- Accuracy and hallucination checks
- Prompt injection and data-leak attempts
- Consistency checks across repeats and rewordings
- Latency, errors, handover and mobile checks
- Scores tracked per release, with human review
- The full test set re-run on every model, prompt or content change
Need help testing an AI feature before launch? See our AI-based testing services or ask for a free QA audit.
Keep reading
Get a free QA audit
We'll test a key journey of your app and send you the bugs we find.