Why does "Record coverage for system under test" alters the test results in "Simulink Test Manager" in MATLAB R2024b?

4 ビュー (過去 30 日間)

For my model shown below, I have two test cases in my Test Suite. Both the test cases are identical except,
Test Case 1 has "Record coverage for system under test" option turned OFF under "Coverage Settings". 
Test Case 2 has "Record coverage for system under test" option turned ON under "Coverage Settings". 
 
When the tests are run,
Test Case 1 passes
Test Case 2 fails and the following error is observed in the report:

Division by zero in 'example/Divide'
Here's an example model, "example.slx":

Test harness:

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 11 月 19 日 0:00
If "Block Reduction" is ON and "Force Block Reduction Off" is enabled, block reduction becomes inactive when coverage is on. This alters the test results when "Record coverage for system under test" is enabled. 
To have same results for both the test cases, disable "Force Block Reduction Off". This will pass both the test cases, and no error will be encountered. 
Block Reduction reduces the number of blocks in the model that execute during simulation by collapsing groups of blocks into a single, more efficient block or eliminates unnecessary blocks from the execution list.  If "Force Block Reduction Off" parameter is selected, the coverage analysis overrides the value of the Block reduction Simulink parameter.

その他の回答 (0 件)

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by