我们如何使用Unity的代码覆盖率?

本文介绍了如何在Unity中使用代码覆盖率工具BullseyeCoverage,探讨了声明范围、决策范围、条件覆盖和功能覆盖等衡量标准,并阐述了如何通过覆盖率数据优化测试套件、识别缺失覆盖以及在转换测试时保持覆盖率。
摘要由CSDN通过智能技术生成

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

    良好的支持质量

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值