I have recently took the CS258 free online course, and it mentioned a code coverage called the MC/DC coverage, which is used in embedded software, such as computers on cars, planes, etc...
but I couldn't find a free tool to show me MC/DC coverage for my program, are there any recommendations?
I believe that Project Coverage (now called Project Couverture) will probably be the first good answer to the question of non-invasive AND open-source coverage analysis. Their latest code release is currently here and a mile-high kind of project presentation can be seen here.
As to how SQLite claims MC/DC coverage using just gcov
, they base this on the fact that in C, the logic AND and OR follow short-circuit evaluation; meaning that in any boolean expression comparisons...
if (((A == B) || (C != D)) && (E != F)) ...
...C will, by definition, stop evaluating at the first expression that 'decides' the whole; so if A is equal to B, the decision-making is already done - if not, it continues to the next expression, and so on. This means that the MC/DC requirement...
Each condition in a decision must be shown to *independently*
affect the outcome of the decision
...is sort of "covered by default".
There is an exception to that, though - read their explanation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With