Previously we have written about our Runtime Tests, Performance Tests and Unity Test Tools. In this blog post I will tell you about how we use code coverage.
以前,我们已经编写了有关运行时测试 , 性能测试和Unity测试工具的文章 。 在这篇博客中,我将向您介绍我们如何使用代码覆盖率。
First and foremost code coverage is an ambitious thing and it should be used with caution. It would be an error to state that it measures quality of the test suites. You can easily write a test suite that doesn’t contain a single assertion, but produces 100% coverage. Code coverage gives us insight into the thoroughness of our test suites. In conjunction with other metrics this is extremely useful and valuable information.
首先也是最重要的一点是代码覆盖率很高,应该谨慎使用。 声明它衡量测试套件的质量将是一个错误。 您可以轻松地编写一个不包含单个断言而是产生100%覆盖率的测试套件。 代码覆盖率使我们能够深入了解测试套件的完整性。 结合其他指标,这是非常有用和有价值的信息。
Our first goal has been to see how much C++ code is exercised by our current test suites. We evaluated a lot of different C++ code coverage tools and eventually chose BullseyeCoverage. Reasons:
我们的第一个目标是查看当前测试套件可以执行多少C ++代码。 我们评估了许多不同的C ++代码覆盖率工具,最终选择了BullseyeCoverage。 原因:
We love what it measures (see below).
我们喜欢它可以测量的东西(见下文)。
Easy to integrate into our build system
易于集成到我们的构建系统中
Wide platform support
广泛的平台支持
Licensing and pricing model that fits our needs
符合我们需求的许可和定价模型
Good support quality
良好的支持质量