场景测试是一组连续的单元测试吗? [英] Are scenario tests groups of sequential unit tests?
问题描述
我读了维基百科上场景测试的文章,但我感到非常难过,说这是很短.我想知道:场景测试是一系列顺序单元测试吗?或者,也许,就像一个单一的多步骤单元测试?很多框架都支持场景测试,还是单元测试涵盖了它们?
I read the Wikipedia article on scenario testing, but I am sad to say it is very short. I am left wondering: are scenario tests a collection of sequential unit tests? Or, perhaps, like a single multi-step unit test? Do many frameworks support scenario tests, or are they covered by unit testing?
如果它们与自动化无关,它们是什么?
If they have nothing to do with automation, what are they?
推荐答案
我认为测试和场景测试的数量和分布之间没有任何固定的关系.
I don't think there's any fixed relationship between the number and distribution of tests and scenario tests.
我认为场景最常见的代码表示是支持特定故事(场景)所需的一组特定业务数据.这通常以数据库数据、假存根数据或两者的组合形式提供.
I think the most common code-representation of a scenario is a specific set of business data required to support a specific story (scenario). This is often provided in the form of database data, fake stub data or a combination of both.
这个想法是,该数据集具有已知且定义明确的特征,可以在给定的业务流程中提供定义明确的结果.
The idea is that this dataset has known and well-defined characteristics that will provide well defined results all across a given business process.
对于 Web 应用程序,我可以有一个 Web 测试(或多个用于变体),点击整个场景.在其他情况下,场景在较低级别使用,可能在功能测试或单元测试中测试场景的一部分.在这种情况下,我通常从不按场景对测试进行分组,而是选择我通常用于单元/功能测试的测试的功能分组.Subsystem1Test"中经常有一个方法叫做testScenario1"或者testScenarioInsufficientCredit".我更喜欢给我的场景命名.
For a web application I could have a single web-test (or several for variations) that click through the full scenario. In other cases the scenario is used at a lower level, possibly testing a part of the scenario in a functional test or a unit test. In this case I normally never group the tests by scenario, but choose the functional grouping of tests I normally use for unit/functional tests. Quite often there's a method within "Subsystem1Test" that is called "testScenario1" or maybe "testScenarioInsufficientCredit". I prefer to give my scenarios names.
这篇关于场景测试是一组连续的单元测试吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!