MBSE iNsightsMBSE iNsights

· 8 min read

When a Requirement's Subject Is a Connection

Some requirements are not about any one part. In SysML v2, a connection can be a named thing in the model, with ends on several parts, and a requirement can take it as its subject. With textual and graphical notation from the Fish On! model.

Most requirements are about one thing. The sensor shall draw no more than 2.5 µA asleep. The base station shall ignore alerts from another kit. Each one has an owner, and that owner can check it alone.

Some of the most important requirements are not like that. Take the Fish On! rod sensor system, the running example in Models That Answer. A sensor on each fishing rod wakes when a fish bites and sends a radio packet. A base station on the bank receives it and forwards it to the angler’s phone. The phone raises the alarm. The angler’s need is simple: the phone announces a bite within half a second of the sensor waking.

Which part is that requirement about? Not the sensor: it spends only part of the half second. Not the base station, and not the phone. The half second is spent in three units built by three engineers, and no single one of them can meet it, or break it, alone. The requirement is about the path through all three.

SysML v2 lets you say exactly that. The path becomes a named element in the model, with an end on each of the three parts, and the requirement takes it as its subject.

How the alert moves: ports and interfaces

Start with what an engineer would draw first. Each unit has a port where the alert crosses its boundary, and each crossing is an interface between two ports. In the Rev B kit, the rod sensor’s LoRa uplink connects to the base station’s, and the base station’s app link connects to the phone’s:

interface lora1 : LoRaLink connect rod1.uplink to base.uplink;
flow of BitePacket from rod1.uplink to base.uplink;
interface wifi1 : AppConnection connect base.appLink to phone.baseLink;
flow of AppMessage from base.appLink to phone.baseLink;
A SysML v2 interconnection view. Three part usages in a row: rod1 : RevBRodSensor, base : RevBBaseStation and phone : IosApp. rod1's port uplink : LoRaUplink connects to base's port uplink : ~LoRaUplink by the interface lora1 : LoRaLink, with a BitePacket flow. base's port appLink : AppLink connects to phone's port baseLink : ~AppLink by the interface wifi1 : AppConnection, with an AppMessage flow.
How the alert moves in the Rev B kit. lora1 and wifi1 are interfaces between ports; each carries a flow, drawn on the connection and labeled with its payload.

That picture answers how the alert gets from the rod to the phone. It can’t hold the half-second requirement, though. lora1 is only the first hop and wifi1 only the second, and neither one includes the time the rod spends waking up or the time the phone spends raising its alarm. The requirement needs a single element that stands for the whole route.

The path is a connection definition

In SysML v2, a connection joins things, and a connection definition says what kind of joining it is. Most connections have two ends, but a connection definition can have as many as the thing it describes needs. The bite’s route has three:

connection def AlertPath {
    doc /* The route one bite takes: a rod sensor, the base station, a phone. */
    end part rod : RodSensor;
    end part base : BaseStation;
    end part app : PhoneApp;
}

Each end names a role and says what fills it. The rod end is a rod sensor, the base end a base station, the app end a phone app. Those are the same part definitions the rest of the model uses, and each one carries the timing attribute its engineer owns. The rod sensor’s alertTime covers waking, reading the accelerometer and transmitting; the base station’s forwardTime covers validating the packet, forwarding it and sounding the alarm; the phone’s notifyTime covers parsing the message and raising the alarm screen.

part def RodSensor :> LoRaNode, BatteryPowered {
    // ...
    attribute alertTime : ISQ::DurationValue;
    // ...
}
part def BaseStation :> LoRaNode {
    // ...
    attribute forwardTime : ISQ::DurationValue;
    // ...
}
part def PhoneApp {
    attribute weakAfter : ISQ::DurationValue;
    attribute notifyTime : ISQ::DurationValue;
    // ...
}

Two things about AlertPath are worth noticing.

  • It is a connection, not an interface. An interface’s ends are ports, and it holds two ports to a contract about what crosses between them. The ends of AlertPath are whole units, so it cannot be an interface. It carries no items at all. It exists so that something can be said about the route as a whole.
  • It is a definition because it is reused. Every rod in the kit has its own route to the phone, and every revision of the kit has its own routes. One definition describes them all.

The requirement takes the path as its subject

A requirement’s subject is the thing it constrains. Every expression in the requirement reaches the design through it. Usually the subject is a part. Here it is the path:

requirement <'FO-R02'> biteToAlertLatencyLimit {
    doc /* The phone announces a bite within 0.5 s of the sensor waking. */
    subject path : AlertPath;
    frame biteToAlertLatency;
    require constraint {
        path.rod.alertTime + path.base.forwardTime + path.app.notifyTime <= 0.5 [s]
    }
}

Read the constraint from left to right. path is the subject. path.rod is the rod sensor at the path’s rod end, so path.rod.alertTime is that sensor’s alert time. The same goes for the base station’s forward time and the phone’s notify time. The constraint adds one number from each end and compares the sum with half a second.

That one line does three things a shall-statement cannot:

  1. It names the thing the requirement is about. Not “the system,” and not a document’s section heading: the route from one sensor, through the base station, to one phone.
  2. It gives each engineer exactly one number to own. The firmware engineer owns alertTime and forwardTime, and the software engineer owns notifyTime. Nobody owns the sum. The requirement does.
  3. It can be evaluated. Every term is an attribute the model declares, so a tool can read the values and do the arithmetic.

The frame line ties the requirement to the stakeholder concern it serves, the angler’s need to know about a bite in time.

The assembled system holds a real path

The definition describes every route. The Rev B kit, as assembled, has a real one, and it gets a name:

part revB : FishOnSystem {
    part :>> base : RevBBaseStation;
    part rod1 : RevBRodSensor :> sensors;
    // ... rods 2 to 4
    part phone : IosApp :> apps {
        attribute :>> weakAfter = 30 [s];       // the app's threshold
        attribute :>> notifyTime = 0.25 [s];
        // ...
    }
    // ...
    connection path1 : AlertPath connect (rod ::> rod1, base ::> base, app ::> phone);
}

satisfy biteToAlertLatencyLimit by revB.path1;

path1 is a connection usage typed by AlertPath. Its connect list binds each end to a part in the kit: the rod end to rod1, the base end to the base station, the app end to the phone. The Rev B designs supply the values: the rod sensor’s alertTime is 0.05 s, the base station’s forwardTime is 0.1 s, and the phone’s notifyTime is 0.25 s.

Then comes the line that makes this interesting. The thing that satisfies the requirement is not a part. It is revB.path1, the connection.

A SysML v2 general view. At the top, the requirement FO-R02 biteToAlertLatencyLimit with compartments: subject, path : AlertPath; require constraints, path.rod.alertTime + path.base.forwardTime + path.app.notifyTime <= 0.5 [s]. Below it, the connection usage path1 : AlertPath, with a «satisfy» edge up to the requirement and a defined-by edge to the connection definition AlertPath, whose ends compartment lists rod : RodSensor, base : BaseStation and app : PhoneApp.
The whole route as its own element. The connection path1 is defined by AlertPath, whose ends are the three units, and it satisfies FO-R02, whose subject is an AlertPath. The «satisfy» edge starts at the connection, not at any one part.

path1 sits beside lora1 and wifi1 in the same kit, but it is a different kind of element. The interfaces join ports and carry the packets. path1 joins the three units themselves, carries nothing, and exists so that one requirement can be about the whole route.

Asking the model whether the path closes

Because the requirement is a constraint and the path’s ends carry values, the claim can be checked. The Semantic SysML Reasoner does it in one question:

ssr ask FishOn.sysml -- "does revB.path1 satisfy biteToAlertLatencyLimit"

ENTAILED — Yes. revB.path1 meets biteToAlertLatencyLimit, and every constraint
it states was evaluated against stated values.
  revB.path1  [INFERRED]  every required constraint holds of it

The reasoner followed the path’s three ends to the rod, the base station and the phone, read one duration on each, added them, and compared the sum with 0.5 s: 0.05 + 0.1 + 0.25 is 0.4, with 0.1 s to spare. That is the integration engineer’s question answered without a spreadsheet. It is satisfaction on paper, not verification. A bench test on real hardware is what turns it into evidence.

The path also exposes a problem that a part-by-part requirement would hide. The product specification has its own latency requirement: ”< 500ms from TCP receipt to alarm screen.” Read it carefully and it covers only the last stage, the phone. A phone that took 0.45 s would meet the specification and still break the angler’s half second, because the sensor and the base station had already spent 0.15 s. Written against the path, the specification’s 500 ms turns out to be what it really is: an allocation that is looser than the budget it belongs to.

The same idea works with two ends, and in the Fish On! model it caught a real bug. The rod sensor sends a heartbeat every 300 seconds to save its coin cell. The phone app marks a rod weak when it hasn’t heard from it in 30 seconds. Each engineer made a reasonable choice. Together, they mean that on the first night out, the angler sees four perfectly healthy rods marked weak.

That requirement isn’t about the sensor or the app either. It’s about the relationship between them, so its subject is a connection named link:

connection def StatusLink {
    doc /* The phone app showing the connection status of one rod. */
    end part rod : RodSensor;
    end part app : PhoneApp;
}

requirement <'FO-R01'> honestConnectionStatus {
    doc /* A rod that is reporting on schedule is never shown as weak. */
    subject link : StatusLink;
    frame trustTheStatus;
    require constraint {
        link.app.weakAfter > link.rod.heartbeatInterval
    }
}

The Rev B kit connects each rod to the phone with a status link, connection status1 : StatusLink connect rod1 to phone;, and claims each one satisfies the requirement. The reasoner disagrees:

ssr ask FishOn.sysml -- "does revB.status1 satisfy honestConnectionStatus"

CONTRADICTED — No. revB.status1 is claimed to satisfy honestConnectionStatus and
breaches it.
  revB.status1  [ASSERTED]  claimed to satisfy honestConnectionStatus, and does
                            not

Thirty seconds is not greater than three hundred. The model claims something its own numbers refute, four times, once for each rod. Neither engineer could have found it alone, because each one’s number is fine on its own. Only a requirement whose subject spans both of them could see it. In the Rev C kit, the phone’s threshold becomes 960 seconds, three missed heartbeats plus margin, and the same question comes back ENTAILED.

Modeling a cross-cutting requirement in your own model

  1. Ask who could break it alone. If the answer is “nobody,” the requirement isn’t about a part. It’s about something that spans parts.
  2. Model that something as a connection definition, with one end for each unit involved. Use a connection, not an interface, when the ends are whole units rather than ports.
  3. Give each end the attribute its owner controls. One attribute, one owner. An allocation that two people own is one that neither defends.
  4. Make the connection the requirement’s subject, and write the constraint through its ends: path.rod.alertTime, link.app.weakAfter.
  5. Name the real connections in each design, connect their ends to the real parts, and claim satisfaction on the connection, not on one of its parts.
  6. Give the test the same subject. In the Fish On! model, the bite-to-alert bench test’s subject is an AlertPath, which also says where the test runs: at the system’s edge, from a tap on the rod to the phone’s alarm.

A requirement whose subject is a connection is the model’s way of saying “this is an interface concern.” Interfaces are where projects lose time, because each side is checked by someone who looks mostly at their own. Giving the space between the parts a name, and a requirement of its own, means someone finally owns it.

Going further

Chapters 5, 10 and 14 of Models That Answer: A Practitioner’s Guide to Model-Based Systems Engineering with SysML v2 build these connections, the requirements written on them, and the latency budget across the whole Fish On! kit. For the subject itself, one idea on two facing pages, see spread 32 of SysML v2 at a Glance. For the ports and interfaces these paths run over, see Ports and Interfaces in SysML v2.

Get the next article by email

One email when a new article goes live, usually Thursday morning. SysML v2 and MBSE practice, no filler. Unsubscribe with one click.

More of this, on video

Walkthroughs in SysML v2 and MBSE tooling, with the model on screen.

Subscribe on YouTube