Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: The MathWorks, Inc.

Rating No ratings yet

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical reference for engineers who need to measure how thoroughly their Simulink models and generated code are exercised by tests, covering metric definitions, configuration, result analysis, and reporting. Read it if you are setting up coverage-driven verification for embedded control software and want the official MathWorks workflow rather than trial and error. 【Book Arc】 - **Opening (~0%–15%)**: Front matter, revision history, and the conceptual core — what model coverage means and the full menu of metrics (execution, decision, condition, MCDC, cyclomatic complexity, lookup-table, signal range, and signal size). This stage gives you the vocabulary the rest of the manual assumes. - **Early (~15%–30%)**: A block-by-block reference of which Simulink blocks receive which coverage types, followed by how to configure coverage options and manage, aggregate, and accumulate results in the Results Explorer. Solves the "what do I turn on, and where do I find the numbers" problem. - **Early–Middle (~30%–45%)**: Code coverage for generated C/C++ — statement, condition, decision, MCDC, relational boundary, function and function-call coverage — plus SIL/PIL modes and S-function limitations. Then the practical analysis chapters: cascaded logic and MCDC, canvas highlighting, referenced-model instances, and tracing results to requirements and test cases. - **Middle (~45%–60%)**: Coverage for the trickier constructs — MATLAB Function blocks, custom C/C++ and S-functions, Stateflow charts, state transition tables, atomic subcharts, truth tables, and variant blocks — followed by the report types (model summary, subsystem, code coverage, top-level) and how to read each section. - **Late (~60%–85%)**: Filtering out justified gaps, scripting coverage analysis from the command line, extracting and operating on coverage data, parallel simulation with parsim, and component verification workflows. - **Ending (~85%–100%)**: Requirements-based testing and traceability, tying coverage results back to requirements and test reports to close the verification loop. 【Book Arc note】The excerpts are dominated by tables of contents and chapter headings; the progression above reflects the manual's structure rather than detailed prose, which the sample does not include. 【Key Takeaways】 - **Coverage is a family of metrics, not one number** (Opening): execution, decision, condition, MCDC, cyclomatic complexity, lookup-table, signal range, and signal size each answer a different question about test thoroughness. Choosing the right metric for your safety or quality goal is the first decision the manual forces. - **Block-level coverage support is uneven** (Early): the block reference tells you which Simulink blocks are instrumented and which are explicitly excluded, so you can predict gaps before running a campaign instead of being surprised by them. - **Model coverage and code coverage are distinct layers** (Early–Middle): the same design can look well covered at the model level while generated code shows untested statements or boundaries. SIL/PIL modes let you check the compiled artifact, with documented limitations for S-functions and in-the-loop blocks. - **MCDC and cascaded logic need special attention** (Middle): the manual devotes dedicated analysis to condition/decision combinations and logical operator cascades, because naive test sets often satisfy decision coverage while missing MCDC obligations. - **Stateflow and MATLAB Functions are first-class citizens** (Middle): charts, transition tables, atomic subcharts, and truth tables each have their own coverage semantics and report settings, as do MATLAB Function blocks and custom C/C++ embedded in them. - **Aggregation and cumulative coverage make results meaningful across runs** (Early–Middle): reusable subsystems, referenced-model instances, and multi-simulation design studies require accumulating results so a component isn't judged on a single test. - **Filtering is a legitimate part of the workflow** (Late): filter rules and files let you exclude justified dead logic or defensive code, keeping the coverage number honest rather than artificially inflated. - **Everything is scriptable** (Late): command-line functions for retrieving, extracting, and operating on coverage data, plus parsim for parallel runs, turn coverage from a GUI activity into a repeatable pipeline step. - **Coverage closes the loop with requirements** (Ending): tracing results to requirements and associated test cases, and scoping reports to linked tests, is what makes coverage evidence for verification and validation rather than just a metric. 【Reading Tips】 - **Don't read linearly.** Treat it as a reference: read the metric definitions chapter once end to end, then jump to the chapters matching your current task (configuration, Stateflow, scripting, reporting). - **Use the block reference as a lookup table.** Skim the long block-by-block list and only deep-read entries for blocks actually in your model; this is where most of the page count sits. - **Deep-read the MCDC, cascaded-logic, and filtering chapters.** These are where practitioners most often get stuck and where the manual's guidance has the most practical payoff. - **Pair GUI and command-line chapters.** Learn the Results Explorer workflow first, then the scripting functions, so you can automate whatever you configured by hand. - **Take away a checklist, not facts.** The durable output is your team's coverage configuration, filter policy, and reporting cadence — the manual supplies the options, you supply the standard. 【Coverage Limits】 This guide is synthesized from stratified excerpts that are largely front matter, tables of contents, and chapter headings; detailed procedural steps, examples, and dialog-level instructions are not represented here. Verify specific settings and workflows against the actual R2021b manual before relying on them.
Page 2
nd Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand nam...
View in text
Page 4
. . . . . . . . . . . . . . . . 2-16 MATLAB System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16 MinMax . . . ....
View in text
Page 6
al Operator Cascade Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 Analyzing MCDC for Cascaded Logic Blocks . . . . . . . . . . ....
View in text
Page 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 Coverage Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 12
report, see “Top-Level Model Coverage Report” on page 6- 10. The Simulink Coverage™ software can only collect model coverage for a model if its simulation mo...
View in text
Page 14
McCabe complexity measure for code generated from the model. The complexity measure can be different for the generated code than for the model due to code fe...
View in text
Page 17
predefined tolerance or you can specify your own tolerance. The tolerance value depends on the data type of both the operands. If both operands have the same...
View in text
Page 20
result. Simulink Coverage reports 0% coverage on C_Switch1. Because the C_Switch1 block is dead logic, the coverage report generates a Blocks Eliminated from...
View in text
Tags
AI categories
MatlabSoftwareTechnology
Publisher: The MathWorks, Inc.
Publish Year: 2022
Language: English
File Format: PDF
File Size: 6.2 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…