# 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](https://swallow-1.gitbook.io/swallow/build/building-with-ai "mention") 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](https://swallow-1.gitbook.io/swallow/test/creating-new-tests "mention") 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](https://swallow-1.gitbook.io/swallow/test/creating-new-tests "mention") or [editing-tests](https://swallow-1.gitbook.io/swallow/test/editing-tests "mention") if you want to change the tests listed in this menu.

<figure><img src="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2F9YnzcHWRapF69fpgpWEQ%2FScreenshot%202024-05-13%20at%2015.37.17.png?alt=media&#x26;token=f27f1498-b47d-472d-919e-d06a67245322" 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](https://swallow-1.gitbook.io/swallow/build/outputs "mention") will show in the results here.

<figure><img src="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2F9K6ZiZnFTFJeFU3duqIk%2FScreenshot%202024-05-13%20at%2015.37.31.png?alt=media&#x26;token=9a8990a2-b9cb-4315-a32a-59b1b6746c49" 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="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2F8vdPlnpIHkM8fLmjrTAg%2FScreenshot%202024-05-13%20at%2015.37.49.png?alt=media&#x26;token=a091426c-9700-467e-adf5-862fe058a353" 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="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2FcAB43IOlNvUDU8v4Z9Gi%2FScreenshot%202024-05-14%20at%2008.22.01.png?alt=media&#x26;token=a3805f2e-7da5-41ec-80f5-2d6df0629f38" 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="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2FEfEYQ1lOQYSTfJCMn1ua%2FScreenshot%202024-04-29%20at%2013.08.23.png?alt=media&#x26;token=fd52d733-43bd-4a79-ae71-b0b57b51ebce" alt="" width="86"><figcaption><p>Expression parsing successfully</p></figcaption></figure>

<figure><img src="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2FpINbeD6sY3A1qZExQJu8%2FScreenshot%202024-04-29%20at%2013.08.10.png?alt=media&#x26;token=5169fb82-b9c0-4c77-b421-6dbee973ee24" 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="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2FBQOZhCsDmGBzzp56cgmj%2FScreenshot%202024-05-14%20at%2008.23.12.png?alt=media&#x26;token=4e46df82-3066-4d98-92d6-52939cfeeb70" 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="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2F19heITmeJvT7ZDYhEspV%2FScreenshot%202024-04-29%20at%2014.29.13.png?alt=media&#x26;token=96ee390b-959d-4e4a-b029-3f6f61fe66e8" alt="" width="299"><figcaption><p>Test data in the bottom left corner of the sidebar</p></figcaption></figure>
