直接上图,最近发现eclipse一个比较方便的功能,叫 Coverage。可以直接查看代码块 和 决策分支 成功运行后的覆盖率情况。
Source lines containing executable code get the following color code:(可执行的源代码块附带的颜色是这么一回事 :)
- green for fully covered lines,(绿色是完全100%覆盖)
- yellow for partly covered lines (some instructions or branches missed) and(黄色是部分覆盖,有时是因为语句或分支丢失了)
- red for lines that have not been executed at all.(红色的代表没执行过)
In addition colored diamonds are shown at the left for lines containing decision branches. The colors for the diamonds have a similar semantic than the line highlighting colors:(行数左边那颗钻石的颜色表示为:)