Using Kitsune

Test cases

Test cases from your specs and briefs, coverage per requirement, Gherkin steps, a traceability matrix and export to Xray, TestRail and Azure Test Plans.

The Tests tab on the project page shows the test cases your specs already describe. Kitsune reads them from the project folder on your computer and sends nothing to Kitsune's server.

Where test cases come from#

Pick a Scope at the top of the tab:

  • Specs (OpenSpec projects): every #### Scenario: of the main specs in openspec/specs/ is one test case, with its requirement and its WHEN, THEN and AND lines as steps.
  • Change <name>: the scenarios of the change's ADDED and MODIFIED requirements, and the change's acceptance criteria from proposal.md. Removed requirements give no test case.
  • Work unit <name> (Kitsune-docs projects): the acceptance criteria of the unit's spec.md.

Each acceptance criterion is one test case. Its error or alternative case (the item under it) is a second one. EARS keywords turn into steps: While and Where become Given, When becomes When and "shall" becomes Then. An If … then criterion is an error case.

An open test case quotes the requirement it checks. Open in spec shows that spec in the reader.

The Tests tab: coverage counts, requirements with their test cases, and an open test case with its steps

Every test case has an id such as TC-3f9a1c02, built from where it comes from. A scenario keeps its id when its change is archived into the main spec. Rename the scenario or its requirement and it gets a new id. Copy id lets you paste the id into a ticket or a test.

Coverage#

Above the list, the tab counts the requirements in the scope. It also counts how many have no test case, no error case, or a test case whose spec changed. Choose a count to show only those requirements, and choose it again to show all. An error case means the same as in Check: a scenario about an error, a rejection, a failure, "invalid", "denied", "not found" or "already", or an IF in the requirement.

Steps and test data#

Edit steps opens a test case's steps as Gherkin lines. Write one step per line (Given, When, Then, And, But, in any letter case) and data tables as | name | value | rows under a step. On Save, Kitsune checks every line and points to any line that is not a step.

Saved steps go to a Gherkin file next to your specs, never into the spec itself:

  • openspec/test-cases/<capability>.feature for a spec and for a change's scenarios of it;
  • openspec/test-cases/changes/<change>.feature for a change's acceptance criteria;
  • docs/test-cases/<work unit>.feature in a Kitsune-docs project.

Each saved test case is a Scenario tagged @tc:<id> and @spec-hash:…. You can also edit the file in your own editor. Kitsune changes only the scenario it saves and leaves the rest alone. If the scenario or criterion in the spec changes, the test case shows Spec changed with the new text. Update the steps, then choose Mark as reviewed. A saved test case whose scenario is gone appears under No longer in the spec, with Remove.

With your agent#

With a test case open, choose Ask agent for steps, or open the Assistant with ⌘J and choose Write steps and test data. The agent proposes steps with kitsune_propose_test_steps. They appear as a card with Apply, and Undo takes them back. Suggest missing cases replies with scenarios you copy into your spec, so you close the gap in the spec as well as in the tests.

Export#

Export saves the test cases in view (the scope and the coverage filter you chose):

Format What you get
Gherkin (.feature) One file, a Feature per spec, change or unit, each scenario tagged @tc:, @req: and @negative for error cases
Gherkin, one file per scenario A folder <project>-test-cases with one .feature file per test case, for tools that import one file as one test
Xray CSV Columns Test ID, Summary, Test Type, Labels, Description, Action, Data, Expected Result, one row per step, for the Xray Test Case Importer
TestRail CSV The Test Case (Steps) layout: Title, Sections Hierarchy, Type, Preconditions, References and the three step columns, one row per step
Azure Test Plans CSV The nine columns of the Azure DevOps bulk import, one row per step; Kitsune asks for the Area Path once per project

Given lines become the precondition. Each When starts a step, and the Then lines are its expected result. A test case title ends with its id in brackets, so you can find it after the import. CSV files are UTF-8 with a byte order mark (Excel then shows accents correctly), with commas and quoted values.

Traceability matrix#

Switch the tab from Cases to Matrix to see where each requirement in the scope comes from and how far along it is. The scope stays the same when you switch, and the address keeps mode=matrix.

The Matrix view: gap filters, and one row per requirement with its change, tasks, issues, test cases and status

Each row shows:

  • Change: in Specs, the newest archived change whose delta spec added, modified or renamed this requirement, and every active change that modifies, removes or renames it now, marked Active. A requirement that no change names shows No change. In a change's scope it is that change; in a work unit's scope, that unit.
  • Tasks: done of total in that change's tasks.md (a unit's plan.md), counted the way Progress counts them: ticked, or linked to an issue closed as completed. The count covers the whole change rather than one requirement.
  • Issues: the issues linked in those tasks, with Open, Done, Not planned or Not checked, from the last check on this computer. Refresh asks GitHub, GitLab or Jira again. Offline, the last checked states stay.
  • Test cases: their ids, Spec changed where saved steps are out of date, and No error case when the requirement has none.
  • Status: Traced (a change, its tasks and issues done, test cases up to date), In progress (tasks or issues still open) or Gap, which names what is missing: No change, No test case, Spec changed.

Counts above the table filter the rows: with no change, without a test case, without an error case, with open tasks, with open issues, with a changed spec. Choose several to see rows that match any of them. Choose one again to clear it. Choose a change to open its tasks in the reader, a test case id to open it in Cases, or an issue to open it in your browser. In a narrow window each row becomes a card.

Export saves the rows in view as CSV (columns Capability, Requirement, Changes, Tasks, Issues, Test cases, Error case and Status) or as Markdown: a table under a header with the project, the scope, the filters, the date and the commit it was read at.

Plans#

The Tests tab, test cases, coverage, saved steps and the traceability matrix with its filters are free. Edit steps, steps from your agent, Mark as reviewed, Remove saved steps, test case export and matrix export need Solo Pro or the Team plan.