> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/space/tests.md).

# Tests

#### Why Use It?

* Validate changes before releasing to production.
* Catch side effects and broken logic early.
* Recheck rules automatically after platform updates.
* Understand rules faster through real-world input/output examples.

#### Core Concepts

* Test: A single scenario (Input + Expected Output). You can choose to ignore dynamic values (like generated timestamps) so they don't cause false failures.
* Test Suite: A folder that groups related tests together. It is strictly linked to a specific rule version.
* Test Run: The execution record of your tests (Passed, Failed, Error, or Canceled).

#### Two Ways to Manage Tests

1. Rule-Level (Inside a rule): Create, edit, and debug tests for the specific rule you are actively working on.
2. Space-Level (Main menu): Manage bulk actions, move tests between rules, and view execution history across your entire space.

The interface is divided into two main tabs: [**Tests** ](/doc/space/tests/tests-tab.md)and [**Test Runs**](/doc/space/tests/test-runs-tab.md)**.**

### API Automation

Rule Testing can be fully automated via the DecisionRules API, making it easy to integrate testing directly into your CI/CD pipelines or external systems.

Authentication To authenticate requests, use a Bearer token with a valid Solver API key: `Authorization: Bearer YOUR_SOLVER_API_KEY`

Key Endpoints

* Start a Test Run (`POST /testRun/start`): Starts a new execution job. You must provide an array of `testSuiteIds` and/or `testIds` in the JSON body. The response returns a `testRunId`.
* Get Test Run Job (`GET /testRun/{testRunId}`): Retrieves the overall execution state, timing context, and results of a specific test run.

more info here:&#x20;

{% content-ref url="/pages/4nnpr9qFTRyhrvEDtUMk" %}
[Rule Testing API](/doc/api/rule-testing-api.md)
{% endcontent-ref %}

<figure><img src="/files/5b4IC2tesmZhVetHzpfL" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decisionrules.io/doc/space/tests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
