IntelliJ 中的代码覆盖率
Code coverage in IntelliJ
我看到 Intellij 中的内置代码覆盖率非常小(仅包括行覆盖率,不包括分支覆盖率)。
与 IntelliJ 一起使用的推荐代码覆盖库是什么?
(我曾经在 Eclipse 中使用 Jacoco)。
IntelliJ IDEA 代码覆盖率 运行ner 提供 branch 覆盖率。
Tracing mode enables accurate collection of the branch coverage, with the ability to track tests, view coverage statistic, and get additional information on each covered line.
(来自 the docs)
要进行此操作,请打开测试 Edit Run/Debug Configuration
对话框 运行 并单击 Code Coverage
选项卡。那么...
- 选择报道 运行 纳尔:
IntelliJ IDEA
- 单击
Tracing
(而不是默认值:Sampling
)
运行 您的测试,然后从 Coverage Window 单击进入 class,您将在侧边栏中看到分支信息。
截图如下:
我看到 Intellij 中的内置代码覆盖率非常小(仅包括行覆盖率,不包括分支覆盖率)。
与 IntelliJ 一起使用的推荐代码覆盖库是什么?
(我曾经在 Eclipse 中使用 Jacoco)。
IntelliJ IDEA 代码覆盖率 运行ner 提供 branch 覆盖率。
Tracing mode enables accurate collection of the branch coverage, with the ability to track tests, view coverage statistic, and get additional information on each covered line.
(来自 the docs)
要进行此操作,请打开测试 Edit Run/Debug Configuration
对话框 运行 并单击 Code Coverage
选项卡。那么...
- 选择报道 运行 纳尔:
IntelliJ IDEA
- 单击
Tracing
(而不是默认值:Sampling
)
运行 您的测试,然后从 Coverage Window 单击进入 class,您将在侧边栏中看到分支信息。
截图如下: