For the complete documentation index, see llms.txt. This page is also available as Markdown.

Capture a baseline

Learn how to capture a baseline tests for your endpoints.

A baseline is Kerno's record of how an endpoint behaves against your real running stack, and the reference point it uses to detect diffs on every future code change.

Prerequisites

Before you begin, make sure you have:

Step 1 — Generate a baseline plan

Ask your coding agent to implement a baseline for the endpoint you want to cover:

"Use Kerno to implement a baseline for POST /users"

Kerno analyzes the endpoint's code paths and plans the scenarios it needs to test across functional behaviour, edge cases, error handling, and auth.

You can ask Kerno to create a baseline for a whole file or your entire app:

"Use Kerno to implement a baseline for all endpoints in the users controller"

Kerno will resolve the right scope automatically and plan scenarios for every matched endpoint, pausing for your review before implementing.

Tip: Avoid targeting all endpoints if your app has a large number of them. Implementing scenarios for hundreds of endpoints at once can take several hours. Start with a specific file or controller, then expand coverage gradually.

For a full breakdown of how scopes work, see Scopes reference.

Step 2 — Review the plan

Kerno presents the plan before doing anything else. The plan lists the scenarios it will create and the behaviour each one covers.

Review it and give feedback directly: ask Kerno to adjust a specific scenario, add coverage for something missing, or skip scenarios you don't need. Kerno will regenerate the plan with your changes. Iterate until you are satisfied.

Tip: You can also let your coding agent review the plan and suggest improvements automatically. It will pass the feedback to Kerno and regenerate the plan without you having to do it manually.

Step 3 — Approve and implement

Once you are satisfied with the plan, approve it. Kerno implements the scenarios and runs them against your live stack. The real responses from your stack are captured as the baseline. Implementation takes around 5 minutes per endpoint, but can vary: simple endpoints with few scenarios finish in a couple of minutes, while complex ones with heavy state setup and cleanup can take up to 10 minutes.

After implementation, ask your agent to show you the results for any scenario. You can inspect what each one returned, including the full response payloads. For more detail, the scenario files under .kerno/scenarios/ show the full implementation: requests, assertions, state setup, and cleanup steps.

Tip: This operation run in the background. Avoid asking your agent for status updates every few seconds. Just wait for it to confirm completion.

What's next

Now that you have a baseline, you're ready to start validating changes. Every time your coding agent modifies an endpoint, Kerno will run the relevant scenarios against your real stack and report any diffs against the baseline. See Validate code changes to learn how.

Resources

Last updated