Azzera filtri
Azzera filtri

Test coverage report shows same condition with 2 different sets of coverage stats

27 visualizzazioni (ultimi 30 giorni)
In the coverage report, it lists a condition under decisisions analyzed (example: if A > x) with the 2 possible outcomes true and false, with the totals for each true and false. However it then lists that identical condition a 2nd time with different totals for the outcomes again.
A visual example of the table that shows:
Decisions Analyzed:
What is the difference between the first set of 3 (labeled as 50% covered) and the second set of 230 (labeled as 100% covered)? This issue is present for every condition in my model. It is also what occurs for other coverage types, like MCDC. Here's an MCDC example:
Again, the top half is the identical text to the bottom half, but the bottom half shows 1 of the 3 rows red (so more coverage is complete) whereas the top half shows all 3 in red (missing more coverage). What is the difference between the halves?
Thank you.
Cody
  2 Commenti
Guilherme Costa Nascimento
Guilherme Costa Nascimento il 9 Lug 2024 alle 13:37
Hi Cody,
It's hard for me to figure out why this is happening without seeing the model. Could you share a screenshot of one element where the decision issue occurs?
In case you can't share your model, would you be able to share a simplified version that shows this issue?
Thanks,
Guilherme
Cody
Cody il 9 Lug 2024 alle 17:13
Hi Guilherme,
Attached here is a simple example with random values where the coverage issue is still present.
Thanks,
Cody

Accedi per commentare.

Risposta accettata

Guilherme Costa Nascimento
Guilherme Costa Nascimento il 10 Lug 2024 alle 15:18
Hi Cody,
Thanks for sending the model. In Stateflow, if you do not specify the type of action for your code, it will be executed both in the "entry" and "during" actions. Because these two actions are treated separately by Stateflow semantics, they create two different decisions.
In the example you sent, the "entry" action is executed once so it will not achieve full coverage.
To get full coverage you would have to create additional test cases that make every decision and condition outcome both true and false at state entry. Alternatively, if you did not intend your code to run on entry, you can specify it to only run in the "during" action.
- Guilherme

Più risposte (0)

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by