Skip to content

Cover pitest survivals with tests #14019

@Kevin222004

Description

@Kevin222004

As a part of this issue, we have to kill the mutation listed below and remove the suppression from pitest xxxx suppression.xml

To understanding how to kill the mutation
Visit Wiki page, Pitest-docs and expected actions and workflow at #12341.

1) Pitest-Filters


1) SuppressWithNearbyCommentFilter

  • NonVoidMethodCallMutator on if (!cachedFileAbsolutePath.equals(eventFileTextAbsolutePath))

2) SuppressWithNearbyTextFilter

some details at #12952, almost finished #15941 but abandoned (everyone is welcome to continue)

  • NonVoidMethodCallMutator on if (!cachedFileAbsolutePath.equals(eventFileTextAbsolutePath))
  • RemoveConditionalMutator_EQUAL_IF on if (!cachedFileAbsolutePath.equals(eventFileTextAbsolutePath))

3) XpathFilterElement

  • ArgumentPropagationMutator on Optional.ofNullable(checks).map(CommonUtil::createPattern).orElse(null)
  • NonVoidMethodCallMutator on Optional.ofNullable(checks).map(CommonUtil::createPattern).orElse(null)
  • NakedReceiverMutator on .stream().map(AbstractNode.class::cast).collect(Collectors.toList())

4) SuppressionXpathSingleFilter


2) Pitest-Common

1) SarifLogger

  • ArgumentPropagationMutator on .replace(MESSAGE_PLACEHOLDER, escape(event.getMessage()))
  • NonVoidMethodCallMutator on final String version = SarifLogger.class.getPackage().getImplementationVersion();
  • NonVoidMethodCallMutator on int length = inputStream.read(buffer)

2) Checker

  • ArgumentPropagationMutator on final String stripped = CommonUtil.relativizePath(basedir, fileName);
  • NonVoidMethodCallMutator on this.severity = SeverityLevel.getInstance(severity);
  • MemberVariableMutator on this.severity = SeverityLevel.getInstance(severity);

3) XMLLogger$FileMessages

  • ArgumentPropagationMutator on private final List<Throwable> exceptions = Collections.synchronizedList(
  • ArgumentPropagationMutator on private final List<AuditEvent> errors = Collections.synchronizedList

4) XMLLogger

  • ArgumentPropagationMutator on fileMessages.remove(fileName);
  • ArgumentPropagationMutator on + encode(event.getMessage())
  • ArgumentPropagationMutator on writer.print(encode(event.getModuleId()))
  • ArgumentPropagationMutator on writer.print(encode(event.getSourceName())
  • ArgumentPropagationMutator on writer.println("<file name=\"" + encode(fileName)
  • NonVoidMethodCallMutator on final String version = XMLLogger.class.getPackage().getImplementationVersion();
  • NonVoidMethodCallMutator on fileMessages.remove(fileName);

3) Pitest-Utils


1) ScopeUtil

  • RemoveConditionalMutator_EQUAL_IF on parent.getParent().getType() == memberType
  • RemoveConditionalMutator_EQUAL_IF on for (DetailAST token = aMods.getFirstChild(); token != null
  • RemoveConditionalMutator_EQUAL_IF on token != null && !returnValue;
  • NakedReceiverMutator on .filter(ModuleReflectionUtil::isCheckstyleModule)
  • NakedReceiverMutator on for (DetailAST token = node.getParent();
  • NakedReceiverMutator on .orElseGet(() -> getDefaultScope(aMods.getParent()))

2) ModuleReflectionUtil

  • NakedReceiverMutator on .filter(ModuleReflectionUtil::isCheckstyleModule)

3) BlockCommentPosition


4) Pitest-tree-walker

1) SuppressionsStringPrinter

  • ArgumentPropagationMutator on System.getProperty("file.encoding", StandardCharsets.UTF_8.name()
  • NonVoidMethodCallMutator on System.getProperty("file.encoding", StandardCharsets.UTF_8.name()
  • NakedReceiverMutator on final FileText fileText = new FileText(file.getAbsoluteFile

2) TreeWalker


3) DetailNodeTreeStringPrinter

  • ArgumentPropagationMutator on System.getProperty("file.encoding", StandardCharsets.UTF_8.name()
  • NonVoidMethodCallMutator on System.getProperty("file.encoding", StandardCharsets.UTF_8.name()
  • NakedReceiverMutator on final FileText text = new FileText(file.getAbsoluteFile()

JavadocDetailNodeParser

  • NonVoidMethodCallMutator on htmlTagNameStart = stack.pop()

5) Pitest-main

1) Main

  • NonVoidMethodCallMutator on return "Checkstyle version: " + Main.class.getPackage().getImplementationVersion
  • NonVoidMethodCallMutator on getOutputStreamOptions(options.outputPath))
  • NonVoidMethodCallMutator on + Main.class.getPackage().getImplementationVersion

2) Main$CliOptions

  • NakedReceiverMutator on .map(Pattern::quote)

6) Pitest-ant

1) CheckstyleAntTask$Property

  • EmptyObjectReturnValsMutator on return key;

2) CheckstyleAntTask

  • ArgumentPropagationMutator on throw new BuildException(String.format(Locale.ROOT, " Unable to create Root Module
  • ArgumentPropagationMutator on throw new BuildException(String.format(Locale.ROOT, "Unable to create listeners:
  • ArgumentPropagationMutator on + Objects.toString(checkstyleVersion, "")
  • ArgumentPropagationMutator on log(String.format(Locale.ROOT, "%d) Adding %d files from directory
  • NonVoidMethodCallMutator there are 15 of this type, choose single
  • MemberVariableMutator on private int maxWarnings = Integer.MAX_VALUE
  • MemberVariableMutator on this.maxErrors = maxErrors

MemberVariableMutator all are delayed until hcoles/pitest#1230

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions