> For the complete documentation index, see [llms.txt](https://swallow-1.gitbook.io/swallow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swallow-1.gitbook.io/swallow/build/step-builder/running-tests.md).

# Running tests

It's important to be able to gain confidence in your model as you go, which is why you can run tests against your pricing model build, without having to leave the 'Build' tab.

## Setting up tests

This page assumes you've automatically created tests at the start of your build by choosing the [Building with AI](/swallow/build/building-with-ai.md) option or by using a Swallow template. If you've started your build from scratch, you'll need to read our page on [Creating New Tests](/swallow/test/creating-new-tests.md) to set up tests before you'll have the option to use them.

## Running tests within the builder

The 'Run Test Scenario' dialogue box is always at the right-hand side of your step builder.

Simply open the drop-down menu at any time, and you'll see any test scenarios you've added listed.&#x20;

Learn more about [Creating New Tests](/swallow/test/creating-new-tests.md) or [Editing Tests](/swallow/test/editing-tests.md) if you want to change the tests listed in this menu.

<figure><img src="/files/JCUzvuxef7hfbDvPeERp" alt="" width="375"><figcaption><p>'Run Test Scenario' dialogue</p></figcaption></figure>

After selecting a specific test, you'll instantly see the impact that your new model has had on the test data. All of the results that you've specified as [Outputs](/swallow/build/outputs.md) will show in the results here.

<figure><img src="/files/neujzEig9g4Zs1KstobP" alt="" width="375"><figcaption><p>Test Results</p></figcaption></figure>

## Viewing logs

You can also dig a little deeper into any results by viewing the logs within your model.

On the 'Build' tab, if you click the 'Show Logs' button, all of your steps will expand to show the logs, so you can see how each result was calculated, split in detail. You can also download all logs as a JSON file.

<figure><img src="/files/0TsR5NwIkBLDp6SXgIfd" alt="" width="563"><figcaption><p>Expanded logs for a 'Factors' step</p></figcaption></figure>

At any stage in building your model, it's really simple to test your expression before you save it.

Simply click the 'Test' button in the bottom right of any 'Expression' form field, and you'll see either a green tick or a red cross next to a label reading 'View'.&#x20;

<figure><img src="/files/Tc0T5Oqup7qMC9DizLMN" alt="" width="375"><figcaption><p>Click the 'Test' button to see if your expression is working</p></figcaption></figure>

This will tell you whether your syntax is written and parsing correctly or not.

<figure><img src="/files/oHA0Z5MMhYNNZyTbzXme" alt="" width="86"><figcaption><p>Expression parsing successfully</p></figcaption></figure>

<figure><img src="/files/QEyaA98o4UONJlRaMePu" alt="" width="93"><figcaption><p>Expression parsing unsuccessfully</p></figcaption></figure>

Clicking the 'View' label will open up a debug menu that will show the JSON logs, allowing you to see how your expression is working with default data, to evaluate if it's doing what you expect it to.

<figure><img src="/files/yU7URMdBLCtPil2wEMit" alt="" width="563"><figcaption><p>Expanded JSON logs</p></figcaption></figure>

Test data will automatically be generated from the 'Default' inputs you've set up in your INPUTS step. When you're editing a step, you can always see the test data or manually update it at any time in the bottom left of your sidebar.&#x20;

<figure><img src="/files/nU14Au1bxss9g6P48UdE" alt="" width="299"><figcaption><p>Test data in the bottom left corner of the sidebar</p></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://swallow-1.gitbook.io/swallow/build/step-builder/running-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.
