← Validation Lab Bench 1 · Temperature monitor I2CUARTPython simulator
Clean run STR-TMP-002: ready

Stage 02 · Plan

What we test, what we don't, in which order, and when we stop.

The STP follows the MIL-STD-498 and IEEE 829 structure. It lives in the repository as stp.yaml, next to the data it refers to, and this page is rendered from it.

STP-TMP-001 · v1.0 · Draft
item: TMP-MON 1.0
basis: SRS-TMP v1.1 (after review)

1 · Scope

Item
TMP-MON firmware on the Bench 1 simulator: I2C read, threshold and LED logic, UART formatter, fault handling.
Levels
System level through the device interfaces. Unit tests of the firmware belong to the developers and are out of scope.
References
  • SRS-TMP v1.1 · Requirements TMP-01 to TMP-07
  • Questions · Q1 to Q7 answered, Q8 to Q19 open
  • Coverage matrix · Requirements x 12 test classes
  • STD-TMP · One card per test case
  • RTM-TMP · Generated from results.json (T13)
  • ADR-001 to ADR-032 · Framework decisions
Assumptions
Answers to Q1 to Q7 from the spec review, until the system engineer confirms them. See the questions
  • Q8 Readings resume within 2 s after the sensor answers again, the same limit as the way into ERR SENSOR. TC-TMP07-UPG-01 and TC-TMP07-FI-02 use 2 s.
  • Q9 The LED compares the raw sensor value. The value on the line is rounded half away from zero: 80.5 °C gives TEMP 81, -0.5 °C gives TEMP -1. Python's round() uses banker's rounding (round(80.5) is 80), a known bug source at x.5.
  • Q10 -20 °C and 85 °C are inside the valid range: TEMP -20 and TEMP 85 are readings. The range check compares the raw value, the same as the LED, so 85.1 °C and -20.1 °C give ERR RANGE.
  • Q11 The ±50 ms limit applies to each interval only. There is no long-term limit, so TC-TMP02-STR-01 checks every interval over 12 h and nothing more.
  • Q12 Fail-safe. During ERR SENSOR the LED is on. During ERR RANGE above 85 °C it is on, below -20 °C it is off. At power-up it is off until the first reading. After an error the hysteresis continues from the LED state shown during the error: on after ERR SENSOR and after ERR RANGE above 85 °C, off after ERR RANGE below -20 °C. There is no memory of the state before the error. No case checks the LED in these states yet (TMP-04 UPG gap).
  • Q13 While an error lasts, one ERR message replaces each reading, every period. Until the answer, cards accept one ERR or one per period, and the period during an error is not checked (TMP-02 FI gap).
  • Q14 115200 baud, 8N1, each line ends with LF. -0.4 °C is sent as TEMP 0, -0.5 °C as TEMP -1, never TEMP -0. The simulator has no baud rate; the real lab uses these settings.
  • Q15 Outside 4.75 to 5.25 V the device may go silent or send an ERR line, but never a wrong reading or a corrupt line. Above 5.25 V the device is silent with the LED off. After the supply returns it sends its first reading within 2 s.
  • Q16 The LED follows a threshold crossing within 1.5 s, the value of the design's model card.
  • Q17 The device has no diagnostics beyond its UART lines and the LED. The OBS cards check the error lines only.
  • Q18 The device reads nothing on UART RX. With no input path, SEC is not applicable for the bench.
  • Q19 The first failed sensor read triggers ERR SENSOR. A single bus glitch therefore gives one ERR SENSOR line.

2 · Features to test, and not to test

To test

  • TMP-01 Accuracy across the range
  • TMP-02 Message period and its tolerance
  • TMP-03 Message format, negatives
  • TMP-04 LED thresholds and hysteresis
  • TMP-05 Supply band and brownout
  • TMP-06 Out-of-range handling
  • TMP-07 Sensor faults and recovery

Not to test here, and why

  • Physical sensor accuracy: needs a climate chamber and a reference thermometer (real-lab plan).
  • I2C electrical timing and signal quality: hardware, not visible to a simulator.
  • LED driver faults: hardware.
  • EMC and ESD: certification lab.
  • Security: no command or update interface in v1, and no input on UART RX (Q18 assumed).

3 · Approach

Works?

Equivalence classes, boundary values, state transitions for the hysteresis.

Every setup?

Smoke set at three supply levels. Format checked against the spec clause.

Under pressure?

Timing statistics, a 12 h soak on a virtual clock, fault injection: NACK, stuck SDA, brownout.

Protected, changed, seen?

Readings return after a range or sensor error. The error lines on the UART are the only diagnostics (Q17 assumed).

Automation
All P1 cases automated. Every code change runs all simulator cases, including the soak on a virtual clock, in about 2 minutes. The Linux bench runs on demand.
Coverage
The coverage matrix. Every requirement has at least one executed case before exit. Open the matrix
Defects
Severity = damage, priority = order of fixing. Every defect has a failing test before it is closed.

4 · Risks and priorities

priority = likelihood × impact · pick a risk
Risks by likelihood (rows) and impact (columns)
impact lowmediumhigh
high P2 P1 P1
medium P3 P2R4R5 P1R1R2R3R8
low P3R6 P3 P2R7

rows: likelihood high · medium · low

R1P1

The alarm switches at the wrong temperature

likelihood medium · impact high

Mitigation

Boundary values on both thresholds, one value above inside the range and one far below, and threshold oscillation.

Mitigated by

TC-TMP04-FUN-01 · TC-TMP04-BND-01 · TC-TMP04-BND-02 · TC-TMP04-NEG-01

Residual risk

Low on the simulator. Physical threshold accuracy stays open until the chamber run.

R2P1

An out-of-range value is published as a reading

likelihood medium · impact high

Mitigation

One value far outside the range and one step outside each edge.

Mitigated by

TC-TMP06-NEG-01 · TC-TMP06-BND-01 · TC-TMP06-BND-02

Residual risk

Low.

R3P1

A sensor fault is missed, or the device never recovers

likelihood medium · impact high

Mitigation

NACK and stuck SDA injected at known moments, the 2 s latency measured, recovery without a restart.

Mitigated by

TC-TMP07-NEG-01 · TC-TMP07-FI-01 · TC-TMP07-FI-02 · TC-TMP07-UPG-01 · TC-TMP07-PRF-01

Residual risk

Medium: only the simulated fault types are covered.

R4P2

The format breaks the host parser

likelihood medium · impact medium

Mitigation

The format regex runs on every message of every case, a clause check of negative values, and rounding checked at the half degree, including -0.4 °C.

Mitigated by

TC-TMP03-FUN-01 · TC-TMP03-CPL-01 · TC-TMP03-BND-01

Residual risk

Low, as long as the Q9 and Q14 assumptions hold.

R5P2

A brownout corrupts the output

likelihood medium · impact medium

Mitigation

Smoke set at three supply levels, one step outside the band, and a short supply dip.

Mitigated by

TC-TMP05-CFG-01 · TC-TMP05-BND-01 · TC-TMP05-FI-01

Residual risk

Medium: real PSU behaviour differs from the model.

R6P3

The period drifts over hours

likelihood low · impact low

Mitigation

A 12 h soak on the virtual clock checks every interval (soak level).

Mitigated by

TC-TMP02-STR-01

Residual risk

Low.

R7P2

Accuracy drifts over time

likelihood low · impact high

Mitigation

A 5-point sweep across the range and a 12 h soak at 25 °C.

Mitigated by

TC-TMP01-PRF-01 · TC-TMP01-STR-01

Residual risk

Medium: physical drift needs the chamber.

R8 (proposed)P1

Readings do not return after a range error

likelihood medium · impact high

Mitigation

Leave the range, return to it, and check that the first message after the return is a reading on the TMP-02 period.

Mitigated by

TC-TMP06-UPG-01

Residual risk

Low on the simulator.

5 · Environment

This bench · --target=sim

  • Python simulator of sensor and firmware
  • Fault injection: NACK, stuck SDA, frozen value, brownout
  • Ubuntu runner, pytest, the same framework as the lab

Real lab · --target=board · same tests

  • Climate chamber, -30 to +90 °C
  • Calibrated reference thermometer
  • Programmable PSU, 0 to 6 V
  • USB-UART adapter, I2C analyzer
  • USB relay for power cycles
Calibration
Equipment IDs and calibration dates are written into every STR. A result on an uncalibrated reference is not a result.

6 · Entry, exit, suspension

Entry

  • Build ID known and loaded
  • Bench preflight green
  • STD reviewed against SRS v1.1
  • Smoke green

Exit

  • EC-1 All P1 cases pass (checked by CI)
  • EC-2 Every requirement has an executed case (checked by CI)
  • EC-3 No open Critical defect (checked by CI)
  • EC-4 Soak within tolerance (checked by CI)
  • EC-5 Major defects only with a waiver (checked by people)
  • EC-6 STR reviewed (checked by people)

Evaluated on: clean firmware run, no seeded bug enabled.

Suspend · resume

Suspend if

  • Preflight fails
  • The build changes mid-cycle
  • 3 or more cases end in ERROR in one run
  • Any smoke case ends in ERROR

Resume when

  • The cause is fixed and the smoke level passes

See these criteria on the latest CI run →

7 · Deliverables and schedule

Deliverables
STD, RTM, STR per build, defect reports, logs and pcaps of failures
Per build
Every change: full simulator suite in one CI job. Linux bench on demand. STR frozen on the release tag.
Roles
Author and test owner: Stanislav Dmytrenko. Reviewer: a second test engineer. System engineer: answers the open questions.
Next: the coverage matrix →