Skip to content

Conversation

@guptapratykshh
Copy link

Issue: #18024

Resolve Pitest Suppressions - common

This PR resolves issue #18024 by killing all 36 mutations from pitest-common-suppressions.xml and removing them from the suppression file.

Changes:

  • Added SimpleTokenTest with 15 tests covering SimpleToken mutations
  • Added JavadocCommentsLexerUtilTest with 12 tests covering JavadocCommentsLexerUtil mutations
  • Added JavadocCommentsParserUtilTest with 1 test covering JavadocCommentsParserUtil mutations
  • Enhanced LocalizedMessageTest with testArgsFieldIsSetToNullWhenArgsIsNull method
  • Enhanced SarifLoggerTest with testRenderSeverityLevelAllLevels method
  • Updated pom.xml to include new test classes in pitest-common profile targetTests
  • Removed all 36 mutations from pitest-common-suppressions.xml

All tests are passing (30 tests total, 0 failures).

@guptapratykshh guptapratykshh force-pushed the issue-18024-resolve-pitest-suppressions-common branch 2 times, most recently from e4da7ba to 9c9e31f Compare November 30, 2025 14:35
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items:

<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>JavadocCommentsLexerUtil.java</sourceFile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this class is excluded from jacoco

<exclude>com.puppycrawl.tools.checkstyle.grammar.JavadocCommentsLexerUtil</exclude>

so it should be excluded from pitest also.

I think we need something like

<avoidCallsTo>com.puppycrawl.tools.checkstyle.utils.UnmodifiableCollectionUtil</avoidCallsTo>

for "common" profile

<id>pitest-common</id>

@mahfouz72 , do you agree ?

@guptapratykshh guptapratykshh force-pushed the issue-18024-resolve-pitest-suppressions-common branch 6 times, most recently from bdeaa62 to 4e44da2 Compare December 1, 2025 09:34
@guptapratykshh guptapratykshh requested a review from romani December 1, 2025 15:36
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items:

Comment on lines 65 to 73
@Test
public void testIsOpenTagNameWithNonSlashToken() {
final CommonToken token = new CommonToken(JavadocCommentsTokenTypes.TAG_NAME, "p");
final boolean result = JavadocCommentsLexerUtil.isOpenTagName(token);

assertWithMessage("Non-slash token should be considered open tag name")
.that(result)
.isTrue();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not allow pure unit testing.
It is illusion of quality.

Please try to extend Input of existing Checks to kill such mutations.

If that is not possible, it good reason to not make test.
All test should be realistic on valid java classes and javadoc.

It is our biggest limitation that we are not working of non-compiled java sources.
Javadoc is a bit different, we allow some problems, but still we should have real Inputs of javadoc to see "tag without slash"

@guptapratykshh guptapratykshh force-pushed the issue-18024-resolve-pitest-suppressions-common branch 6 times, most recently from 0a6c17c to c8961cd Compare December 2, 2025 18:56
@romani
Copy link
Member

romani commented Dec 3, 2025

Please keep ci fully green

@guptapratykshh guptapratykshh force-pushed the issue-18024-resolve-pitest-suppressions-common branch 5 times, most recently from 6ee65da to 8c94b48 Compare December 4, 2025 22:30
@guptapratykshh guptapratykshh force-pushed the issue-18024-resolve-pitest-suppressions-common branch from 8c94b48 to 3fbce06 Compare December 4, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants