tags:

views:

272

answers:

3

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?

+1  A: 

IMHO, scenario testing is a testing activity, as opposed to development activity ; hence it's about testing a product, not unit(s) of that product. The test scenario are end-to-end scenarios, using the natural interfaces of the product. If the product has programmatic interfaces, then you could use an unit test framework, or Fitnesse.

philippe
I agree that it should be automated (although it can be manual), but rather it shouldn't be unit test. More like some tool that will interact via gui, like QuickTestPro, or others. On the other, if you really want hand you can do it via unit test, by using proper tools (like mentioned test complete, or what I used WatiN). But then is it still Unit Test? Or just scripted test, that happens to produce output to your unit test tool?
yoosiba
+4  A: 

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.

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.

krosenvold
+2  A: 

In addition to korsenvoid's response, in my experience scenario based testing will often be automated as it will be included in regression testing. Regression testing is regularly automated as to do it manually does not scale well with regular releases.

In commercial software, good examples of scenerio tests are tutorials included with the user documentation. These obviously must work in each release or be removed from the docs, and hence must be tested.

While you can carry out scenario testing using sequenced unit tests, my guess is that it is more common to use GUI based automation tools. For example, I use TestComplete in this role with a scripting framework to good effect. Scenario tests are typically carried out from a user/client perspective which can be difficult to accurately replicate at a unit level.

Shane MacLaughlin