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

How to tell PIT to not mutate some specific portions of code?

It happens that there are sometimes lines of code or methods that can't produce mutants that are going to be killed by any relevant test. (For instance I may be using a null pattern object, and some of the implemented methods are not relevant in…
gturri
  • 13,807
  • 9
  • 40
  • 57
5
votes
1 answer

How to exclude tests from PIT mutation analysis?

I'm in a drawn-out situation now with a difficult project where a significant part was refactored and checked in with a significant number of failing tests. I run PIT in maven but I haven't been able to for a long time because the tests have to be…
Adam
  • 5,215
  • 5
  • 51
  • 90
4
votes
2 answers

Possible to fail maven build when any PIT mutation fails, rather than mutation coverage?

I'm using the pitest-maven plugin for my project, and would like to have the maven build fail if there is any mutation that fails. But I can't see a configuration option that allows me to do that. I can see mutationThreshold and coverageThreshold,…
zodac
  • 285
  • 10
  • 26
4
votes
1 answer

Mutation Testing - Negated conditional on a for-each loop?

we are just playing around a bit with mutation testing and there is one thing I don't understand. Why is it always trying to apply the "Negated Conditional Mutator" on my for-each loops like this one: for (final Order order : orders) If I take a…
Core_F
  • 3,372
  • 3
  • 30
  • 53
4
votes
0 answers

Pitest, Spring Boot, Gradle Plugin Error

I am currently trying to add Mutation testing to a gradle project. I have successfully added it on a simple test project that purely has a noddy test class but I cannot seem to add it into the main project. After much searching I have found no…
KirisuteRanza
  • 367
  • 3
  • 15
4
votes
5 answers

Pitest can't detect class of test

i have problem with my configuration of maven and pitest. Pitest generation mutation is ok but he can't see my class of test .. if you have any solution :D I have main source like that /src/main/java/com.plugin..... .java I have test source…
Modship
  • 57
  • 1
  • 6
4
votes
0 answers

PIT mutation testing: Coverage generation minion exited abnormally

I use pitest with Maven in Jenkins. In my pom.xml I have org.pitest pitest-maven 1.1.8
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
4
votes
1 answer

pitest not able to locate junit test

My gradle pitest is not able to give me the right results. It looks like it is not able to locate my test files. I have the following build.gradle file: apply plugin: "java" apply plugin: "maven" apply plugin: "info.solidsoft.pitest" group =…
user2435439
4
votes
1 answer

PIT Mutation testing on apache commons math shows line coverage and mutation coverage as 0%

I am trying to use PIT Mutation testing with maven for apache common math tests. org.pitest pitest-maven 0.29
Biparite
  • 203
  • 1
  • 2
  • 13
4
votes
1 answer

Android: How to run PIT Mutation Testing with Robolectric?

How to use Robolectric and PIT for testing an Android Application? With Robolectric, you can run Android Tests in the JVM. With PIT you can show line coverage and do mutation testing. For me, it's ok use Eclipse+Plugins, but no requirement. This is…
sulai
  • 5,204
  • 2
  • 29
  • 44
3
votes
2 answers

Pi Test mutation surviving when trying to reduce time complexity

I have an algorithm that checks which String in a given List of Strings matches the most with another given string, it goes as- String calcMostMatching(String mainStr, List strings) { String mostMatching = null; if…
BeastMaster64
  • 147
  • 1
  • 13
3
votes
1 answer

What these two tags represent in a Pitest XML report?

I am currently trying to extract mutations generated from tools' reports, and I'm currently struggling with Pitest. Given an XML Pitest report, it has a mutation list; each mutation element has n attributes, including index and block, which I cannot…
crissal
  • 2,547
  • 7
  • 25
3
votes
2 answers

PIT Coverage generation minion exited abnormally

i see the following stacktrace when running the pitest gradle task in my project after adding all the required configurations in build.gradle. Can you please help me on this ? I'm using 1.5.1 version of the plugin. The changes have been done in…
3
votes
1 answer

PITest Issue: property 'mainClass' is final and cannot be changed any further

I have recently upgraded my project from Java 8 to Java 11 alongside Gradle 6.5. However, when I run the command ./gradlew pitest I receive the following error: Execution failed for task ':pitest'. > The value for task ':pitest' property 'mainClass'…
Oozeerally
  • 842
  • 12
  • 24
3
votes
1 answer

Can pitest be configured to mutation test code that exists a maven dependent jar file and not the maven module itself?

We are currently introducing parallel builds into our maven project to reduce build times. We have 4 modules in our maven project. main-app main-app-mutation-test main-app-integration-test main-app-acceptance-test As part of the parallel build, we…
Nos
  • 1,024
  • 1
  • 8
  • 14
1
2
3
10 11