Agentic engineering

Test the journeys, not just the units

"Map every path a user can take" sounds impossible. It is, if you enumerate. Model it instead, and let coverage derive the tests.

Listen to this note
A state diagram with boxes for visit, login, error, dashboard, upload, show and done, joined by arrows.

Sooner or later someone asks for a complete view of every outcome the app can produce. It’s a reasonable ask. Taken literally it’s every role, times every account state, times every flow, times every input, and it’s out of date the day you type it. Classic journey maps are too soft to test against, and a literal list is impossible to maintain.

The answer is a model, not a list.

Model the states once

For each kind of user, build a small state machine. States are nouns: logged out, dashboard, uploading. Transitions are verbs: submit the login form, start an upload. Each transition lists every outcome the code can actually produce, where each one leads, and what side effect proves it happened. That side effect is the test’s oracle.

Then let a coverage rule derive the paths, instead of writing them by hand.

Kill the explosion in two places

  • Inputs collapse into classes. Not every email address, just valid and known, valid and unknown, malformed, empty. One representative per class.
  • Independent conditions combine in pairs. Testing every pair of access conditions takes a few dozen cases instead of thousands.

You still model everything. You just don’t turn everything into a test.

Turn the depth up only where it matters

Not every flow deserves the same depth. Settings toggles get one pass per transition. Login, uploads and anything with a PIN get pairwise coverage over their inputs. Payments and anything irreversible get the full set. Analytics tells you which paths people actually walk, so you spend tests where the traffic and the risk are.

One source of truth

The machine model is the authority. The human-readable journey map for stakeholders is generated from it. Tests link back to the model by a stable ID, so coverage is computed rather than tracked in a spreadsheet, and the list of uncovered transitions is the backlog. That link is what stops the map and the test suite drifting apart, which is how these efforts usually die.

It’s an agent job, with rules

Agents are good at building and extending these models, with one rule borrowed from docs: every transition cites the code it came from. A flow with no source is marked draft, never invented.