How to achieve 100% MCDC with 'after' transition in stateflow ?

Hi,
I have a fairly simple model with near 100% MCDC coverage. But I don't understand the meaning of the remaining issue.
Here we can see the actual condition `after(...)` is fully covered, but the condition `msec` is never False. But how is `msec` a condition on its own ? And what does it mean for `msec` to be False ?
This question seemed relevant :
The answer suggests the issue might come from a time step too large. My model uses 10ms steps, and I did get a warning about using `msec` with simulation step larger than 1ms at some point. So I tried to use `sec` instead of `msec`, but it didin't solve it, it just says "sec" is never False now.
There is also this one :
I believe the author had the same issue than me. If I understand the answer correctly, I need to have a test that ends before the timeout occurs. So I tried a 200ms total test with a timeout configured at 500ms. Still the same '"msec" is never False'.
Can anyone help me understanding the meaning of this please ?
edit: fixed second link

 Réponse acceptée

Samar
Samar le 8 Mai 2026
Hi Theotime,
  • In after(n, msec) (or sec), msec is a time‑unit keyword, not a logical condition. Stateflow uses it only to interpret how time is measured. It has no True/False runtime meaning on its own. Please refer the MathWorks documentation: https://www.mathworks.com/help/stateflow/ug/using-temporal-logic-in-state-actions-and-transitions.html
  • Simulink Coverage sometimes reports the unit keyword (msec, sec, tick) as a separate “condition”, which then appears as “never False”. This is a known coverage artifact, not a modeling or testing error.
  • Changing msec → sec, changing the simulation step size, or shortening the test cannot fix this, because the unit keyword can never toggle to False by design.
  • The actual temporal condition after(...) is being evaluated True/False correctly (as seen in your report); only the unit token is unachievable for MC/DC.
Practical actions (MATLAB‑accepted)
  1. Use guard form: [after(..., msec)] (often removes the extra unit condition) [matlabsolutions.com], [mathworks.com]
  2. Or justify/exclude the msec condition as unachievable by design in the coverage report (standard practice for certification). Please refer this documentation: https://www.mathworks.com/help/slcoverage/ug/coverage-for-stateflow-charts.html
Your MC/DC gap is due to a tool reporting limitation with temporal logic units, not missing tests or incorrect timing logic.
Hope this helps!
Regards,
Samar

1 commentaire

Hello,
Thank you for your answer.
So this is essentially a bug. That's how I would call an artifact that forces user to use workarounds to mask it.
I thought it might be the case but because this exact behaviour is shown here with no explanation, so I thought it was an actual lack of testing https://fr.mathworks.com/help/slcoverage/ug/coverage-for-stateflow-charts.html#:~:text=equivalent%20control%20flow.-,Transition%20Details%20Report%20Section,-Reports%20for%20transitions

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Report Generator dans Centre d'aide et File Exchange

Produits

Version

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by