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

Stryker/Angular6: Remove mutants from standard @Component on template application

I have created a basic template application with Angular 6 and I am trying to get Stryker Mutation testing working on it. On a basic home page: import { Component } from '@angular/core'; /** * Home Page Definition */ @Component({ selector:…
Steven Scott
  • 10,234
  • 9
  • 69
  • 117
1
vote
1 answer

PIT Mutation Testing maven plugin skip all private methods

I believe that not all private methods should be tested as independent parts of code. That is why I want to exclude them from pit-reports of PIT testing tool maven plugin. I tried to find a way of doing this, but failed. Some close configuration…
Vladyslav Nikolaiev
  • 1,819
  • 3
  • 20
  • 39
1
vote
0 answers

Mutation testing - Pittest error (No mutations found)

I am using https://github.com/hcoles/pitest to write mutation tests on our existing Unit Test suite. We are getting an error as below: 12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> FINE : Expecting 1 tests classes from parent 12:09:40 PM…
techjourneyman
  • 1,701
  • 3
  • 33
  • 53
1
vote
0 answers

Trying to add mutation testing

I'm trying to add mutation testing to a rails project, with gem 'mutant-rspec' in the Gemfile, which seems to install it correctly with bundler Resolving dependencies... ... Using mutant 0.8.12 Using actionpack 5.0.0.1 Using mutant-rspec…
ytg
  • 1,755
  • 2
  • 23
  • 41
1
vote
1 answer

Setting up PITest for Guava

I'm trying to set up PIT for Guava (http://pitest.org/) to do mutation adequecy testing, but I am getting the following error when trying to run it. This is the error that I get : 12:19:47 PM PIT >> INFO : Sending 32 test classes to minion 12:19:47…
John Kim
  • 1,081
  • 10
  • 26
1
vote
0 answers

Could not find or load main class org.pitest.coverage.execute.CoverageMinion

I tried all available answers but still getting this error while running pit mutation test. It runs fine on other system with same configuration, any help on this error will be appreciated. Thanks. Console log Connecting to:…
Bhushan
  • 11
  • 4
1
vote
1 answer

PITest: JavaLaunchHelper is implemented in both

Recently I started using PITest for Mutation Testing. Post building my project using maven when I run the command mvn org.pitest:pitest-maven:mutationCoverage I get this error bunch of times: -stderr : objc[2787]: Class JavaLaunchHelper is…
AB HAT
  • 77
  • 1
  • 8
1
vote
1 answer

µJava Is not killing Mutants?

i am using µJava for mutation testing of my java program. as i am learning mutation testing. i have 2 classes 1 : Parent public class Parent { public String temp; public int number; public Parent(String temp) { this.temp = temp; …
KrunalParmar
  • 1,062
  • 2
  • 18
  • 31
1
vote
0 answers

mutant doesn't find test examples

In a 'hexx-null' gem I have a file: # lib/hexx/null.rb module Hexx class Null # ... end end The RSpec specification file is: # spec/tests/null_spec.rb describe Hexx::Null do describe ".new" do # ... end # ... etc. end Then I…
Andrew Kozin
  • 1,012
  • 9
  • 17
1
vote
0 answers

mutant-rspec with Rails 4 and Rspec 3

Doesn't seem like it's running my specs (log statements in specs/model don't show in log). I have a fairly simple User model with standard describe blocks (describe User ...): $ RAILS_ENV=test bundle exec mutant -r ./config/environment --use rspec…
SteveD
  • 51
  • 4
1
vote
3 answers

What is the ruby test tool called that 'breaks' your code to see how tight your tests are?

A wee while ago I ended up on a page which hosted several ruby tools, which had 'crazy' names like 'mangler' or 'executor' or something. The tool's job was to modify you production code (at runtime) in order to prove that your tests were…
mcintyre321
  • 12,996
  • 8
  • 66
  • 103
0
votes
0 answers

Problem with pit mutation: "Replaced long addition with subtraction"

I'm newbie with mutation testing. I'm using Pit and in the following line of code there are 4 mutations of the same type: Replaced long addition with subtraction long newsize = position + START_OF_DATA + total; But I can't figured out why he gaves…
Ella
  • 21
  • 1
  • 4
0
votes
0 answers

Why Does Stryker Fail To Run For This TypeScript Express Project?

I have a public repo here that is a simple ExpressJS NodeJs project in TypeScript which uses Jest for unit tests. When I run npx stryker run --fileLogLevel trace --logLevel debug though I get this output and error: 16:23:03 (41154) INFO ConfigReader…
Jim
  • 3,821
  • 1
  • 28
  • 60
0
votes
0 answers

Facing (Kill ratio is NaN% (0 0)) Issue when running Mutation test pittest in Jenkins

Hi we recently migrated from java 11 to java 17 after migration, We are facing following Issue when running MutationTest in Jenkins Kill ratio is NaN% (0 0) when we run in…
0
votes
0 answers

Not able to cover mutation coverage for Remove Conditional Mutator

this.var = StringUtils.isEmpty(arr[1]) ? null : Double.parseDouble(arr[1]); The above line is being tested by 3 mutators Negated conditional -> killed removed conditional - replaced equality check with false -> killed removed conditional - replaced…