How can I avoid false negative test results caused by a simulation stop time that was set too small to reach the end of the specified test sequence in R2022a?

3 Ansichten (letzte 30 Tage)
We are using test harnesses with test sequences. When the simulation stop time is smaller than the time needed to execute all test sequence steps it is not indicated in the test result. This can easily lead to false negatives. 
Let's e.g. assume in the last test step there's a verify statement that would normally fail, but because the step is never reached a warning for the failed verification is not given. This situation is especially tricky when multiple scenarios with different runtimes are used. This requires always checking manually that the sim stop time is the max of all execution times of the scenarios.
How can this pitfall be avoided?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 21 Mär. 2023
You can use a pattern as shown in the attached example CruiseControl_R2022a.slx.
(There's also a script that loads the necessary data during the model's PostLoadFcn callback, CruiseControl_dd.m.)
The model contains:
  • A test sequence harness
  • Test sequence block has a "Stop" boolean output set to true when the final test sequence step is executed.
  • The "Stop" signal is connected to a "Stop Simulation" block
  • The "Stop" signal is connected to a "Terminate Function" block
  • In the "Terminate Function" block, the "Stop" signal is connected to an "Assertion Block"
  • The assertion and test will fail in the Test Manager if the "stop" statement has not been executed
This way you can check that the end of the test sequence was actually reached during the test execution.

Weitere Antworten (0)

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by