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
1
vote
1 answer

PITest: JavaLaunchHelper is implemented in both

Recently I started using PITest for Mutation Testing. Post building my project using maven when I run the command mvn org.pitest:pitest-maven:mutationCoverage I get this error bunch of times: -stderr : objc[2787]: Class JavaLaunchHelper is…
AB HAT
  • 77
  • 1
  • 8
1
vote
1 answer

PIT mutation testing and Play framework (java)

Any idea on how we can use PIT mutation testing with a JAVA Play project ? PIT provides integration with Maven, Ant and CLI , but I don't find any way to use it on a Play application. Thanks in advance.
Romain
  • 51
  • 1
  • 2
1
vote
0 answers

Unit test fails on PITclipse but succeeds in JUnit

In PITclipse, I am receiving this error after the test: Exception in thread "main" org.pitest.help.PitHelpError: All tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite. See http://pitest.org…
codingbash
  • 1,102
  • 1
  • 9
  • 21
1
vote
1 answer

Exclude provided dependency from classpath when running PIT

I'd like to use the PIT (pitest.org) plugin on an Android project. I'm using the Android Maven plugin and have a fairly standard POM. The Android JAR is included by Maven with a provided scope and includes actual sources, not the stubbed JAR from…
Thorn G
  • 12,620
  • 2
  • 44
  • 56
0
votes
0 answers

Facing (Kill ratio is NaN% (0 0)) Issue when running Mutation test pittest in Jenkins

Hi we recently migrated from java 11 to java 17 after migration, We are facing following Issue when running MutationTest in Jenkins Kill ratio is NaN% (0 0) when we run in…
0
votes
1 answer

Pitest is not finding my JUNIT tests on param

I introduced the Pitest as a stage in our development schedule, but in one of the project it is not working and generating this info message: Skipping project because: [INFO] - Project has no tests, it is empty. Researching we found out could be…
NotInCheck
  • 21
  • 4
0
votes
0 answers

Pitest is failing and not generating mutation coverage

I'm trying to run Pitest in my project, but keep receiving this error: Failed to execute goal org.pitest:pitest-maven:1.14.2:mutationCoverage (default-cli) on project image-finder: Execution default-cli of goal…
0
votes
1 answer

Pit report mutation coverage Issue when trying to run coverage

I am getting this error when trying to run mutation coverage mvn org.pitest:pitest-maven:mutationCoverage or mvn verify -PPIT -X in debug mode. Error: Execution pit-report of goal org.pitest:pitest-maven:1.13.0:mutationCoverage failed: Coverage…
Mohammad
  • 1
  • 1
0
votes
1 answer

Calculating Test Strength from the XML output, what does 'detected' represent?

I am attempting to calculate the Test Strength generated by the HTML output from the data within the XML output of PIT however the figure I calculate doesn't align with the Test Strength from the HTML report. I use the equation (mutationsKilled /…
Jack Johns
  • 59
  • 7
0
votes
2 answers

Is Kotest5 compatible with pitest?

Is Kotest5 compatible with pitest? I'm using Kotest5 for my tests with a micronaut application. I am using the gradle-pitest-plugin as well as the Kotest pitest extension like the docs say. However I keep getting an error like The testing…
Rob Schwartz
  • 192
  • 1
  • 12
0
votes
1 answer

Pitest mutation testing execute over kotlin files only

I arrived to a legacy project where multiple files are developed in Java and many others in Kotlin. I have be able to configure Pitest to execute the mutation test and i have a correct report. Now I would like to execute the mutation test only over…
j.barrio
  • 1,006
  • 1
  • 13
  • 37
0
votes
0 answers
0
votes
0 answers

Gradle Pitest task works from cmd but fails in Jenkins

I have a gradle script that goes along these lines (some parts were ommited). buildscript { repositories { mavenCentral() maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") } maven {…
0
votes
1 answer

How to get killing tests against each mutant or a complete killing matrix with PIT1.3.0?

I am using jdk7 on defects4j 1.0 and I need to use PITest to mutate the code. As is shown in the releases of pit, https://github.com/hcoles/pitest/releases?page=5 pit1.4+ no longer supports jdk7 so I have to choose pit1.3.2 to do my research. But I…
Albert
  • 1
  • 1
0
votes
1 answer

Mockito-core with pitest

I have to upgrade dependencies for a module and I use pitest version 1.7.4. When I update the mockito-core version to 4.5.0 all my tests from pitest fail with message "did not pass wihout mutation". With mockito-core 4.0.0 everything works…
Rain03
  • 41
  • 1
  • 7