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

Mutation Survives When Comparing to Empty String in C++?

I am mutating my code and it's complaining that the following mutation survived: --- /home/user/src/file.cc 2019-12-03 13:48:12.510311 +++ /home/user/src/file.cc 2019-12-03 14:00:14.164006 @@ -283,7 +283,7 @@ } bool…
Stephen Rasku
  • 2,554
  • 7
  • 29
  • 51
0
votes
1 answer

Infection Throws Exeption, but why, and how to handle it?

The Task is that the error does bot explain that problem right. The Error: Project tests must be in a passing state before running Infection. Infection runs the test suite in a RANDOM order. Make sure your tests do not have hidden dependencies.…
episch
  • 388
  • 2
  • 19
0
votes
1 answer

Maven PITest Error "No plugin found for for prefix 'org.pitest' in the current project and in the plugin groups"

I need to make a mutation test with PITest, but I'm having a hard time trying to install it via Maven, when I try to run PIT to execute mutations and the test case, I receive this error in the cmd: "No plugin found for for prefix 'org.pitest' in…
Mateus99
  • 119
  • 1
  • 2
  • 9
0
votes
1 answer

how to test this class with JUnit testing?

I have TicTacToe game in java language and I have to do Junit test cases for this Game class, because I need to apply mutation testing for this application. can anyone help me to write good test cases. public class Game { private Board…
user11188291
0
votes
1 answer

So, a mutant escaped. Now what?

I've just managed to get mutation testing working for the first time. My usual testing framework is Codeception but as of writing, it is not compatible with mutation testing (although I believe work is being done on it and it's not far off). I'm…
CJ Dennis
  • 4,226
  • 2
  • 40
  • 69
0
votes
1 answer

How to read and test a class from java extension file in junit? How can I access that class for testing?

In a software for mutation testing, a lot of mutants of java extension files (like mutant01.java) are created. Now I need to test these files by using jUnit4. I'm trying to find out the way that I will be able to read the file and then access a…
dr.faisu
  • 1
  • 1
0
votes
2 answers

phpdbg hits memory limit when mutation testing with Infection

I keep getting a memory exhausted error when trying to run infection tests using phpdbg. I've tried setting the -d memory_limit but it seems to get ignored. Below is some sample output: $ phpdbg -qrr -d memory_limit=1G vendor/bin/infection You are…
Xethron
  • 1,116
  • 9
  • 24
0
votes
1 answer

Major mutation framework 0 mutants covered

When I run the major tool (http://mutation-testing.org/) on the examples provided, I am able to generate and analyze mutants. I am also able to generate mutants from my own .java files but when I try to run my junit test suites on them, it reports…
0
votes
1 answer

Finish phpunit-tests always during infection testing: teardown method not called after a failure

I use the infection testing framework https://github.com/infection/infection During a test some parts of the code are changed so that the test fails und does not run completely nor use the PHPUnit Teardown method. My question is: Does someone know a…
0
votes
1 answer

Mutation Testing with Rspec

I'm attempting to perform a mutation-test on some ruby code using rspec. I am just learning ruby and I don't really know if I'm doing it right. Part of the code I'm trying to test is: class Cipher def initialize() @a_offset = 65…
0
votes
1 answer

Use MuClipse to get mutant and test case information

I'm using MuClipse and I need to get information about which use case kills which mutant. MuClipse provides only the mutation score. How do I get that information from MuClipse?
0
votes
1 answer

Java ASM, collect all overloading methods and replace the invocation with all the others

Is there a tool/method in ASM to collect all the methods in a class and then replace the invocation of a class with those overloading methods? I'm trying to use ASM with mutation testing to do these: replace a method with its overloading methods …
knt5784
  • 129
  • 1
  • 2
  • 16
0
votes
2 answers

Filter classes in ant when using pitest

Let us consider this basic ant+pitest example: https://github.com/hcoles/pitest-ant-example The classpath to the test classes is defined as follow: