ミューテーションスコア (Mutation Score) - CI/CD用語集の定義
ミューテーションスコアは、kill された mutant と mutant 総数の比率であり、テストスイートの強さの尺度です。
ミューテーションスコア (Mutation Score) は、すべての実行可能な mutant のうち、テストスイートが検出した (kill した) mutant の割合です。スコアが高いほど、テストは regressions を捉える点でより効果的です。
生き残る (捕捉されない) mutant は、テストが実行するものの本当には検証していないコード経路を指し示します。観測可能な振る舞いを変えられない等価な mutant は、可能な限り計算から除外されます。
数値の読み方
ラインカバレッジ 90% でもミューテーションスコアが 40% のプロジェクトは、コードを実行するものの、それについてほとんど assert しないテストを持っています。
関連ガイド
Mutation Testing - CI/CD Glossary DefinitionMutation Testing: Mutation testing deliberately introduces small faults (mutants) into the code, then checks…
Test Coverage - CI/CD Glossary DefinitionTest Coverage: Test coverage is the percentage of your code (lines, branches, or functions) that is executed…
Assertion - CI/CD Glossary DefinitionAssertion: An assertion is a statement in a test that checks whether a value or condition matches what is exp…