You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue arises from methods annotated with @DoNotMutate (those methods, which are typically impossible to test on the UNIT level). These methods are excluded from mutation testing but still contribute to the line coverage calculation. The line coverage suggests insufficient testing, even though these methods are exercised through integration tests.
Expected Behavior:
For methods annotated with @DoNotMutate:
Line coverage should not penalize the overall coverage score.
Either exclude these methods entirely from line coverage calculations or treat them as fully covered when integration tests exercise the related system behaviour.
Current Behavior:
The @DoNotMutate annotation ensures mutation coverage is 100%, but line coverage remains low because:
Integration tests do not map directly to specific lines within the annotated methods.
The framework still includes these methods in line coverage calculations.
Example:
packageio.example;
importcom.groupcdg.pitest.annotations.DoNotMutate;
publicclassExample1 {
publicStringmethodCoveredByTests() {
return"This method is covered by tests.";
}
@DoNotMutatepublicStringmethodNotCoveredByTests() {
return"This method is NOT covered by tests.";
}
}
The mutation coverage would be 100% but line coverage is 50% which I think it not What is the aim of it? Am I somehow mistaken? Thanks for your answer.
The text was updated successfully, but these errors were encountered:
This issue arises from methods annotated with @DoNotMutate (those methods, which are typically impossible to test on the UNIT level). These methods are excluded from mutation testing but still contribute to the line coverage calculation. The line coverage suggests insufficient testing, even though these methods are exercised through integration tests.
Expected Behavior:
For methods annotated with @DoNotMutate:
Current Behavior:
The @DoNotMutate annotation ensures mutation coverage is 100%, but line coverage remains low because:
Example:
The mutation coverage would be 100% but line coverage is 50% which I think it not What is the aim of it? Am I somehow mistaken? Thanks for your answer.
The text was updated successfully, but these errors were encountered: