gpt4 book ai didi

code-coverage - 验收测试和代码覆盖率

转载 作者:行者123 更新时间:2023-12-02 05:55:28 25 4
gpt4 key购买 nike

衡量验收测试覆盖率的最佳方法是什么?

你如何定义你的验收测试涵盖了多少以及何时足够?

最佳答案

在进行验收测试时,我更愿意查看功能覆盖率,即测试给定应用程序的多少功能(或用户故事或用例)。对我来说,对于每个功能(或用户故事或用例),都应该测试所有场景或可能的路径。换句话说,功能应该是编写测试计划的起点,目标应该是涵盖功能,而不是代码。这是一个细微的区别,但很重要:使用代码覆盖率测量验收测试是面向开发人员的,测量功能覆盖率是面向最终用户的。

关于度量,敏捷的创始人之一罗恩·杰弗里斯(Ron Jeffries)写了一篇精彩的总结,总结了他认为真正有值(value)的度量,RTF 或运行测试的特性。您可以查看文章here .我只是在下面引用一小部分:

What is the Point of the Project?

I'm just guessing, but I think the point of most software development projects is software that works, and that has the most features possible per dollar of investment. I call that notion Running Tested [Features], and in fact it can be measured, to a degree.

Imagine the following definition of RTF:

  1. The desired software is broken down into named features (requirements, stories) which are part of what it means to deliver the desired system.
  2. For each named feature, there are one or more automated acceptance tests which, when they work, will show that the feature in question is implemented.
  3. The RTF metric shows, at every moment in the project, how many features are passing all their acceptance tests.

How many customer-defined features are known, through independently-defined testing, to be working? Now there's a metric I could live with.



为了报告进度,我特别喜欢累积流程图。当出现问题时,它们清楚地显示,例如(这里是燃耗风格):

alt text
(来源: xprogramming.com)

对于现实生活中的示例,请查看 this postthis one (燃尽图)。

关于code-coverage - 验收测试和代码覆盖率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1574528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com