Notation
BT/Modern: a small textual notation for what a system does, and the picture it projects to.
Legend
- State / behaviourA component exhibits a behaviour or is in a state: SESSION [authenticated], TEMP [monitoring].
- EventAn occurrence or action on a component that triggers behaviour: USER :login, DOOR :opened.
- ConditionA predicate that decides whether the path beneath it applies: ? credentials-valid, ? temperature > 90C.
- Requirement tagThe requirement that justifies this behaviour. A node may cite several.
- Missing requirementBehaviour that seems necessary but that no requirement asks for. Replace it with an identifier once the requirement exists.
- Missing outcomeAn analysis overlay: a dashed ghost where a condition has only one outcome handled, joined by a dashed inferred flow.
A file
A leading comment names and describes the model. Requirements are one per line. Then the tree: a child is indented under its parent, drawn with box characters or plain spaces.
// Login
// A user logs in and a session opens when the credentials are valid.
R1: A user shall be able to log in.
R2: Valid credentials shall open a session.
USER :login #R1
└─ AUTH [checking] #R1
├─ ? credentials-valid #R2
│ └─ SESSION [authenticated] #R2
└─ ? credentials-invalid #?
└─ SESSION [rejected] #?Grammar
NODE := STATE | EVENT | CONDITION
STATE := COMPONENT "[" BEHAVIOUR "]"
EVENT := COMPONENT ":" NAME
CONDITION := "?" EXPRESSION
TRACE := "#" REQUIREMENT-ID e.g. #R1, #REQ-12
MISSING := "#?"
TREE := NODE TRACE* MISSING? COMMENT?
CHILDREN*
REQ := REQUIREMENT-ID ":" TEXT at the left margin, before the tree
COMMENT := "//" TEXTRules of thumb
- Model externally or logically significant behaviour, not implementation mechanisms. Mutexes, queues, retries and transactions belong in a design document.
- Prefer component-oriented statements:
COMPONENT [behaviour]. Use events for things that happen and states for things that hold. - Use a condition only when behaviour depends on a predicate, and write the other outcome as a sibling condition --
? validbeside? invalid-- so the decision is complete. - Attach requirement provenance wherever practical. Use
#?the moment behaviour is inferred but unspecified, and replace it once the requirement exists. - Add syntax only when a real class of requirements cannot be expressed with the core.
Simple sequence
A user logs in and a session becomes authenticated. The diagram raises the question the text leaves open: what if the credentials are invalid?
USER :login #R1
└─ AUTH [checking] #R1
└─ ? credentials-valid #R1
└─ SESSION [authenticated] #R1Conditional branching, complete
Both outcomes are specified. Two sibling conditions that are each other's negation are drawn as one decision with a yes and a no branch.
USER :login #R1
└─ AUTH [checking] #R1
├─ ? credentials-valid #R1
│ └─ SESSION [authenticated] #R1
└─ ? credentials-invalid #R2
└─ SESSION [rejected] #R2A system with analysis overlays
Start, run with monitoring, stop on overheating. The ordinary temperature-normal case is not modelled, and the overlay says so.
// Simple System
// A system that starts on request, monitors its temperature while
// running, and stops when it overheats. The "temperature normal" case is
// not modelled, which the analysis points out.
R1: The system shall initially be idle.
R2: When the user starts the system, it shall run.
R3: While running, the API shall listen for requests.
R4: While running, temperature shall be monitored.
R5: If temperature exceeds 90C, the system shall stop.
SYSTEM [idle] #R1
└─ USER :start #R2
└─ SYSTEM [running] #R2
├─ API [listening] #R3
└─ TEMP [monitoring] #R4
└─ ? temperature > 90C #R5
└─ SYSTEM [stopped] #R5
Questions a tree should answer
| Question | How to answer |
|---|---|
| What happens after event X? | Follow the descendants of the event. |
| What causes state Y? | Walk backward from the state. |
| What can component C do? | The Components panel lists every state and event of C. |
| Which requirement justifies behaviour B? | Read its #R tag. |
| Which behaviour lacks a requirement? | The #? nodes; the Analysis panel lists them. |
| What happens when a condition is false? | Look for a complementary sibling; the diagram draws a ghost where there is none. |
| Is a leaf intentional? | Confirm that termination is specified; the analysis notes every dead end. |