Testing & Validation · Study deck

CI/CD Fundamentals for IoT

Imagine changing one line that controls a pump.

Test Tessa is your guide for this deck.

continuous-integrationcontinuous-deliverypipeline
Test Tessa, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • move a change through pipeline stages to a releasable candidate, repeatably
  • apply automated gates at each pipeline stage
  • explain what makes an IoT CI/CD pipeline different from a pure-software one
  • Explain: A fast test can catch a simple mistake, but the real device must still behave safely.
iotclass.org

Major section

Start With the Change That Must Ship

A fast test can catch a simple mistake, but the real device must still behave safely.

  • Continuous integration and continuous delivery (CI/CD) is a repeatable path that builds, checks, and records each change.
  • Firmware means the software stored inside the device.
  • A green early stage cannot replace a later physical check.
iotclass.org

Major section

Overview: From a Change to a Releasable Candidate, Repeatably

The source change establishes what must be traced; build, static analysis, and unit tests reject inexpensive defects first; simulation exercises modeled peripherals; and hardware-in-the-loop checks the real target and timing.

  • The final release decision therefore inherits a chain of increasingly physical evidence, connecting rapid integration feedback to an IoT candidate that is genuinely ready for a controlled rollout.
The CI/CD pipeline is an evidence path from a source change through build, static and unit checks, simulation, hardware-in-the-loop testing, and the release decision.
The CI/CD pipeline is an evidence path from a source change through build, static and unit checks, simulation, hardware-in-the-loop testing, and the release decision.
iotclass.org

Major section

Gate a Thermostat Firmware Change

For these CI/CD fundamentals, the thermostat pipeline can prove that the same source made the tested firmware artifact.

  • A unit test can check the 30 °C threshold.
  • Hardware-aware CI/CD fundamentals require a test that shows whether the real relay opens under load.
  • The physical power and relay interaction needs hardware validation.

Numbers to remember

30 °CA unit test can check the 30 °C threshold.
The CI/CD pipeline is an evidence path from a source change through build, static and unit checks, simulation, hardware-in-the-loop testing, and the release decision.
The CI/CD pipeline is an evidence path from a source change through build, static and unit checks, simulation, hardware-in-the-loop testing, and the release decision.
iotclass.org

Major section

Summary

The value is repeatable evidence and fast feedback, not automatic release.

  • A typical pipeline runs commit → build (per target) → static + unit → integration + hardware-aware → package + sign → release gate → staged delivery, each stage leaving evidence.
  • Automated quality gates stop a candidate that fails a required check; a gate is honest only when a skipped check is recorded with a reason and owner.
  • A build matrix compiles for every claimed target; the tested, approved, and shipped artifact must be the same bytes, promoted and verified by digest rather than rebuilt.
iotclass.org

Deck summary

Key takeaways

A fast test can catch a simple mistake, but the real device must still behave safely.

  • The source change establishes what must be traced; build, static analysis, and unit tests reject inexpensive defects first; simulation exercises modeled peripherals; and hardware-in-the-loop checks the real target and timing.
  • For these CI/CD fundamentals, the thermostat pipeline can prove that the same source made the tested firmware artifact.
  • The value is repeatable evidence and fast feedback, not automatic release.
iotclass.org

Retrieval practice

Recall check 1 of 3

Test Tessa says: answer from memory, then check your reasoning.

Q1What does a CI/CD pipeline primarily provide for an IoT project?

AA guarantee that any compiling change is safe to deploy to every device
BA way to skip testing because automation replaces the need for test design
CRepeatable evidence, fast feedback, and a gated release candidate.
DFaster over-the-air transfer speeds to devices
Show answer

Answer: C The point is a repeatable, traceable record and quick feedback on each change, with release controlled by a gate, not automation for its own sake.

iotclass.org

Retrieval practice

Recall check 2 of 3

Test Tessa says: answer from memory, then check your reasoning.

Q2A firmware change alters how rejected sensor readings are encoded for downstream consumers, but the CI record only shows the image compiled and the parser's unit tests passed. What is the strongest gate decision?

AApprove it because the parser tests already check the new status encoding against an expected value.
BHold until integration evidence shows the encoded output seen by downstream consumers.
CApprove it as long as the artifact carries a version label for release notes
DSkip the review, because CI/CD only concerns build automation and not contracts
Show answer

Answer: B The changed behavior is a consumer-facing contract.

iotclass.org

Retrieval practice

Recall check 3 of 3

Test Tessa says: answer from memory, then check your reasoning.

Q3To save time, a team's pipeline rebuilds the firmware image at deploy time from the same commit instead of shipping the exact artifact that passed the tests. Why is this risky for IoT, and what is the fix?

AThe shipped image may not match the tested artifact byte-for-byte
BRebuilding is acceptable because the source commit identifies the firmware under test.
CThe only risk is slower deployment, which more build servers would solve
DKeep the rebuild and compare version strings before sending the image to devices.
Show answer

Answer: A Rebuilding breaks the link between tested and shipped.

iotclass.org

Print reference

Answers

Answer key.

  1. C · The point is a repeatable, traceable record and quick feedback on each change, with release controlled by a gate, not automation for its own sake.
  2. B · The changed behavior is a consumer-facing contract.
  3. A · Rebuilding breaks the link between tested and shipped.
iotclass.org