Repaso
Español
TestingAdvancedTST-12

Mutation testing measures…

Options

  1. The execution speed of the code under test
  2. Test quality: it plants bugs and expects failures (Correct option)
  3. The memory usage of the code during a run
  4. How often the code changes in the repository

Answer

How good your tests are: it injects small bugs (mutants) into the code and checks whether tests fail

Why

The tool makes small changes to your code, for example > into >= or + into -, and runs your tests for each change.

If the tests still pass with the bug in place, that mutant 'survived', meaning your tests do not really check that behavior.

It is slow, so it is typically run on important modules. Tools: mutmut (Python), Stryker (JS).

Remember

Mutation testing = do my tests catch deliberately planted bugs?

Key terms

Practice this question in Repaso