Steps

Organize your test flow by breaking it down into multiple steps.

Steps section header showing test step management whithin TofuPilot.

Overview

A hardware test typically consists of several steps that perform measurements and validation. TofuPilot provides an easy way to record step details and analyze performance across all executions, giving you precise analytics on phase failure rates and durations.

Integration

You can create and add various test steps and view the automatically generated reports on the Run page.

Required parameters

import openhtf as htf
from tofupilot.openhtf import TofuPilot

def step_one(test):                       # Step name is the function name
    return htf.PhaseResult.CONTINUE       # Pass status

def main():
    test = htf.Test(
        step_one,
        procedure_id="FVT1",
        part_number="PCB1"
    )
    with TofuPilot(test):
        test.execute(lambda: "PCB1A001")  # duration and started_at are set automatically

if __name__ == '__main__':
    main()
  • Name
    name
    Type
    str
    Description

    The name of the step.

  • Name
    step_passed
    Type
    bool
    Description

    Pass/Fail status of the step.

  • Name
    started_at
    Type
    datetime
    Description

    ISO 8601 start time of the step. Example: "2024-09-11T08:00:00Z"

  • Name
    duration
    Type
    timedelta
    Description

    The duration of the step.

Optional parameters

import openhtf as htf
from tofupilot.openhtf import TofuPilot

# Add decorator to set measurement name, unit and limits
@htf.measures(
    htf.Measurement("voltage")
    .in_range(3.1, 3.5)
    .with_units(units.VOLT)
)
# Step return a Pass status due to measurement (3.3) within defined limits [3.1, 3.5]
def step_voltage_measure(test):
    test.measurements.voltage = 3.3

def main():
    test = htf.Test(
        step_voltage_measure,
        procedure_id="FVT1",
        part_number="PCB1"
    )
    with TofuPilot(test):
        test.execute(lambda: "PCB1A001")

if __name__ == '__main__':
    main()
  • Name
    measurement_unit
    Type
    str
    Description

    The unit of measurement for the value (e.g. "°C").

  • Name
    measurement_value
    Type
    float
    Description

    The value measured during step.

  • Name
    limit_low
    Type
    float
    Description

    Minimum threshold.

  • Name
    limit_high
    Type
    float
    Description

    Maximum threshold.

In-app view

Run page

You can view each test step in the Steps section on the Run page.

Steps section header showing test step management whithin TofuPilot.

Procedure Page

Clicking on a test step from the Run page redirects you to the Procedure page, where you can see all executed runs of this procedure, sorted by that step. You can navigate between different tabs to view the average Duration for each step, the Yields, quantity of Runs, and Cpk.

Steps section header showing test step management whithin TofuPilot.

You can view step details in the tabs or the Control Chart by clicking on a step (e.g., step_one). The Control Chart displays limits limit_low and limit_high and the 6-sigma standard deviation, calculated automatically.

Steps section header showing test step management whithin TofuPilot.

To unselect a step, click its name on the top bar of the page or click on Clear Filter.


Advanced integration

You can find an example of Steps functionalities in this script, including measured values, limits, and units.

import openhtf as htf
from tofupilot.openhtf import TofuPilot
from openhtf.util import units

def step_connect():
    htf.PhaseResult.CONTINUE

@htf.measures(htf.Measurement("firmware_version").equals("v2.5.1"))
def step_firmware_version_check(test):
    test.measurements.firmware_version = "v2.5.1"

@htf.measures(
    htf.Measurement("temperature").in_range(70, 80).with_units(units.DEGREE_CELSIUS)
)
def step_temperature_calibration(test):
    test.measurements.temperature = 75

def main():
    test = htf.Test(
        step_connect,
        step_firmware_version_check,
        step_temperature_calibration,
        procedure_id="FVT2",
        procedure_name="PCB Temperature Calibration",
        part_number="PCB1",
    )
    with TofuPilot(test):
        test.execute(lambda: "PCB1A002")

if __name__ == "__main__":
    main()

You can see the result on the Run page.

Steps section header showing test step management whithin TofuPilot.

Was this page helpful?