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
3
votes
3 answers

Skip running PITest in maven build

I'm trying to run a maven build from command line and exclude PITest from running any mutations. Currently the reports are failing and we need to be able to give a parameter to ignore running the mutation tests or ignore the results and continue the…
RyderSchoon
  • 33
  • 1
  • 4
3
votes
1 answer

Is it good practice to perform mutation testing on user interfaces?

My teammate and I are having an hard time understanding if mutation testing can / should be done on JUnit tests referring to Swing classes. More precisely, we are currently using Junit 4 and Assertj Swing to test the interface for an assignment on…
leoScomme
  • 109
  • 1
  • 1
  • 11
3
votes
1 answer

How to refactor survived mutations away for try-resource and an equivalent mutant?

I am experimenting with junit5 and pitest. My code under test looks like: // [...] InputStream istream = this.getClass().getResourceAsStream("/" + file.getName()); if (istream == null) // 1. negated condition -> suvived { istream =…
PowerStat
  • 3,757
  • 8
  • 32
  • 57
3
votes
2 answers

Gradle - Run pitest only on subprojects

I'm trying to have Jenkins run pitest on my project. The fact that there is a parent build.gradle with sub-projects seems to be an issue. When running gradle pitest I get: 12:14:17 PIT >> INFO : Sending 0 test classes to minion 12:14:17 PIT >> INFO…
algiogia
  • 936
  • 2
  • 14
  • 40
3
votes
0 answers

How do I can take the Pitest coverage report in Sonarqube instead of JaCoco?

I use Sonarqube 6.7.1 and the project in Gradle 3.0. I am generating Pitest report successfully, Sonarqube take Pitest xml report and creating the issues successfully too. I need replace the jaCoco project coverage to Pitest line coverage because…
3
votes
1 answer

Excluding certain lines of code in PITest

I am using the excellent PITest framework. I was wondering if there is something equivalent to Sonars "// NOSONAR" in PITest, whereby certain lines just get excluded from PITest coverage (so it's not red on the report)? I know methods and classes…
Nos
  • 1,024
  • 1
  • 8
  • 14
3
votes
1 answer

How do we activate and use non default deactivated mutators in Pitclipse?

I was using PITclipse on Eclipse to run PIT mutation tests on code. I noticed in the PIT documentation where it stated that the some of the mutators are not activated by default. Even in PITclipse these mutators do not seem to be used. I wanted to…
nitinkaveriappa
  • 91
  • 2
  • 10
3
votes
1 answer

PITest cannot find tests

Our projects are all set up with a master parent for the entire company. For the project I'm working on, we have a root pom that references that parent with many modules underneath it. Attempting to use PITest with any one of these modules…
snowe
  • 1,312
  • 1
  • 20
  • 41
2
votes
1 answer

Pitest failing after spring/springboot/gradle upgrade

Facing the below build error while upgrading project to springboot 2.7.7 / spring 5.4/junit 5/gradle 7.2 and pitest vesion from 1.4.0 to 1.9.0. Cannot set the value of a property of type org.gradle.api.file.Directory using an instance of type…
KVL
  • 95
  • 1
  • 14
2
votes
2 answers

JAVA | Mutation Testing | PiTEST | changed conditional boundary → SURVIVED | Impossible to kill

I am initializing a final int field in a constructor by inspecting a local scale int value with respect to zero. My code is of the form: final int scale = calculateScale(); if (scale == 0) { this.scale = 0; } else if (scale > 0) { this.scale…
gary
  • 498
  • 4
  • 9
2
votes
1 answer

What is coupling effect in mutation testing?

While I am learning about mutation testing, I've read in Wikipedia: The coupling effect asserts that simple faults can cascade or couple to form other emergent faults. Subtle and important faults are also revealed by higher-order mutants, which…
Hamza Belmellouki
  • 2,516
  • 1
  • 18
  • 39
2
votes
3 answers

What does removed call to "com.some.Filename::someMethodName" --> SURVIVED mean in pitest?

What does removed call to "com.some.Filename::someMethodName" --> SURVIVED mean in pitest. Does it mean that if that method call is removed, the code will still work properly?
Shruti Joshi
  • 301
  • 1
  • 4
  • 16
2
votes
0 answers

Pitest report-aggregate goal complains about transitive dependencies

I integrated Pitest according to https://pitest.org/aggregating_tests_across_modules/ in a Maven module project (Maven version 3.5.4). When running mvn clean package the log shows the Pitest execution for the target modules (i.e. the modules for…
Mark Schäfer
  • 925
  • 1
  • 12
  • 23
2
votes
1 answer

Is it possible to extract mutation testing results for every test method with Pit Mutation Test

I know that PIT Mutation Test framework can export mutation coverage information based on the test suite or the test class. However, I was wondering if there is an option to extract or export mutation coverage information based on the test case…
Ekin
  • 407
  • 1
  • 6
  • 17
2
votes
1 answer

Is there a way to update the version of pitest used in pitclipse plugin?

I recently installed pitclipse plugin to test my unit tests in eclipse. Now I face the problem that pitclipse did not get any update since pitest 1.1.9 and I really want to use the latest version (currently 1.4.9). I have tried several things: First…
Magelan
  • 189
  • 1
  • 13
1 2
3
10 11