Incremental Practice
Incremental Practice
Walkthrough: Designing the Pipeline Backward
- Start at the database, not the sensor. State what a trustworthy final record must contain, such as value, units, time, device identity, and quality, then make each stage supply its part.
- Define each boundary's contract. For every handoff, write what crosses it and in what form.
- Decide where calibration and unit conversion happen. On the device, at the gateway, or in the cloud, but exactly once and recorded.
- Make context travel with the value. Attach units, scale, timestamp, and identity early, and preserve them rather than reconstructing them later.
- Add integrity and delivery evidence. Error detection on the packet and acknowledgement on delivery turn "we sent it" into "it arrived intact."
- Test boundary by boundary. Inject a known input and confirm it survives each handoff unchanged in meaning.
Incremental Practice
Beginner
For a single temperature sensor, list the minimum context fields a final record needs to be trustworthy.
Intermediate
For a two-device fleet, decide where calibration is applied and justify doing it exactly once.
Advanced
Design a boundary-by-boundary test that proves a known input arrives unchanged in meaning at the database.
Try a known input, a noisy input, a value beyond the measured range, a delayed message, and a restart. Check the raw and converted records together. The receiver should distinguish a bad measurement from a damaged message and an old message from a new one.
Inspect Figure 2 in the chapter and look for the first boundary where identity, time, unit, or quality can be lost.
Trace Figure 2 in the chapter through the battery case. The reading starts as an analogue voltage. The front end scales and guards it before the ADC makes a code. Firmware turns that code into volts and applies the known correction. JSON or CBOR gives the reading a data form. MQTT or CoAP then adds the facts needed for transfer, and link proof shows if it arrived. Identity, time, unit, quality state, and version must stay with it at each handoff. The first edge where value or context goes wrong owns the fix, even if the screen shows the fault later.