testing-simulink-models — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited testing-simulink-models (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Requires Simulink Test. If unavailable, use simulating-simulink-models with manual assertions.
Use this skill when you need persistent, reusable pass/fail verification of model behavior.
building-simulink-modelssimulating-simulink-modelsmodel_query_params / model_resolve_paramssimulating-simulink-models with manual assertionssimulating-simulink-models insteadmodel_overview and model_read on the target subsystem to identify inputs, outputs, and expected behavior.model_test with draft_mode='true' for rapid iteration (~3s). Fix syntax or signal errors.draft_mode='false' to validate against the actual compiled model (catches type/dimension mismatches).coverage='decision' to identify untested branches.Write a .feature file in this format, then pass it to model_test:
# --- front-matter:toml --- # REQUIRED: exactly one, must be first in file
model = "Model.slx" # model filename with .slx extension
component = "Model/Subsystem" # optional; default = model name without .slx
[inputs] # alias = "portReference" for each input port
Speed = "Speed" # scalar port: just the port name
Torque = "'Torque (Nm)'" # single quotes if name contains ( ) or .
Pos = "Position(2)" # vector element: "PortName(N)"
Cmd = "Control.Throttle" # bus element: "PortName.Element"
[outputs] # alias = "portReference" for each output port
Output = "Output" # scalar port
Force = "'Force (N)'" # single-quoted scalar port
Yaw = "'Rate (deg/s)'.Filtered(2)" # single-quoted port with vectorized bus element
# --- end front-matter --- # markers must be exact as shown
Feature: Descriptive title # exactly one Feature, colon required directly after keyword
Description text here. # descriptions cannot start with keywords; prefix * to escape
Scenario: Unique scenario title # at least one Scenario, unique titles, colon required
Description of test case.
Given inputs # exactly one Given; MUST have * line for EVERY declared input
* Speed = const(50) # const(<value>)
* Torque = step(0 -> 100 @ 1s) # step(<from> -> <to> @ <time>) time: Ns or Nms
When simulate for 5s in Normal mode # EXACT syntax; duration: Ns or Nms (>0); mode: Normal|SIL
Then baseline "ref.mat" with tolerances: absTol=0.01, relTol=0.01, timeTol=50ms
* Output: absTol=0.001 # per-signal tolerance override; defaults are 0
Then outputs # 1-2 Then blocks allowed (baseline and/or outputs)
* Positive: Output > 0 # operators: == != < > <= >= (never vs another signal)
* Bounded: Output == [10 .. 90] # ranges with == only: [a..b] (a..b) [a..b) (a..b]
* Settled: Output > 80 when t > 3s # conditional: when t <op> <time>
* InRange: Output == (0 .. 100] # assessment names must be uniqueNot supported: And But Rule Example @tags |tables| """
# ❌ WRONG - starts with keyword:
When input changes, output responds
# ✅ Rephrase:
If input changes, output responds
# ✅ Or escape with *:
* When input changes, output respondsPrefer subsystem component-level tests—top level models can be large and slow to update/test, while subsystem components offer faster iteration, isolation, and clearer failure diagnosis. Use judgment based on what you're verifying.
The component under test must not contain physical modeling ports (PMIOPort / Simscape Connection Port blocks). Only components with standard Simulink Inport/Outport interfaces are supported. If the subsystem you want to test has physical ports, test a parent subsystem that wraps it with signal-based I/O instead.
If the model contains Simscape elements, set the model parameter SimscapeLogType to "none" before running tests. Simscape logging can interfere with test harness signal routing. This is a one-time model configuration, not a simulation command. Use: set_param('ModelName', 'SimscapeLogType', 'none').
Pass coverage='none' (default) or coverage='decision' when calling model_test. The coverage parameter is required. Use 'decision' to collect both execution and decision coverage metrics (requires Simulink Coverage toolbox). Use 'none' when coverage is not needed.
Pass draft_mode='true' for rapid test iteration (~3s vs ~60s). Draft mode skips the main model compile and uses a lightweight harness. Use 'true' by default during test development.
Limitation: Draft-mode harness uses double scalar for all inputs and outputs. If the model under test has non-double ports (boolean, integer, single, bus, vector), draft mode will fail with data type mismatch errors. In that case, re-run with draft_mode='false'.
Don't change MATLAB's working directory while a model is open. Test harness cache is directory-tied—changing it causes stale harness errors.
----
Copyright 2026 The MathWorks, Inc.
----
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.