Skip to content

Review a synthetic HIL-style test log

Review a synthetic HIL-style log and distinguish its verdict counts from the evidence needed for a real hardware-in-the-loop release decision.

Test Tessa, your practice guide

Test Tessa
Record the input, rule, output and unresolved evidence before making a release or site decision.
Predict the reading, then compare it with the measurement.

Python 3 in your browser (JupyterLite)

Python · no install

Tier 2 · Web · paste-in setup · No account

Last tested October 2026.

Open the notebook in your browser and run each Python cell; no install or account is needed.

Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.

Open in your browser (new tab)

Steps

The tool may have moved on since the screenshots were taken — the text steps are the contract.

  1. 1 Step 1

    Do
    In the notebook editor, run step 1 in the notebook and inspect the labelled synthetic test log.
    You will see

    Run the cell. You should see:

    • The log shows requirement, input, verdict and duration for 10 seeded entries.
    Why it matters
    Requirement and input identifiers are necessary before a pass or fail rate can be interpreted.
    Code for step 1
    #!/usr/bin/env python3
    """Synthetic HIL-like log review; this does not operate any hardware."""
    import argparse
    import random
    from collections import defaultdict
    SEED=520
    FIXTURE=[('R1','boot', 'PASS'),('R1','boot','PASS'),('R1','boot','PASS'),('R2','brownout','PASS'),('R2','brownout','FAIL'),('R2','brownout','PASS'),('R2','brownout','FAIL'),('R3','bus-stuck','PASS'),('R3','bus-stuck','FAIL'),('R3','bus-stuck','FAIL')]
    def records():
        rng=random.Random(SEED)
        return [(req,inp,result,round(100+rng.randrange(0,31),1)) for req,inp,result in FIXTURE]
    def counts(rows):
        out=defaultdict(lambda:{'PASS':0,'FAIL':0})
        for req,inp,result,ms in rows: out[req][result]+=1
        return out
    def flaky(rows):
        grouped=defaultdict(set)
        for req,inp,result,ms in rows: grouped[(req,inp)].add(result)
        return sorted(key for key,verdicts in grouped.items() if len(verdicts)>1)
    def run_step(n):
        rows=records(); summary=counts(rows)
        if n==1:
            lines=['SYNTHETIC test log, seed=520; NO HARDWARE RUN','run requirement input verdict duration_ms']+[f'{i:>3} {req:>11} {inp:>9} {verdict:>7} {ms:>8.1f}' for i,(req,inp,verdict,ms) in enumerate(rows,1)]
        elif n==2:
            lines=['Per-requirement verdict counts','requirement PASS FAIL total']+[f'{req:>11} {v["PASS"]:>4} {v["FAIL"]:>4} {sum(v.values()):>5}' for req,v in sorted(summary.items())]
            lines.append(f'all requirements passing={all(v["FAIL"]==0 for v in summary.values())}')
        elif n==3:
            lines=['Repeated identical-input verdicts','requirement input verdicts']
            for req,inp in flaky(rows): lines.append(f'{req:>11} {inp:>9} PASS and FAIL')
            lines += [f'flaky input groups={len(flaky(rows))}','Action: reset rig, rerun with identical firmware and input.']
        elif n==4:
            lines=['Evidence inventory: synthetic records only','board serial: MISSING','firmware hash: MISSING','harness wiring and calibration: MISSING','reset and timing trace: MISSING','raw pin or bus observation: MISSING','No hardware-in-the-loop claim is supported.']
        elif n==5:
            total_fail=sum(v['FAIL'] for v in summary.values())
            lines=['RELEASE DECISION: HOLD',f'failed runs={total_fail} across {len(summary)} requirements',f'conflicting repeated-input groups={len(flaky(rows))}','Rerun R2 and R3 on a real, identified board and rig.','Record firmware hash, controlled reset, timestamps and raw output.','Review failures and retest before release.','LIMIT: synthetic log review is not itself HIL.']
        else: raise ValueError('step must be 1..5')
        lines.append(f'STEP {n} complete'); print('\n'.join(lines))
    
    run_step(1)
    JupyterLite notebook step 1 showing executed Python and the observed output.
    Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.
  2. 2 Step 2

    Do
    In the notebook editor, run step 2 in the notebook and inspect the per-requirement count table.
    You will see

    Run the cell. You should see:

    • The table prints pass and fail counts for each of three requirements.
    Why it matters
    A total pass rate can hide a requirement that still has a failed run.
    Code for step 2
    run_step(2)
    JupyterLite notebook step 2 showing executed Python and the observed output.
    Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.
  3. 3 Step 3

    Do
    In the notebook editor, run step 3 in the notebook and inspect the repeated-input verdicts.
    You will see

    Run the cell. You should see:

    • The same R2 brownout input has both PASS and FAIL, and is flagged flaky.
    Why it matters
    Conflicting repeated verdicts demand a controlled rerun and a reset check.
    Code for step 3
    run_step(3)
    JupyterLite notebook step 3 showing executed Python and the observed output.
    Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.
  4. 4 Step 4

    Do
    In the notebook editor, run step 4 in the notebook and inspect the evidence inventory.
    You will see

    Run the cell. You should see:

    • The record identifies missing board, firmware, harness, reset, and timestamp evidence.
    Why it matters
    Without the boundary and reset record, the verdict cannot be attributed to a repeatable HIL run.
    Code for step 4
    run_step(4)
    JupyterLite notebook step 4 showing executed Python and the observed output.
    Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.
  5. 5 Step 5

    Do
    In the notebook editor, run step 5 in the notebook and inspect the release decision.
    You will see

    Run the cell. You should see:

    • The decision is HOLD and names the failed requirement, flaky input and missing evidence.
    Why it matters
    A release gate must state what to rerun and what evidence would change the decision.
    Code for step 5
    run_step(5)
    JupyterLite notebook step 5 showing executed Python and the observed output.
    Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.

Chapter checks

These questions refer to the chapter’s examples. Use the return links to review their answers.

  1. What distinguishes hardware-in-the-loop testing from running the firmware as a program on a developer's host machine?

    Return to the chapter’s knowledge check
  2. A HIL test reports that recovery after an interrupted operation works, but the rig cannot reliably return the device to a known state between runs. How should you treat the result?

    Return to the chapter’s knowledge check

Caution

Before you start

Read this before you start.

This is a synthetic evidence review, not a hardware-in-the-loop test; no board, rig, timing, reset, or field behaviour was measured.

Technical details
Version tested
Version tested: Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium 148.0.7778.96; captureSource playwright:jupyterlite. Date: 2026-10-08.
QR code that opens the Review a synthetic HIL-style test log lab page
Open this lab online: https://iotclass.org/labs/hil-evidence-review.html

Return to Hardware-in-the-Loop IoT Tests · Browse Labs