ruby-on-rails – rcov中“总覆盖率”和“代码覆盖率”之间的区别是什么?

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – rcov中“总覆盖率”和“代码覆盖率”之间的区别是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当rcov生成报告时,它会显示每个文件的“总覆盖率”和“代码覆盖率”.这两个指标有什么区别?

解决方法

http://www.rubydoc.info/github/relevance/rcov/master/Rcov/FileStatistics

total_coverage是:

Total coverage rate if comments are also considered “executable”,
given as a fraction

code_coverage是:

Code coverage rate: fraction of lines of code executed,relative to
the total amount of lines of code (loc).

除非项目的评论被认为是可执行的,否则最有价值的指标将是“代码覆盖率”.

猜你在找的Ruby相关文章