Skip to content

MTMatrix

DurieuxPol edited this page Jan 29, 2024 · 5 revisions

A MTMatrix represents the results of some mutations against some tests. A blue box means the test fails for the mutation.
image

How to use

There are 4 ways to create a MTMatrix depending on the situation:

  • using a class:
    • matrix := MTMatrix forAClass: MTAuxiliarClassForMatrix
  • using collections of classes and tests:
    • matrix := MTMatrix forClasses: { UUID } andTests: { UUIDTest. UUIDPrimitivesTest }
  • using a package (when the test package simply has the suffixe "-Tests":
    • matrix := MTMatrix forAPackage: 'Athens-Core'
  • using a package and a test package:
    • matrix := MTMatrix forAPackage: 'Network-UUID' andTestPackage: 'Network-Tests'

Features

Now that you have your matrix, you can get several information about the mutations of your subject with it.
But before that you need to build it with:

  • matrix build

These are the information you can get:

Trivial mutants

Mutants killed by every tests:

  • matrix trivialMutants inspect

Equivalent mutants

Mutants that are killed by the exact same tests.
equivalentMutants returns all sets of mutants mutually equivalent:

  • matrix equivalentMutants inspect

Included mutants

For a given mutant, all mutants that are killed by the same tests as the given mutant or part of those tests, and no others.
includedMutants returns a dictionary of all mutants and their included mutants:

  • matrix includedMutants inspect

Visualisation

A matrix of mutants and tests like the one above:

  • matrix generateMatrix