본문으로 건너뛰기
cccskills
무료GitHub에 공개

testing-simulink-models

Tests Simulink models using either ephemeral Gherkin-based tests (model_test) for quick validation or persistent tests (Simulink Test API) authored from requirements or behavioral specs. Requires Simulink Test.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(25)

  • SKILL.md6.3 KB
  • assets/test-config-template.md4.0 KB
  • assets/test-structure-template.md1.8 KB
  • manifest.yaml944 B
  • references/assessment-format.md5.0 KB
  • references/gherkin-based-fast-testing.md4.1 KB
  • references/simulink-test-authoring.md9.6 KB
  • scripts/+vnv/+internal/+agentic/+common/+format/formatError.p2.0 KB
  • scripts/+vnv/+internal/+agentic/+common/+format/formatMetadata.p4.4 KB
  • scripts/+vnv/+internal/+agentic/+common/+format/formatTestCase.p12.1 KB
  • scripts/+vnv/+internal/+agentic/+common/+format/formatTestFile.p3.9 KB
  • scripts/+vnv/+internal/+agentic/+common/+format/formatTestSuite.p3.1 KB
  • scripts/+vnv/+internal/+agentic/+common/+requirements/linkRequirements.p3.3 KB
  • scripts/+vnv/+internal/+agentic/+common/+requirements/readRequirements.p9.9 KB
  • scripts/+vnv/+internal/+agentic/+helpers/AssessmentBuilder.p8.5 KB
  • scripts/+vnv/+internal/+agentic/+helpers/readResults.p15.3 KB
  • scripts/+vnv/+internal/+agentic/+helpers/resolveComponent.p2.4 KB
  • scripts/+vnv/+internal/+agentic/+helpers/sanitizeDescription.p1.4 KB
  • scripts/+vnv/+internal/+agentic/+helpers/setParameterOverrides.p2.6 KB
  • scripts/+vnv/+internal/+agentic/+helpers/setSimConfig.p1.8 KB
  • scripts/+vnv/+internal/+agentic/+helpers/widenToHarnessOwner.p3.5 KB
  • scripts/+vnv/+internal/+agentic/test_create.p17.6 KB
  • scripts/+vnv/+internal/+agentic/test_edit.p18.6 KB
  • scripts/+vnv/+internal/+agentic/test_read.p3.5 KB
  • scripts/+vnv/+internal/+agentic/test_run.p6.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Testing Simulink Models

Requires Simulink Test and R2023a or later. The requirement-driven entry point also requires Requirements Toolbox. The coverage workflow also requires Simulink Coverage. If Simulink Test is unavailable, use simulating-simulink-models with manual assertions.

When to Use

  • Writing pass/fail tests for a Simulink model or subsystem
  • Verifying expected behavior against requirements or acceptance criteria
  • Creating regression tests to catch future breakage
  • Reproducing and validating bug fixes with structured assertions
  • Collecting decision coverage metrics
  • Authoring persistent tests from linked requirements or a behavioral spec

When NOT to Use

  • Building or editing model structure → use building-simulink-models
  • Running simulations for data exploration, sweeps, or custom analysis → use simulating-simulink-models
  • Querying or resolving parameter values → use model_query_params / model_resolve_params
  • Creating or editing requirements → use generate-requirement-drafts
  • Injecting faults onto model signals without test authoring → use inject-faults
  • FMEA, FHA, FTA, or other safety analysis documents → use manage-safety-analysis
  • Simulink Test is not installed → fall back to simulating-simulink-models with manual assertions

Testing Approaches

This skill provides two testing approaches. Choose based on task context:

Gherkin (model_test)Simulink Test API (test_create family)
PersistenceEphemeral — harness discarded after sessionPersistent — .mldatx files remain in project
Speed~3s (draft mode)~60s (full Simulink Test infrastructure)
TraceabilityNoneFull requirement linking via .slreqx
Use caseBug fixes, quick validation, agentic loopCertification, systematic testing, formal V&V; also takes behavioral specs
Approval neededNoYes — engineer reviews test plan before execution
Coveragecoverage parameter ('none' or 'decision')Via test_run options
ToolboxSimulink TestSimulink Test (+ Requirements Toolbox for requirement path)

→ For Gherkin testing, read references/gherkin-based-fast-testing.md → For Simulink Test API authoring (requirements / behavioral spec), read references/simulink-test-authoring.md

Workflow — Gherkin (Quick Validation)

  1. Understand the component: Use model_overview and model_read on the target subsystem to identify inputs, outputs, and expected behavior.
  2. Write the .feature file: Author a Gherkin test following the syntax in references/gherkin-based-fast-testing.md. Start with one scenario covering the primary nominal case.
  3. Cap StopTime before running: Check the model's StopTime with model_query_params. If it is inf (or unset/auto), you MUST pass a finite stop time to model_test — an infinite sim never returns and hangs MATLAB. Pick a finite value that lets the behavior settle (2–30s for a step response).
  4. Run in draft mode: Call model_test with draft_mode='true' for rapid iteration (~3s). Fix syntax or signal errors.
  5. Run full compilation: Once draft passes, re-run with draft_mode='false' to validate against the actual compiled model (catches type/dimension mismatches).
  6. Expand coverage: Add scenarios for edge cases, fault conditions, and boundary behavior. Use coverage='decision' to identify untested branches.

Workflow — Simulink Test API (Persistent)

  1. Understand the component: Use model_overview and model_read on the target subsystem to identify inputs, outputs, and expected behavior.
  2. Propose test plan → wait for approval: Present what to test, at what scope, and why. Do not call test_create until the engineer approves.
  3. Create test cases: Call test_create with the appropriate entry point — component/model only or requirement-driven (RequirementID + ReqSetPath). Pass TestFile as an absolute path under the working folder (never a bare filename — it would land in the skill's scripts/ dir, since that is the project_path). See references/simulink-test-authoring.md for call shapes.
  4. Propose test configuration → wait for approval: Present stop time, sim config, signal logging, assessments, and parameter overrides for each test case. Do not call test_edit until the engineer approves. Always set a finite StopTime via test_edit — if the model's StopTime is inf (or unset), the test run never returns and hangs MATLAB. Choose a finite value that lets the behavior settle (2–30s for a step response).
  5. Run and report: Call test_run, present pass/fail summary with assessment detail. Engineer decides next steps.

Guardrails

Always

  • Inspect model (model_overview / model_read) before writing tests — otherwise you write tests against wrong I/O
  • Report failures with assessment names, conditions, and signal summaries — users can't diagnose without detail
  • Never run a sim or test with StopTime=inf. Check StopTime before any model_test/test_run; if it is inf or unset, override it with a finite value first. An infinite sim never returns and hangs the MATLAB session (and, in a shared session, every subsequent task).

Never

  • Guess pass/fail criteria — ask the user if unclear
  • Change MATLAB working directory while a model is open — breaks harness cache

References

  • references/gherkin-based-fast-testing.md — Gherkin syntax, draft mode, coverage, Simscape constraints
  • references/simulink-test-authoring.md — API manual: setup, constraints, test_create entry shapes, edit/read/run signatures
  • references/assessment-format.md — LoggedSignals and Assessments struct formats
  • assets/test-structure-template.md — Test structure proposal template (requirement-driven path)
  • assets/test-config-template.md — Test configuration proposal template (requirement-driven path)

Copyright 2026 The MathWorks, Inc.


리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Author or upgrade Model Advisor checks for Simulink and System Composer models. Covers the full lifecycle: guideline authoring, check specification, Model Advisor check implementation, and qualification testing. Use when creating new checks (edit-time, standard batch, config-parameter, auto-fix), converting legacy StyleOne/StyleTwo/StyleThree checks to modern DetailStyle, creating a guideline for modeling, enforcing a modeling rule, or testing/qualifying a check. Triggers on any modeling constraint (e.g., "blocks shall...", "signals must match...", "parameters shall be set to...").

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

Synthesize new waveforms from scratch for Simulink inports using createInputDataset. Use ONLY when the user asks to generate, create, or synthesize signals (step, ramp, sine, chirp, pulse, noise) to populate a Dataset for External Inputs or Signal Editor. Covers timeseries and timetable formats with correct data type, interpolation, units, and dimensions. Also covers function-call and trigger inport timing setup. Do NOT use when the user wants to load, import, or read existing data from files (MAT, CSV, spreadsheet) — even if that data will be used as model input. Do NOT use for running simulations or plotting outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

Common steps for building multi-layer system architecture models using System Composer. Use when implementing architecture models or when interacting with interface dictionaries, allocation sets, stereotypes, and requirements for architecture components.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

Builds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

Use this skill when the user asks to check Simulink model compliance against a standard (MISRA, MAB, JMAAB, ISO, DO, IEC, EN, CERT C/CWE, AUTOSAR, Simulink Code Inspector (SLCI)), wants to run Model Advisor checks, or needs a compliance report with fix suggestions. For JMAAB/MAB, supplement deterministic checks with agentic review of uncheckable guidelines.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

Guide users through creating and managing .satk/block-policy.json for controlling which blocks the agent can use, which are excluded, and which block parameters the agent should not modify. Use when setting up block usage policy for a project.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

matlab/simulink-agentic-toolkit1.2천2026년 10월 15일 업데이트

matlab의 스킬 모두 보기

이 스킬의 문제 신고