变异测试在实践中有用吗? [英] Is mutation testing useful in practice?
问题描述
您是否有任何实际的突变测试应用示例?它比简单的测试覆盖率工具更好吗?还是没用?
Do you have any examples of real life applications of mutation testing? Does it work better than simple test coverage tools? Or is it useless?
在现实世界中,突变测试的优点/缺点是什么?
What are the advantages/disadvantages of mutation testing in the real world?
推荐答案
不再讨论单元测试的有用性。它们对于质量应用程序的概念至关重要。但是,我们如何评估它们的相关性?
代码覆盖率指标高达100%并不意味着该代码已通过100%测试。这只是单元测试执行期间已执行代码的视图。
变异测试将使您对测试更有信心。
The usefulness of unit tests is no longer discussed. They are essential in conception of a quality application. But, how can we assess their relevance? A code coverage indicator up to 100% doesn’t mean the code is 100% tested. This is just a view of executed code during unit tests execution. Mutation testing will allow you to have more confidence in your tests.
这是一个两步过程:
- 生成突变体。
- 检查是否通过测试发现了突变。
我写了整个有关此过程的文章,包括一些具体案例。
I wrote a entire article about this process, including some concrete cases.
这篇关于变异测试在实践中有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!