Skip to content

Instantly share code, notes, and snippets.

@minazou67
Last active January 27, 2022 05:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minazou67/7704c88300d49119a98d891253cd3317 to your computer and use it in GitHub Desktop.
Save minazou67/7704c88300d49119a98d891253cd3317 to your computer and use it in GitHub Desktop.
Code coverage note

Code coverage note

White box test で使用するコードカバレッジのメモです。
但し、判定条件/条件網羅や複合条件網羅、経路網羅などについては記載していません。

Metric

コードカバレッジには、代表的な3種類の測定基準があります。

Criteria Detail
C0 : 命令網羅(Statement coverage) すべての実行可能命令のうち、実行された命令の割合
C1 : 分岐網羅(Branch coverage) すべての判定条件のうち、実行された条件判定の割合
C2 : 条件網羅(Condition coverage) すべての条件判定の組み合わせのうち、実行された組み合わせの割合

JaCoCo

Java の代表的なカバレッジ計測ツールです。

Criteria Detail
Instructions(C0) Javaバイトコード命令の網羅率
Branches(C1) すべての条件判定の分岐網羅率
Cyclomatic Complexity 循環複雑度の組み合わせの網羅率
Lines クラスファイルの実際の行の網羅率
Methods コンストラクタや静的初期化子も含む非抽象メソッドの網羅率
Classes クラスの網羅率
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment