Unit 04 · lesson

Bridge Checkpoint: Boundary Cases Matter More Than Syntax

You already know how to write boolean expressions. Here, the job is to prove what a robot-side rule does at the exact edge of a decision.

Assume the requirement says: warn when the measured range is below the caution distance.

Compare:

rangeMeters < cautionMeters

with:

rangeMeters <= cautionMeters

Those are different contracts at exactly rangeMeters == cautionMeters.

Build the evidence table

Use a caution distance of 0.50 m and predict before running:

rangeexpected resultreason
0.49warnbelow boundary
0.50no warn or warn, depending on contractboundary
0.51no warnabove boundary

Then compare your Java result with the written requirement, not with what you hoped the code meant.

Bridge question

A ROS parameter can provide a threshold value, but it does not define the Java method's comparison operator. The local code still owns the decision semantics unless an integration contract says otherwise.

Record one sentence for each layer:

  • Java evidence: what comparison ran?
  • ROS evidence: what threshold value was observed?
  • integration evidence: what proves the observed parameter actually reaches this method?

If you cannot explain < versus <=, reactivate the Java prerequisite. Do not expand this bridge into a beginner boolean lesson.