Mutation Testing

Run mutmut to measure test effectiveness by mutating code

LoopyLuci Updated 1 repo stars

File contents

Mutation Testing

Install

pip install mutmut

Run

mutmut run --paths-to-mutate src/
mutmut results

Interpreting Results

  • Killed: test caught the mutation (good)
  • Survived: test missed it (bad)
  • Timeout: mutation caused infinite loop

Aim For

  • 80% mutation score

  • Focus on survived mutants first
  • Add tests for untested branches

LoopyLuci/Skills/tree/main/skills/mutation-testing commit 53942c71b1

Frequently asked questions

npx skillmds@latest add loopyluci/mutation-testing