Questions tagged [pitest]

PIT is a fast bytecode-based mutation testing system for Java.

PIT is a state of the art mutation testing system, providing gold standard test coverage for Java and the jvm. It's fast, scalable and integrates with modern test and build tooling (Gradle, Maven, IntellJ IDEA, Eclipse ...).

What is a mutation?
A mutation is a piece of code added or modified in an application code base.

What is mutation testing?
A mutation (fault) can create side effects or not at all. Those side effects can be detected (ie fault killed) by the application tests suite or not. The more faults killed by the application tests suite, the better the suite is. However, when a fault keeps living, here comes mutation testing.

How does PIT mutation testing work?
It detects whether each statement is meaningfully tested by running unit tests against automatically modified versions of the application code. PIT chooses and prioritises tests based on three factors: Line coverage, Test execution speed and Test naming convention.

More details: http://pitest.org, http://pitest.org/faq

165 questions
0
votes
0 answers

I tried to make mutation test. In Intellij idea ı used pitest. But ı get an error message that the HTML file could not be created

Error: Could not find or load main class org.pitest.mutationtest.commandline.MutationCoverageReport Caused by: java.lang.ClassNotFoundException: org.pitest.mutationtest.commandline.MutationCoverageReport
Ece Ayvaz
  • 53
  • 4
0
votes
0 answers

Having trouble killing some mutations

I having some trouble killing some mutations and I don't understand why. Here is the class that I'm testing @Configuration @EnableScheduling public class TasksDeclaration { private static final Logger LOGGER =…
Steve B
  • 557
  • 2
  • 7
  • 23
0
votes
1 answer

Running pitest with maven fails to find or load org.pitest.coverage.execute.CoverageMinion

I am learning about mutation testing with pitest and facing problems when I try to run it with maven. In my pom.xml I have the pitest dependency: org.pitest pitest
JustAnotherDeveloper
  • 2,061
  • 2
  • 10
  • 24
0
votes
1 answer

How to kill negated conditional survived mutant

I have this code which I want to test and get the max pit coverage but I am not able to kill the mutant for the negated condition if (close). I am also using mockito to throw some exception. public static void copyBytes(InputStream in, OutputStream…
leop
  • 41
  • 7
0
votes
1 answer

Mutation testing booleans with Java

I have very very little experience with Java and I'm facing some issues. I've got a code that looks like the one below and a goal to kill all mutations of it. public class MyClass { protected transient boolean something = false; public MyClass…
Gabriel Milan
  • 702
  • 2
  • 7
  • 21
0
votes
1 answer

Getting CustomMessageMissingMethodException when configuring gradle-pitest-plugin

I'm trying to include mutation testing for my Android local UnitTests. I found https://pitest.org/ framework which I tried to include using the "officially" recommended gradle plugin from here: https://gradle-pitest-plugin.solidsoft.info/ Gradle…
Patrick Pötz
  • 369
  • 5
  • 15
0
votes
1 answer

Pitest: How to set paths correct in different modules

I have a huge project for which I am testing mutation testing with Pitest. The project is in an OSGi form and having all modules separated. I have this…
J K Fan
  • 1
  • 2
0
votes
0 answers

Mutation testing for condition that does not affect return

I’m running a pit mutation test for my function and I can’t seem to cover this line for the negated conditional. So it’s a if statement that does a substring to build a url for the service call. public List retrievePlayers(List
J W
  • 107
  • 1
  • 10
0
votes
0 answers

Pit Mutation Test: tests found, no minions possible

I use the PIT Mutation Test for a huge java programm (over 450.000 LOC). It is all seperated into com.myProgramm.TheNormalClasses and com.myProgramm.TheNormalClasses.Test. So I change my pom.xml in the com.myProgramm.TheNormalClasses.Test to this: …
J K Fan
  • 1
  • 2
0
votes
1 answer

PITest hangs at start of test run

I'm trying to run PITest on the master version of light4j (https://github.com/networknt/light-4j), a project I selected more or less at random to try out PITest on real world code. The test completed fine on most modules, except for the 'cient'…
0
votes
1 answer

Maven PITest Error "No plugin found for for prefix 'org.pitest' in the current project and in the plugin groups"

I need to make a mutation test with PITest, but I'm having a hard time trying to install it via Maven, when I try to run PIT to execute mutations and the test case, I receive this error in the cmd: "No plugin found for for prefix 'org.pitest' in…
Mateus99
  • 119
  • 1
  • 2
  • 9
0
votes
0 answers

PITEST mutationCoverage is returning SocketException

While running clean test verify org.pitest:pitest-maven:mutationCoverage, getting the below exception. PIT >> INFO : MINION : .pitest.testapi.execute.containers.UnContainer.execute(UnContainer.java:31) - at…
TechPassionate
  • 1,547
  • 1
  • 11
  • 18
0
votes
1 answer

PiTest failing in CI maven build with "Input byte array has wrong 4-byte ending unit" even with no source code changes

My CI build is failing during the org.pitest:mutationCoverage goal when pushing up new code. My patchset has no changes to any source code (just a new, empty commit), yet the following error is printed: 16:49:26 [ERROR] Failed to execute goal…
zodac
  • 285
  • 10
  • 26
0
votes
1 answer

Java PIT classpath issue

I am having a folder "mutant" which contains a text file with just a single line called java.utils.Collection. I have generated test cases using Randoop and saved them in the same folder. The test cases have names RegressionTest*.java I am trying to…
Bayko
  • 1,344
  • 2
  • 18
  • 25
0
votes
1 answer

Pitest: How to redirect the log output to a file?

I apply Pitest (PIT) using Maven to Java projects to conduct a mutation analysis. The console's pipe operator only catches Maven-related output but not output by PIT. (This happens both on Linux and Windows.) How can I redirect the logging output…
nrainer
  • 2,542
  • 2
  • 23
  • 35
1 2 3
10
11