Fistron docs

fistron.io

Happy Path Story

Developers build it. Fistron turns it into a test story, then into a test.

The developer knows what a new feature should do; the tester gets a diff and a ticket and has to work it out again. A Happy Path Story closes that gap: a short text of what must at least work, in plain words, that Fistron drafts from what the developer built. The developer does not write it, only checks and confirms it. It stays in the repository beside the code, and QE gets it with the request (ADR 0191).

A story has four parts, with no required syntax:

Before you start

For developers: draft it, check it, confirm it

When the feature works on your branch:

fistron happy-path draft

Fistron reads your change against its base (the commits, what is not committed yet, the new files), the ticket’s acceptance criteria when you give its reading (--ticket issue-reading.json from fistron issue read), and your project’s confirmed stories, so the draft is written in your team’s language. It writes the draft to docs/happy-path/<name>.md and commits nothing.

$ fistron happy-path draft --base main --no-model
Fistron: the Happy Path Story “A discount at checkout” drafted by template
  written to docs/happy-path/a-discount-at-checkout.md; nothing is committed
  0 cases it does not cover, for QE, in fistron-happy-path/happy-path-story.json
  the model was not asked: the template
  then: check docs/happy-path/a-discount-at-checkout.md, then: fistron happy-path confirm docs/happy-path/a-discount-at-checkout.md

Read the draft as you would a colleague’s description of your feature, and correct it. A model’s draft is labelled as one (drafted_by); what it could not know it leaves in brackets, and so does the template. Fill those in yourself, then confirm it:

fistron happy-path confirm docs/happy-path/a-discount-at-checkout.md
git add docs/happy-path/a-discount-at-checkout.md

The confirmation records who (--by, else git’s user), when, and what the story covers: the files and functions of your change, which Fistron watches later. Fistron refuses to confirm a story that still has a line in brackets. Commit the story with the change; the request carries it.

What the happy path does not cover

With every story Fistron lists apart, as suggestions for QE, what the story leaves out: the error states, the limits, the permissions, the upgrades, the settings and the combinations your change’s lines point at (an error raised, a check of a permission, a validation, a migration, a setting read). Each says where it comes from, Fistron’s rules or the model, and the line that suggested it. The list is never in your file: a story is the minimum that must work, never the whole of testing.

For QE: the story with the request

The review of the request (fistron review request, or Fistron’s review in your CI) reads the stories of its head and says:

What you see When
The story, with who confirmed it and when the change has a confirmed story
A draft offered in the review’s summary, with the command that keeps it a feature’s change without a story
happy_path_draft (a note) the change’s story is still a draft
happy_path_outdated (a note) the change touches what a confirmed story covers, but not the story
happy_path_missing (a warning, like missing evidence) your change policy requires a story, and a feature’s change has none

What the happy path does not cover is in the summary too, folded, for you to pick from.

In Fistron, the review’s page (Pull and merge requests › The results) has the tab The Happy Path Story beside The review: the story Fistron drafted, to Copy the story or Download the file, the change’s stories with who confirmed them, what may be outdated, and What this happy path does not cover. Its What to do now gives the command for your working copy; Fistron writes nothing to your branch.

For QE: the test from the story

With a confirmed story and your suite’s map (Map your suite and plan the missing tests), Fistron has the test written:

fistron happy-path test docs/happy-path/a-discount-at-checkout.md --suite-map <suite-map.json>

The test is written from your suite’s own step definitions and helpers; a step none of them does is written and labelled generated, for you to review closely. The feature is tagged @happy-path:<name> and names the story’s file, and your project’s rules for new tests apply. Fistron checks it, then fistron propose test --repository <owner/name> --record <record> opens it as a pull or merge request for you to review and merge, run in your CI (Get new tests proposed); Fistron never merges. Fistron never writes a test from a draft.

When your project has no end-to-end suite (a command-line tool with unit tests only), or you want a unit test, name a file the story covers:

fistron happy-path test docs/happy-path/pull-an-image.md --suite-map <suite-map.json> --unit acmectl/cmd/pull.go

The test is written beside the file’s tests, with your project’s own assert helpers (a Go project’s testutils.AssertEquals), and names the story in a comment. Go, Python and Java to begin with; the map names the unit tests under Unit tests of the product’s code. Without a scenario in the suite, a story’s test is a unit test of the first file it covers.

A step no test can take (a mail that arrives, a device, a person’s judgement) is left out of the test and written as a checklist, happy-path-checklist.md, each step with the evidence to keep. Do it as a manual verification.

The test’s record (Proposed tests, Documents) says how much of it your suite had already, each piece with where it comes from, the test, and the steps left By hand, and gives the command that proposes it.

The project’s stories are under Test plan › Happy Path Stories: each by its newest review, confirmed, a draft or possibly outdated, with the request it is in, its ticket and its test. The one to look at first is in What to do now.

Keeping it true

When a later change touches a file or a function a confirmed story covers and leaves the story as it was, its review says the story may be outdated, with the command that drafts it again:

fistron happy-path draft --name a-discount-at-checkout --update

The story is then a draft until it is confirmed again. A test that names a story (@happy-path:<name>) is said as possibly outdated when its story changes.

Require a story for new features (optional)

Off by default. A team turns it on in .fistron/change-policy.toml:

[happy_path]
directory = "docs/happy-path"
required = true
features = { labels = ["feature", "enhancement"], titles = ["feat"] }

A change is a feature’s when its request has one of the labels, or its title’s type is one of the titles (feat: ..., feat(cart): ...). Such a change needs a confirmed story, its own or one whose covers it touches. Without one its review reports happy_path_missing and offers the draft; the gate decides as for any other finding. The reference: happy-path.md.

Troubleshooting