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
2
votes
1 answer

Why does pitest work with maven on the commandline, but not in Jenkins-Pipeline?

I have a strange problem here for which I could not find the reason: When using pitest with maven (and java 11) on the commandline it works as expected, but when running it on the Jenkins-Server via declarative pipeline it results in an error. Part…
PowerStat
  • 3,757
  • 8
  • 32
  • 57
2
votes
1 answer

Set Environment variables in gradle-pitest-plugin

Have a project that builds successfully and will pass all tests, except when running pitest. build.gradle is setup to have some environment variables configured in ext. On bootRun or test tasks those environment variables are set. However,…
2
votes
1 answer

parent project pitest failing but subprojects running fine if executed individually

I am using gradle wrapper to run my pitest. I have parent build.gradle which has the pitest defined. My subprojects does not have any pitest. If I run the pitest on individual project for example gradlew clean :myproject:pitest. Then the pitest is…
Kedar
  • 21
  • 1
2
votes
1 answer

How to kill conditional boundary mutant

I'm starting to dig into Code Analysis and mutants. I'm using PITest as a plugin on my eclipse Project. I ran into this mutant that I can't kill. Suppose I have the following code. class Mutation{ public static void main(String [] args){ …
rockability
  • 63
  • 1
  • 4
2
votes
1 answer

PIT no mutations found

C:\Users\TZ>java -cp…
TZ Z
  • 33
  • 1
  • 4
2
votes
1 answer

piTest removed call to "forEach" SURVIVED

TL;DR I think mutation should be killed but it survived. I am looking for the reason why it's happening and how to fix these 2 things: (1) Timeout (2) mutation survived. Details I have a spring web application and am testing using testng. I have…
zur
  • 1,121
  • 1
  • 11
  • 21
2
votes
2 answers

Automatically recognize which mutants killed by which test cases in Pitest

I am using Pitest for mutation testing and I need lots of mutants for a project (for example 500 mutants). I need a matrix which shows which mutants that the Pitest has created, killed by which test cases. I can do it manually, but it takes a long…
2
votes
0 answers

IntelliJ PitTest plugin has a missing dependency?

I have installed PIT Mutation testing Idea plugin for IntelliJ. I have a small demo project in Java 8, it runs the mutation tests perfectly. Our larger project, which is still Java 7 consists of a parent with a lot of Maven modules. I'm not sure if…
JohannisK
  • 535
  • 2
  • 10
2
votes
1 answer

Issues running a custom PIT Mutation Engine Plugin

I'm writing a custom Mutation Engine for PIT, but I'm having troubles getting PIT to find it. My guess is that I'm failing to put the package with my own engine in the right classpath when running PIT using a project. To test my engine I'm using…
2
votes
1 answer

Modify the default report folder of pitest target/pit-reports/YYYYMMDDHHMI

is it possible to rename the report default folder ? I don't want to have "YYYYMMDDHHMI", I'm trying to rename it to something simple and constant. Thanks
user3574857
  • 377
  • 4
  • 16
2
votes
1 answer

pitest doesn't find tests

I am facing a problem with the SonarQube project. I want to calculate some statistics about test quality and I am using pitest. Unfortunately, it doesn't find any test to mutate. This is the pom.xml of the module that I am analyzing:
Davide Spadini
  • 271
  • 2
  • 7
2
votes
2 answers

Mutation killing

I am stuck at 1 point and need suggestions. While writing junit for my code I'm not able to kill the ValidateArgument.notNull(arg1) mutation !!! Need Suggestions. code follows as.. public class A{ public void method1(Object B){ …
CryoMancer
  • 23
  • 1
  • 4
2
votes
1 answer

Incremental run of testsuite

We have a large project that has several thousands of tests in the testsuite, and the full testsuite run takes very long time. I am looking for a tool that I can integrate in the Maven build that will run only those tests that might be affected…
2
votes
2 answers

How do I run a pitest ant script

I'm trying to create an ant script to run pitest to be able to automate my mutation testing. I am getting the error: Could not find or load main class org.pitest.mutationtest.commandline.MutationCoverageReport This is my MutationTest.xml ant…
DeadEli
  • 983
  • 2
  • 13
  • 28
2
votes
0 answers

SpringJUnitRunner based tests fail under PIT

I have a project that utilizes SpringJUnitRunner for testing the controllers and filters. When I run the test normally, everything runs fine. However, when I run the tests with PIT I get the following exception for every test using the…
Jesse
  • 83
  • 1
  • 6