# Test Your Code Changes

Kerno runs your updated code, compares the results with the baseline, and shows you any behaviour differences that appear. \
\
This flow is designed to give you fast feedback, a reliable safety net, and a clear understanding of how each change affects your system. Your tests remain useful without extra maintenance work since Kerno handles the analysis and updates for you.

{% hint style="info" %}
When you save your code changes, Kerno will update the index and restart your service. This might take a 10-20 seconds.
{% endhint %}

<figure><img src="/files/CHMKtXyNiZp82WXxNGqH" alt=""><figcaption></figcaption></figure>

### Run Tests After a Change

Once an endpoint has a baseline, every test run follows a clear flow:

1. Kerno executes all existing scenarios for the endpoint.
2. Kerno compares the new behaviour with the saved baseline.
3. Kerno highlights any behaviour that no longer matches what was recorded.

If everything matches, the run completes with no actions needed.

### Review the Diff

If the behaviour changes in any way, Kerno shows you a diff view. This can include changes in responses, status codes, sequence steps, or any other observable behaviour.

You can review the differences directly in your IDE and decide how to move forward:

* Accept the change if the new behaviour is correct.
* Update your code if the change is unintended.

Kerno never forces a decision. It shows the differences and waits for your choice.

### Accept the Diff

When you accept a change, Kerno updates the scenario to match the new behaviour. It then analyzes your code again to check if new scenarios should be added or if any old ones no longer apply.

This keeps your testing aligned with the current behaviour of your system.

### Fix your Code

If you decide the change is incorrect:

1. Update the code.
2. Run the tests again.
3. Kerno checks once more against the baseline.

{% hint style="info" %}
If you encounter issues or have questions, [message us on Discord](https://discord.gg/k8yA9tZdP9), and we’ll gladly help.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://kerno.gitbook.io/docs/user-manual/test-your-code-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
