Skip to content
Tactiverge

School/○ Innovator/Week 31

One connection at a time

Plug in five new subsystems at once and the rover drives in circles. Which of the five is to blame? You have no idea, and that is the problem.

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

Big-bang integration feels fast and is almost always slower. Adding one connection at a time, with a test that must pass before the next, turns 'something is wrong' into 'step 4 broke it'.

  • ◇ Plan an incremental integration with a test at each step.
  • ◇ Use stubs and recorded data to test a subsystem before its neighbours exist.
  • ◇ Diagnose which integration step introduced a fault.

2.Discover

Integrate in steps: run the route with no checkpoints, then with one checkpoint and fixed camera trust, then with three checkpoints, then switch to the Kalman filter. Record the final error after each step.

Can't use the interactive? Read a description instead

In the rover build, final position error falls as checkpoints are added one at a time; the learner records the error after each integration step and investigates any step that makes it worse.

3.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

In the worked example, which step should you investigate?

4.Apply it

Write an integration plan for your vacuum-cleaner robot with at least five steps. For each step, name the new connection, any stub used, and a test with a pass criterion.

Open BUILD 006: Engineer a Planetary Rover →

5.Understand

Integrate in increments

Order the connections so each step adds one subsystem or one link to a system that already works. Write the test for each step before you do it: what should improve, and by roughly how much? Do not move on until it passes.

Stubs and recordings

A stub stands in for a subsystem that is not ready: a fake planner that sends a fixed path, a fake sensor that replays recorded data. Stubs let each team test against the agreed interface early, and recorded data makes a test repeatable.

When a step fails

Undo the step, confirm the earlier state still passes, then re-add the new piece with more logging at its interface: units, timestamps, frames. Most failures at this point are contract mismatches, not bugs inside either subsystem.

Explain it another way

Assembling flat-pack furniture and checking it is square after each panel, instead of finding at the end that the first panel was upside down.

Worked example 1

Rover final errors after each step: no checkpoints 6.1 m; one checkpoint 2.4 m; three checkpoints 0.9 m; Kalman filter 1.7 m. What do you conclude?

The first three steps each helped. Switching to the Kalman filter made it worse, so investigate that step: check the noise settings it was given and the units of the camera fix, before blaming the filter itself.

Common mix-ups

  • If a subsystem worked alone, any failure after integration is in the other subsystem.
    ✓ Most integration failures are in the connection: units, frames, timing or assumptions both sides made.

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

What is a stub in integration testing?

Practice 3

Why is integrating everything at once usually slower overall?

Practice 4 · a fresh version every time

A robot must react to an obstacle within 80 ms. Camera exposure and readout take 12 ms, vision processing 25 ms, planning 10 ms, the message over the bus 4 ms and the motor driver 5 ms. How much slack is left, in ms? (Negative means over budget.)

ms

Practice 5

Why replay recorded sensor data when testing a new filter?

7.Predict

A rover's odometry, camera fix and Kalman filter are all new. What is the best order to integrate them?

Guess first. Being wrong here is how the surprise works.

8.Reflect

Concepts: System integration and interface contracts · Testing and debugging