How to Test AI Features

You're a CRM developer, ready to delight users with the long‑awaited "Generate a summary of the request" feature. The model dutifully produces a short text for the next agent — and every time it comes out different. How do you test that?

In the past, we took the input data, compared it to a reference string in the expected result, and moved on. With AI, this trick falls apart: the model picks new synonyms each time, and the automated test starts turning red. Comparing the output to a memorized string is useless, and checking everything by eye will bore you to death. So how do you tame this chaos? Let's break down a working framework.

How to Test AI Features

Step 1. Write a Behavior Contract
Forget vague phrases like "short and clear." Fix hard rules for the AI:

  • Format: strictly up to 500 characters, no extra line breaks.
  • What to preserve: order number, the problem, the client's request, and the status of actions.
  • The main taboo: the only source of truth is the dialogue. The AI is strictly forbidden from inventing facts, turning "promised to pass it on" into "already passed on," or making up non‑existent refunds.

Step 2. Separate Form from Meaning
You can't evaluate a response with a single pass/fail button. Split verification into two levels:

  • Code: checks length, absence of line breaks, and the presence of the order ID with scripts.
  • Semantic rubric: a set of clear rules by which we evaluate the logic of the text.

Our rubric has just two main criteria:
Reliability — every word is based solely on the dialogue. If it invented something extra or passed off a promise as a fact (e.g., turned "promised to pass it on" into "refund approved") — instant fail.
Completeness — all key details are present.

Step 3. Account for AI Variability
A single successful test run means nothing — the model can produce different results.

  • Run in batches: spin key cases at least 5 times to calculate the real pass rate.
  • Test traps: check how the model handles a client changing their mind mid‑conversation or an order number that has been deleted.
  • Block the release: if the AI has lied even once (e.g., invented a non‑existent refund or mixed up facts), that's a hard stop for rolling out to production.

Testing AI isn't about matching characters — it's about verifying against a strict contract. Start with a single dialogue and a couple of examples. If the team can't consistently explain why a response is correct or not, then you haven't agreed on the rules of the game yet.