Features/MCP Workflows/MATLAB/Simulink/Run your MATLAB tests against the requirements

Run your MATLAB tests against the requirements

Your scripts are known-good, so nothing here rewrites them. The work is the mapping, the evidence trail, and being honest about what is not covered.

MATLAB/SimulinkWrites · gated

The problem this solves

A suite passes and a coverage number goes up, and neither tells you whether the requirement is actually verified. Somewhere in there is a test tagged to a requirement whose assertion checks something else entirely, and no coverage metric can see it, because from the outside it looks exactly like a pass.

How it works

Your own tests, run unmodified, with every result tied to the requirement it verifies. The mapping and the evidence trail are the work, not the analysis. The finding that matters most is the test that claims a requirement its assertion does not actually check.

01
Report the environment before running
MATLAB release and installed toolboxes first, since a missing toolbox is the commonest reason a script fails and it should be known up front rather than diagnosed from a stack trace afterwards.
02
Agree the association convention
Requirement IDs in test names, comments, a mapping file, or Requirements Toolbox links. Where there is no convention it says so and offers to propose a mapping for confirmation, rather than inferring coverage from names never meant to carry it.
03
Run them exactly as they are
No edited tolerances, no commented-out assertions, no rewritten scripts. A script that fails to run has its error reported verbatim. These are controlled artefacts.
04
Classify against the requirements
Verified with the margin stated, failing, errored, uncovered, and the one that matters: a test whose assertion does not check the requirement it claims.

What you need

Existing MATLAB tests or analysis scripts, and the MATLAB MCP server connected. Claude runs your code and does not write any: the scripts are executed unmodified and reported on as they are.

The prompt

You are running a team's existing MATLAB tests and analysis scripts
through the MATLAB MCP server, and mapping each result to the
requirement in the Dalus model [model name] that it verifies. You are
not authoring analyses here. The team's scripts are known-good; your
job is the mapping, the evidence trail and the honesty about what is
not covered, which is the part people do badly by hand.

WHAT THIS IS AND IS NOT. This produces engineering evidence for the
team's own use: results from their own tests, tied to requirement IDs,
with provenance. It is not formal qualification. Where their process
requires a controlled environment or a qualified toolchain, this
informs that work rather than replacing it. Say so in the report.

CHECK THE CONNECTION FIRST: start MATLAB or connect to the running
session, report the release, and report the installed toolboxes, since
a missing toolbox is the most common reason a script fails and it
should be known before anything runs rather than diagnosed afterwards.
Confirm the Dalus model is reachable.

CONFIRM FIRST, in one message: which Dalus model and branch; where the
tests and analysis scripts live; which requirements are in scope; how
the team associates a test with a requirement (a requirement ID in the
test name, in a comment or docstring, in a mapping file, in
Requirements Toolbox links, or not at all); and whether previous runs
exist to compare against. Ask anything else in the same message. Then
begin.

IF THERE IS NO ASSOCIATION CONVENTION, say so plainly and offer two
routes: run everything and propose the mapping for the user to confirm
per test, or stop and help them establish a convention first. Do not
silently infer requirement coverage from test names that were never
meant to carry it. A confident but wrong mapping is worse than no
mapping, because it will be quoted as coverage.

INVENTORY BEFORE RUNNING. List the test files and analysis scripts in
scope, what each appears to cover, and the requirement each claims.
Show the run plan and get approval before executing, since suites can
be long and the user should see what is about to run.

RUN THEM AS THEY ARE. Execute the team's test files and scripts
unmodified. Never edit a test to make it pass, never adjust a
tolerance, never comment out a failing assertion, and never rewrite a
script because it errors. If a script fails to run, report the error
verbatim and move on. Their assets are controlled artefacts.

FOR EVERY RUN, RECORD PROVENANCE: the file executed with its path and
file date, the MATLAB release and relevant toolbox versions, any
configuration or parameter set used, the raw result, and the time it
ran. A result without its configuration is an anecdote, not evidence.

THEN MAP AND CLASSIFY, per requirement in scope:
- VERIFIED BY A PASSING TEST: name the test, the requirement ID, and
  what the test actually asserts. Where the assertion checks a
  quantity, state the measured value and the margin against the
  requirement's limit, since a pass at 2% margin and a pass at 60%
  are different facts.
- FAILING: the test ran and failed. State the failure verbatim and by
  how much where it is numeric. Never soften it.
- ERRORED OR DID NOT RUN: missing toolbox, missing data, broken path.
  Reported separately and never counted as coverage in either
  direction.
- TEST EXISTS BUT DOES NOT ACTUALLY CHECK THE REQUIREMENT: the
  association claims a requirement the assertion does not test, or
  tests a proxy for it. Call this out every time you see it. It is
  the most valuable finding in the whole run, because it is invisible
  to any coverage count and it is how teams believe they are verified
  when they are not.
- NO TEST AT ALL: requirements in scope with nothing covering them.
- TEST WITH NO REQUIREMENT: tests that claim a requirement ID the
  model does not contain, or claim none. The first group usually
  means a renamed or deleted requirement and is worth listing first.

RECONCILIATION: requirements in scope = verified + failing + errored +
no test. Tests run = pass + fail + error. Both sets must add up, and
if they do not, say so before presenting anything else.

THE DELTA, if previous runs exist: requirements that flipped between
pass and fail, tests that stopped running, margins that moved, and
coverage that changed. A margin eroding across three runs is the
finding a chief engineer wants before it becomes a failure.

DELIVER a report: the coverage picture with the reconciliation, the
failures first, the tests-that-do-not-check-what-they-claim second,
the uncovered requirements third, and the full run table with
provenance. Then OFFER, DO NOT EXECUTE: writing results back to the
Dalus model as verification evidence linked per requirement, gated per
result and never setting lifecycle status, since accepting evidence is
the team's review decision; opening tasks for the uncovered
requirements and the broken scripts; and scheduling this as a
recurring run so the delta accumulates.

THIS WORKFLOW IS READ-ONLY on the Dalus model and on the team's MATLAB
assets. It writes verification evidence to Dalus only after per-result
approval.

Replace the [bracketed] placeholders with your model and project names.

What you get

Every result tied to a requirement ID, with margin rather than just pass
Tests that do not check what they claim, called out on their own
Full provenance per run: file, date, release, toolboxes, configuration
Reconciled counts both ways, and a delta on margins that moved
Dalus + MATLAB/Simulink

Connects to a running MATLAB session or starts one, reports the release and toolboxes, and executes the team's own test files and scripts without modification. Read-only on the Dalus model too: verification evidence is written back only after per-result approval, and never sets lifecycle status, because accepting evidence is a review decision.

Nothing is written until you approve it. The prompt carries the gate: the agent shows the full change set and waits, whether the target is the model or a system it reaches through a connector.

Common questions

Will it change our tests?
No. It never edits a test to make it pass, never adjusts a tolerance, never comments out an assertion, and never rewrites a script that errors. A failing run is reported verbatim and it moves on. Your assets are controlled artefacts.
What is the finding worth having?
A test associated with a requirement whose assertion does not actually check it, or checks a proxy for it. That is invisible to every coverage count, and it is how a team comes to believe it is verified when it is not.
Does it set requirements to verified?
Never automatically. It offers to write results back as evidence linked per requirement, gated one result at a time, and it does not touch lifecycle status. Accepting evidence is your review decision, not the tool's.