Code Coverage - CI/CD用語集の定義
code coverageとは、テストがコードのどれだけを実行するかを、line、branch、statement、functionごとに測定するものです。
code coverageとは、テストスイートによってコードのどれだけの割合が実行されたかを測定するもので、line、branch、statement、functionのカバレッジとして報告されます。高いカバレッジはコードがテストされていることを示しますが、テストが正しいことは示しません。
カバレッジの種類は異なります。branchカバレッジは各条件分岐の両側を実行する必要があるため、lineカバレッジより厳格です。カバレッジは指標であって、目標ではありません。
カバレッジの種類
lineカバレッジは実行された行を数え、statementはstatementを数え、branchは各条件分岐のパスを必要とし、functionは呼び出された関数を数えます。branchは一般的な指標の中で最も厳格です。
関連ガイド
Coverage Gate - CI/CD Glossary DefinitionCoverage Gate: A coverage gate is a CI rule that fails the build if code coverage falls below a set threshold…
Mutation Score - CI/CD Glossary DefinitionMutation Score: A mutation score is the percentage of injected code changes (mutants) that a test suite detec…
Test Pyramid - CI/CD Glossary DefinitionTest Pyramid: The test pyramid is a heuristic that recommends many fast unit tests at the base, fewer integra…