Unit traceability means linking every test result to a specific serial number so you can reconstruct the full history of any device. TofuPilot captures this automatically when you run OpenHTF tests with serial numbers, giving you a searchable unit history page for every DUT.
Why Unit Traceability Matters
When a field failure occurs, you need to answer: what tests did this unit pass, when, on which station, and with what measurements? Without traceability, you're digging through spreadsheets and log files. With it, you type a serial number and get the full picture.
Regulatory frameworks like ISO 13485, AS9100, and IPC-1782 all require linking test records to individual units. TofuPilot stores this mapping automatically.
Capturing Serial Numbers in OpenHTF
OpenHTF uses a test_start trigger to capture the DUT serial number before any test phase runs. The simplest approach prompts the operator to scan or type the serial.
# Production test with serial number capture and TofuPilot upload
import openhtf as htf
from openhtf.util import units
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("voltage_output").in_range(minimum=4.8, maximum=5.2).with_units(units.VOLT),
htf.Measurement("current_draw").in_range(minimum=0.1, maximum=0.5).with_units(units.AMPERE),
)
def power_test(test):
test.measurements.voltage_output = 5.01
test.measurements.current_draw = 0.25
def main():
test = htf.Test(power_test)
with TofuPilot(test):
test.execute(test_start=lambda: input("Scan serial: "))
if __name__ == "__main__":
main()Every time this test runs, TofuPilot associates the measurements and pass/fail result with the scanned serial number. Run the same serial again and TofuPilot appends to its history.
Programmatic Serial Number Input
In automated lines, serial numbers come from barcode scanners or MES systems rather than operator input. You can pass the serial directly.
# Automated serial input from barcode scanner
import openhtf as htf
from openhtf.util import units
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("resistance").in_range(minimum=95, maximum=105).with_units(units.OHM),
)
def resistance_check(test):
test.measurements.resistance = 100.2
def main():
# Serial comes from your barcode scanner or MES integration
serial_number = read_barcode_scanner()
test = htf.Test(resistance_check)
with TofuPilot(test):
test.execute(test_start=lambda: serial_number)
if __name__ == "__main__":
main()Adding Unit Metadata
You can attach metadata to test runs for clearer unit history organization by production stage.
# Tag runs with production stage for clearer unit history
import openhtf as htf
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("firmware_version"),
htf.Measurement("boot_time").in_range(maximum=5.0),
)
def firmware_check(test):
test.measurements.firmware_version = "2.1.0"
test.measurements.boot_time = 1.8
def main():
test = htf.Test(firmware_check)
with TofuPilot(test):
test.execute(test_start=lambda: "SN-20260312-001")
if __name__ == "__main__":
main()Multi-Stage Unit History
Real production involves multiple test stages: ICT, functional test, burn-in, final QA. Each stage runs as a separate OpenHTF test with the same serial number. TofuPilot stitches them together.
# Each production stage uploads to TofuPilot with the same serial
import openhtf as htf
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("ict_shorts").in_range(maximum=0),
)
def ict_test(test):
test.measurements.ict_shorts = 0
@htf.measures(
htf.Measurement("functional_pass"),
)
def functional_test(test):
test.measurements.functional_pass = True
def run_stage(phase, serial):
test = htf.Test(phase)
with TofuPilot(test):
test.execute(test_start=lambda: serial)
def main():
serial = "SN-20260312-001"
run_stage(ict_test, serial)
run_stage(functional_test, serial)
if __name__ == "__main__":
main()Open the unit's page in TofuPilot's dashboard to see every test run, measurement, and pass/fail result for that serial number in chronological order. You can filter by procedure, station, or date range.
Viewing Unit History in TofuPilot
Once your tests upload results, go to TofuPilot's Units page and search by serial number. The unit detail page shows:
- Every test run tied to that serial, across all procedures and stations
- Individual measurements with pass/fail status and limits
- Timestamps and station identifiers for each run
- Links to related sub-assemblies (if configured)
This is the audit trail that regulators and quality engineers need. No extra code required.