Questions tagged [mutation-testing]

A method of software testing that involves modifying the source code or compiled intermediate code (Java: byte code, .NET: IL). Test suites that do not fail under each of these "mutations" is considered to be inadequate.

Mutation testing is a method of testing the adequacy of test suites. By applying mutations to the code under test, the effectiveness of a test suite can be judged. If the test suite fails under this mutation, it is effective against it.

Different mutation types are used: Ma, Offutt and Kwon describe intra-method, inter-method, intra-class and inter-class mutations. The simplest to implement is intra-method mutation, for which some of the mutations that may be used are:

  • Statement deletion.
  • Replace each boolean subexpression with true and false.
  • Replace each arithmetic operation with another one, e.g. + with *, - and /.
  • Replace each boolean relation with another one, e.g. > with >=, == and <=.
  • Replace each variable with another variable declared in the same scope (variable types should be the same). (source: Wikipedia)
191 questions
0
votes
2 answers

PIT >> INFO : MINION : 3:10:40 pm PIT >> INFO : Found 0 tests

I am trying to integrate PIT testing into my project. This is my pom.xml file. pom.xml
Prashin Jeevaganth
  • 1,223
  • 1
  • 18
  • 42
0
votes
1 answer

PITest skips tests in ant

I have the problem, that PITest skips some of my tests. It reports no line coverage for the tested class and all mutations in stay alive: replaced return value with Collections.emptyList for ... → NO_COVERAGE The list below is empty: Tests…
Johannes von Zmuda
  • 1,814
  • 8
  • 14
0
votes
1 answer

Trying to unit test a method and I'm unable to get rid of a mutation

I'm using JUnit 5 and Pitest 1.6.2, and I'm trying to unit test the following method public class Validator { public static final int MAX_REQUEST_ID_LENGTH = 36; public void validateHeader(String requestId, String retryIndicator,…
Steve B
  • 557
  • 2
  • 7
  • 23
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

How to Kill Surviving mutation JavaScript

I have this code const writeToDB = async (data) => { console.log("Inside db put") try { const resp = await dynamoDB.put(data).promise(); console.log("Data added db: ", resp); return "successfully inserted" } catch…
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
0 answers

Cannot run Pit Ideea Plugin with Junit5

I have a project with Java11 and Junit5 and cannot run PIT Mutation testing via InteliJ plugin. The error I get is: Exception in thread "main" org.pitest.util.PitError: Coverage generation minion exited abnormally. Please check the classpath and/or…
Adriana Lazar
  • 651
  • 5
  • 3
0
votes
0 answers

no mutations found PitTest Maven

First time trying to use pitTest and maven, Using IntelliJ Idea. For the following pom.xml snippet: org.apache.maven.plugins
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
0 answers

PI Testing for Spring batch applications

I am trying to run Pi tests on one of my application of spring batch but after running it I am getting TIMED_OUT warnings saying Minion exited abnormally. So whether PI test supports spring batch applications or not ? Moreover I am getting warnings…
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

NoSuchMethodError when using Embedded Cassandra with Mutation Tests

Recently while merging in some new unit tests into my working branch, I started seeing this error: Exception (java.lang.NoSuchMethodError) encountered during startup:…
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331