TutorialMay 15, 2026 · 7 min read

Structuring Your Knowledge Base for Accurate AI Test Generation

The quality of your generated tests is directly proportional to the quality of your knowledge base. Here's how to write one that produces tests you'd be proud to commit.

When teams first try SentinelFlux, the most common question is: "How detailed does my knowledge base need to be?" The answer is: specific enough that an AI reading it could describe your application accurately to someone who's never seen it.

The three-file structure

A well-structured knowledge base for a single product typically has three files: application.yaml for the product overview and modules, ui_pages.yaml for page-by-page UI descriptions, and api_specs.yaml for API endpoints. You don't need all three upfront — start with what you have.

application.yaml: the product overview

This is your anchor file. It tells SentinelFlux what the product does, what modules exist, and what testing domains to target. The more precise your module list, the better the coverage:

product
: orangehrm
version
: "6.0"
description
: HR management system for leave, recruitment, and employee data
modules
:
- name: leave_management
description: Apply, approve, and balance leave requests
domains: [web, api]
priority: high

ui_pages.yaml: be specific about forms and fields

This is where most teams underspecify. The AI needs to know field names, input types, validation rules, and expected behaviours — not just page names. Vague descriptions like "the login page" produce vague tests. Specific descriptions produce specific tests.

For each page, list: the page URL or route, every form field with its type and validation, the expected success and failure states, and any business rules that govern the form's behaviour.

What to avoid

  • Don't describe UI implementation details (CSS classes, IDs). SentinelFlux crawls the live app for those.
  • Don't repeat yourself across modules. If authentication is described in one place, reference it rather than copying.
  • Don't over-specify test scenarios — describe the application behaviour, not the tests. The AI derives test cases from behaviour descriptions.
  • Don't leave out error states. What happens on invalid input? Empty required fields? Duplicate records? These are your best bug-finding tests.

Starting small

You don't need a complete knowledge base to start. Begin with your highest-risk module — the one that breaks most often or carries the most business impact. A thorough description of one module will generate more useful tests than a shallow description of the whole product.

Once you run your first sentinelflux generate, review the generated test docs. They're a direct reflection of how well the AI understood your KB. Gaps in the docs reveal gaps in your descriptions — tighten those, regenerate, and the tests improve accordingly.