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
1
vote
0 answers

OutOfMemoryError: pittest mutation testing

I want to generate a mutation testing report for my module (I have 225 classes in my module) using pitest. I've added the needed dependencies and configured the plugin. The problem is when I run the maven goal mvn…
Hamza Belmellouki
  • 2,516
  • 1
  • 18
  • 39
1
vote
1 answer

Stryker does not detect any of the tests in angular application

im trying to do mutation testing for my application, however when i run my stryker mutator it does not take any of the tests into the analysis and performs a dry run. WARN InputFileResolver Glob pattern "src/**/*.ts" did not result in any…
Alex Vulchev
  • 201
  • 1
  • 2
  • 15
1
vote
1 answer

How to kill a conditional boundary mutation concerning time

I'm trying to test the following class @Component public class StreamListener { @Value("${kafkaMessageExpiration.maxExpirationInMilliseconds}") private long messageExpirationTime; public void handleMessage(Payment payment) { …
Steve B
  • 557
  • 2
  • 7
  • 23
1
vote
0 answers

How to do Pit Tests (Mutation tests) with Junit5 in InteliJ

I tried to set up Pit Tests in inteliJ-idea but unfortunately i am not sure how to set it up, in the end i did them in eclipse and it is much easier to navigate, but i would like to know how to set them up on inteliJ-idea. It is kinda stupid to…
1
vote
0 answers

meaningless mutations while running mutation testing with Stryker

I am new to mutation testing. I use the Stryker library to generate and to run tests. But some mutations break the whole logic between code expressions. For example, // real code if (!(typeof age == 'number' && Math.trunc(age) == age)) throw new…
1
vote
1 answer

How to pass in arguments to mutant-rspec?

I'm trying to use the mutant-rspec library on a project that has the following directory structure app backend spec someclass_spec.rb src someclass.rb frontend I want to see how good my test coverage is on someclass_spec.rb,…
stk1234
  • 1,036
  • 3
  • 12
  • 29
1
vote
0 answers

Unable to cover if conditions in pitest

I have added two conditions in code: n the code if gets covered properly, however I am not able to cover the else if part public Optional < Flavors > callIcecream() { try { if (icecream == 1) { //do something …
Shruti Joshi
  • 301
  • 1
  • 4
  • 16
1
vote
0 answers

Where to put the PIT mutation testing history file?

Where do I put the PIT mutation testing history file so that a new Jenkins job picks it up? Because when I build on Jenkins, the job starts every time on an entirely new workspace without any previous analysis history, which results in a looooong…
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
1
vote
1 answer

what is the different between default, stronger and all operators in Pitclipse?

I was using PITclipse on Eclipse to run PIT mutation tests on code. There are three type of operators in PITclipse: DEFAULT, STRONGER and ALL). What is the different between them and the list of mutants listed in each operator?
Samah wa
  • 41
  • 5
1
vote
0 answers

Kotlin delegation, what should I test?

In Kotlin the powerful construct of delegation can be used to extend functionality of existing interfaces by reusing existing implementations. class Demo : Map by HashMap {} Questions: What should I be testing? Testing hashmap from the example is…
Michiel Leegwater
  • 1,172
  • 4
  • 11
  • 27
1
vote
1 answer

Is there a config to include source files in the debug info?

Currently trying to get Micronaut to work with Pitest and it is failing due to an NPE caused by the fact Micronaut does not include the source file in the debug info of the outputted class. I was wondering if there is a way to configure Micronaut…
1
vote
0 answers

Mutation Testing fails with Mull

In the README file of https://github.com/mull-project/mull, I was trying their mutatation testing examples on openssl and fmtlib. But, when I enter the mutation test command: mull-cxx -test-framework=GoogleTest -mutators=math_add_mutator…
Ankit Koirala
  • 354
  • 3
  • 13
1
vote
1 answer

PITEST incremental analysis cannot find local hash file

I'm currently trying PITest and so far it works properly. However, it is quite slow and the only solution so far is to use incremental analysis which potentially will solve the slowness. I've tried to set it as it's described in the documentation.…
Ducaz035
  • 3,054
  • 2
  • 25
  • 45
1
vote
1 answer

Pitest Report Failed to Generated In Intellij IDEA

I am using Pitest for mutation testing in IntelliJ IDEA (plugin: https://plugins.jetbrains.com/plugin/7119-pit-mutation-testing-idea-plugin). After running all test case, I got the following message at the end of execution: Exception in thread…
rilutham
  • 491
  • 5
  • 10
1
vote
1 answer

PHP Infection all mutants were not covered by tests

I'm trying to implement the infection/infection php mutation testing library into a new project of mine. I've set up some tests which all pass, then ran infection. Infection returns the following: You are running Infection with xdebug enabled. …
TBPixel
  • 31
  • 2