-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[llvm-cov][MC/DC][Qualification] Too High MCDC coverage for C++ #109940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This may be addressed by: #94137 In short, with Rust, there is a desire for more granular results for constant conditions, including those conditions that are |
For me it is not clear why C++ and Rust should be handled differently here. Furthermore, it is task of MCDC coverage to find weaknesses in the Code and Constants in the term might be a problem. In this case there should be reported a coverage value less than 100 % MCDC. |
HI @escherle-validas MC/DC for Rust is presently a work-in-progress with some issues outstanding. What I can say is that clang folkds the conditions for C/C++, and folded conditions are not included in the metrics because they aren't influenced by variable test inputs. In looking at this further, I don't think this is the same issue as is addressed by #94137 which deals with non-constant conditions that may be uncoverable or unreachable due to constant conditions. But if there is a desire to include constant folded conditions in the metrics, it seems feasible that could be added as an option. |
The reason why C++ and Rust give different results is the way we generate Otherwise, rustc does not know which conditions are constants until mir optimization, where all counters inserted in eliminated regions by control flow analysis are replaced with #94137 fixes it so that branches with only one |
CC @chapuni |
@Endilll I supposed this was rust specific issue. Thanks for the notification. |
Too High MCDC coverage for C++
Criticality: HIGH
During qualification of MCDC coverage at Validas we found that
the computation of MCDC coverage for the term "if ((TRUE ||TRUE) && v2)" is too high.
The result is 100%, but should be 33% (or 50% or 66% depending on the interpretation of folded constants).
This is highly critical, since tester might think they have covered everything and do not optimize the code.
When we run the same example using Rust, we see 50% coverage, which is different and safe.
Rust example:

Source Code and generated Reports:
Test_000005.zip
C++ example:

Source Code and generated Reports:
Test_000005.zip
The text was updated successfully, but these errors were encountered: