Zucchini Rules for VS CodeExplore your Zucchini business rules, see which scenarios cover them, and run those scenarios without leaving your editor. When coverage is missing, ask AI to generate passing, failing, or exploratory scenarios.
Get started
Requires VS Code 1.95 or newer. To run scenarios, CTest must be available on your PATH, or configured in the extension’s settings. Build your project with your usual tools; the view updates when reports change. For help setting up reports, see the rules setup guide. Explore your rulesThe view shows one fixture at a time. Its first row names the selected fixture; select that row, or the package button in the view toolbar (Zucchini: Select Fixture), to choose another. The choice is kept per workspace. Editor highlights and hovers cover every fixture, whichever one is selected. The View menu in the view toolbar switches between three views:
While the Zucchini view is visible, the editor highlights observed lines in blue
and assertions not tied to a requirement in amber, in either view. In data
tables, each cell is highlighted on its own: blue when a rule covers it, amber
when no rule claims it, and gray when the step definition ignores its column. A
table step stays amber while any of its cells is not tied to a requirement.
Hover a line or cell to see what it covers, that no requirement claims it, or
that it is ignored. Hovers list observations from the strictest requirement to
the loosest, each with a badge showing its
declared strictness;
an obligation's tooltip in the tree shows it too. Set
Zucchini: Strictness Colors ( Use the funnel button in the view toolbar to open VS Code's native Find field inside the tree. Its filter toggle switches between highlighting matches and hiding nonmatching rows. The funnel expands and loads branches first so the native filter can evaluate the nested hierarchy. Press Escape to close the field. Click a scenario to open its feature file. While the Zucchini view is visible, steps with rule observations are highlighted. Hover over them for details. Coverage tells you that a scenario exercised an obligation during discovery. Run the scenario to check whether it passes. Run scenariosClick the play button beside a scenario, obligation or rule, or in the view toolbar for every scenario of the selected fixture. Results appear in the sidebar; detailed output is available in the Zucchini output channel. Starting a run, AI action, or manual refresh clears the previous output. The view also picks up results from runs outside the extension. After you edit a scenario, save and rebuild your project before running it here. New scenarios appear as Awaiting discovery until then. Older results are marked stale when they no longer match the current scenarios. Generate scenarios with AIClick the sparkle button beside a rule or obligation and choose:
Choose a model when prompted. You’ll need a language model provider in VS Code that supports extension requests, such as GitHub Copilot Chat. Authentication and any charges are handled by your provider. Generation sends the selected rule, feature files, step definitions, and the fixture header with its quoted includes to your chosen provider, from the editor. Save fixture context before generating so validation uses the same source. This context helps the model use your existing steps and understand the behavior it should test. The model can also explore your workspace while it generates: it can list, search,
and read files, so it follows declarations into implementation files such as Generated additions are saved to feature files. The extension builds only the fixture executable's CMake target and its dependencies in the existing build directory, rediscovers tests, and runs the new scenarios with CTest. Passing scenarios should pass; failing scenarios must expose implementation defects against the business rules and should fail against the declared requirements. Exploratory scenarios exercise behavior without requiring either outcome. Discovery rejection and build errors do not count as intended failures. The build is incremental ( Build and test diagnostics go back to the model for revision when the requested
outcome is not reached. Set Find failing scenarios for all obligationsClick the bug button in the view toolbar for the selected fixture, or choose Find Failing Scenarios for All Obligations from a rule's context menu. You choose the model once for the whole run, and you can cancel it at any time. Each fixture gets one model request per iteration:
When the run ends, the Zucchini output channel lists each fixture's scenarios. For each one, it shows the claimed obligations and either the rationale (confirmed) or the reasons it was not confirmed. It also lists the obligations with confirmed failing scenarios and how long each fixture took. Unconfirmed scenarios from the last iteration stay in the feature files for review. If a fixture cannot be prepared (for example, its manifest or build directory is missing), the run reports the error and continues with the next fixture. If the model returns a reply the extension cannot use, the reply is shown in the output channel and the model is asked once to correct it. Progress and completion appear as notifications. The model’s explanation is available in the Zucchini output channel. Running scenarios and generating with AI require a trusted workspace. Settings and helpSearch for Zucchini in VS Code Settings to change the scenario count, report locations, grouping, or CTest path. Most projects can use the defaults.
See the configuration and development guide for advanced settings and contributor instructions. Report problems on GitHub. Scenario runs and generation validation send the entire selection to one CTest
invocation. CTest runs with all processors available to the extension host by
default, while respecting test resource locks and scheduling properties.
Override the worker count or disable parallel execution in
Both scenario runs and generation validation save CTest JUnit output as
The extension also saves |