> For the complete documentation index, see [llms.txt](https://docs.xenioo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenioo.com/ai/large-language-models/train-and-test/test-suite.md). Agents can also search and read this documentation through its [MCP server](https://docs.xenioo.com/~gitbook/mcp).

# Test Suite

The **Test Suite** lets you build a list of questions that matter to your business, together with the answer you expect, and verify automatically how well your AI answers them. Run it every time you change your guidelines, resources or model to make sure nothing that used to work is now broken.

The Test Suite is available in the **Train & Test** page, next to the **Chat** tab.

#### How It Works

When a test run is started, each enabled test case is sent to your AI exactly as a user would ask it, using your guidelines and resources. Every answer is then graded by a second AI model, the *judge*, that compares it with the expected answer and gives it a score from 0 to 100.

The judge grades answers by meaning: the wording doesn't have to match the expected answer, as long as the same information is conveyed.

Since the AI doesn't always answer the same question in the same way, each question can be asked more than once. This shows which answers are reliable and which ones are not.

#### Test Cases

Click **Add Test Case** to create a new test case. Each test case uses the following settings:

| Setting          | Description                                                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Question         | What the user asks. For example: *How do I cancel my subscription?*                                                                            |
| Expected answer  | The answer you expect. It is graded by meaning, so the wording doesn't have to match                                                           |
| Must include     | Facts the answer must convey, one per line. For example: *30 days*. Each missing fact lowers the score                                         |
| Must not include | Things the answer must never say, one per line. For example: *a refund*. If the answer says any of them, that attempt fails whatever its score |

Test cases can be edited, disabled or deleted from the row menu. Disabled test cases are kept but are not executed during runs.

A Test Suite can contain up to 100 test cases. Each test case is asked as a new, single question: previous questions and answers are not remembered.

#### Settings

Click the settings button next to the run button to configure how tests are executed:

| Setting                                    | Description                                                                                                                                      |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Use AI module settings                     | If enabled, the judge uses the provider and model configured in the AI module settings                                                           |
| Judge provider                             | The AI provider used by the judge. Only visible when Use AI module settings is disabled                                                          |
| Judge model                                | The model used by the judge. Only visible when Use AI module settings is disabled                                                                |
| API Key                                    | The API key used to authenticate with the judge provider. Leave blank to use the bot API key when the judge provider is the same used by the bot |
| Times each question is asked               | From 1 to 5. Asking more than once shows which answers are unstable. Default is 3                                                                |
| Pass threshold (%)                         | An answer passes when the judge scores it at least this much. Default is 70                                                                      |
| Allow functions and MCP tools during tests | If enabled, the AI can call your functions and MCP tools while answering test questions. Disabled by default                                     |

{% hint style="warning" %}
We recommend using a judge model different from the one your bot uses, ideally from another provider. A model grading its own answers tends to share its blind spots and score them too kindly. A warning icon is displayed when the judge and the bot use the same model.
{% endhint %}

{% hint style="danger" %}
Functions and MCP tools can have real side effects, such as calling webhooks, opening tickets or sending emails. Enable *Allow functions and MCP tools during tests* only if your tools are safe to call from tests.
{% endhint %}

#### Running Tests

Use the **Test against** selector to choose which model to test:

| Model                        | Description                                                                                           |
| ---------------------------- | ----------------------------------------------------------------------------------------------------- |
| Preview model (last trained) | The model trained from your current, unpublished settings. Use it to verify changes before publishing |
