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

Simple mutation unit testing erroneously report survival of the mutation of the exception message

Suppose we have a Calculator with a divide method throwing error if the denominator is 0: public class Calculator { public double Divide(int x, int y) { if (y == 0) { throw new…
JamesL
  • 351
  • 2
  • 10
0
votes
0 answers

Stryker Mutation test fails when debug statement is added in c# method

Stryker fails to run any test cases under a xunit test class when debug statement is included in the code block. I have a few test cases covering the below method. Stryker fails to run those tests and also other tests available for other methods in…
IamChandu
  • 355
  • 6
  • 18
0
votes
0 answers

Wht python package "mutmut" doesn't work with and command "mutmut results" returns error?

Good day. I have a problem with mutmut package. I have installed "mutmut" and create config.cfg [mutmut] paths_to_mutate=some_path/to/folder tests_dir=some_path/to/folder/tests After I run "mutmut run" I have message, that there are 65 mutants…
0
votes
0 answers

Encountering an error when running mut.py: "mut.py: error: unrecognized arguments"

When i try to run mut.py i encounter this error C:\Pprogs>mut.py --dcmotor_pid_control --dcmotor_tests -m usage: mut.py [-h] [--version] [--target TARGET [TARGET ...]] [--unit-test UNIT_TEST [UNIT_TEST ...]] [--runner RUNNER] [--report…
0
votes
1 answer

Conflicting module dependence in python project

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. cosmic-ray 8.3.5 requires virtualenv<=16.7.10, but you have virtualenv…
Dipu Krishnan
  • 181
  • 1
  • 2
0
votes
0 answers

Getting errors while trying to run stryker

Got the following error while trying to run stryker: Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration. By default "node_modules" folder is ignored by…
ptjr
  • 11
  • 2
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
1 answer

Vertigo (mutation testing for Solidity) - Command not found on Mac OS

I am on a Mac and want to install and use Vertigo (software tool for mutation testing Solidity smart contracts). I follow the installation instructions here: https://pypi.org/project/eth-vertigo/ And install Vertigo with: > pip3 install…
Jesper - jtk.eth
  • 7,026
  • 11
  • 36
  • 63
0
votes
1 answer

Java | Mutation Testing | PiTEST | (negated conditional → SURVIVED) | (changed conditional boundary → SURVIVED)

I am getting piTest issues. Few mutations are getting survived. PiTEST negated conditional → SURVIVED changed conditional boundary → SURVIVED As per my understanding i am testing boundary conditions for a>=5 i.e. a=4, a=5, a=6. Do i need to add…
satyam pandey
  • 43
  • 1
  • 7
0
votes
0 answers

I tried to do a Java mutation test using Pitclipse and the result did not show

I tried to do mutation testing on a program using pitclipse in Java but came across an issue and I do not know how to solve it. I am using the Eclipse IDE and Java SE 1.8. This is the code: public class NewTry { boolean productIsEven(int a,…
abc
  • 39
  • 6
0
votes
1 answer

How to programmatically alter source code in C++ file?

I need a way to take a C/C++ source code file, inspect and perform some modifications to it, and then write the modified variant back to disk. Possible use cases that I have for it are: Mutation testing, such as intentionally corrupting calculation…
0
votes
0 answers

Mutation Testing a boolean variable

Suppose you have a function func: def func(a, b = True): if b: return 1 else return 0 How do you fix the mutant when the code changes to: def func(a, b = False): if b: return 1 else return 0 Do you just write a test…
stackguy1723
  • 165
  • 1
  • 2
  • 12
0
votes
1 answer

Unable to install Dotnet Stryker

I have tried the below commands to install dotnet stryker to my project to improve the mutation testing but getting below error message and it does not allow me to install the tool. Could you please help on this. Thanks in advance PS C:\Users>…
0
votes
0 answers

Pitest not finding test cases

I'm integrating mutaiton testing using pitest plugin in my intellij here is my plugin for pitest org.pitest pitest-maven
ramkr
  • 41
  • 4
0
votes
1 answer

Where is the Pitest withHistory file stored?

So i'm using the -DwithHistory=true function for my Pitest configuration. Now i'm wondering where the history files are being stored to make sure that no other runner is overwriting this file. The historyInputFile and historyOutputFile don't work in…