[rspec-devel] Stories and test data

Alvin Schur a.schur at nucleus.com
Tue Nov 13 18:32:23 EST 2007


I am working with oil and gas data supplied by a third-party.

Users want to find wells by:
  a) Status: producing or suspended or abandoned or show
  b) Product: oil or gas or bitumen or water


To perform the search we must look at two fields: plot symbol and 
current status.

Each well can have 1 out of 43 plot symbols (abandoned, injection, gas, 
gas potential, etc)

Each well can have a 1 out of 1037 current statuses (abandoned acid gas, 
suspended acid gas disposal, etc)


How much detail should the Stories and Scenarios provide about the test 
data?

Part of my concern is that explicitly listing wells in the Scenario,  a 
Scenario can pass but the search is wrong by matching more wells than 
are listed as the setup data.

Things get more interesting when we test each combination.

Are there any guidelines for handling combinatorial explosions in Stories?

Some samples are:

  Scenario: search for producing wells (expects well data to already exist)
    Given a licensed user is logged in
    And the user is searching for wells
    And the current well search has a status qualifier
    When the user selects producing wells
    And updates the search count
    Then there should be 15 wells
    And have plot symbols: OIL, GAS, OIL_GAS, WATER, or SAGD
    And have statuses: Flowing CBM & Othr, Flowing CBM Coal, Pumping CBM 
Coal
    And nothing else


  Scenario: search for producing wells
    Given a licensed user is logged in
    And the user is searching for wells
    And the current well search has a status qualifier
    And a well with plot symbol: OIL exists
    And a well with plot symbol: GAS exists
    And a well with plot symbol: OIL_GAS exists
    And a well with plot symbol: WATER exists
    And a well with plot symbol: SAGD exists
    And a well with plot symbol: EXCLUDED exists
    And a well with current status: Flowing CBM & Othr exists
    And a well with current status: Flowing CBM Coal exists
    And a well with current status: Pumping CBM Coal exists
    And a well with current status: EXCLUDED exists
    When the user selects producing wells
    And updates the search count
    Then there should be 8 wells
    And have plot symbols: OIL, GAS
    And have statuses: Flowing CBM & Othr


  Scenario: search for producing wells
    Given a licensed user is logged in
    And the user is searching for wells
    And the current well search has a status qualifier
    And there are wells for each plot symbol and current status 
combination <-- (takes a long time to set up)
    When the user selects producing wells
    And updates the search count
    Then there should be xxx wells
    And have plot symbols: OIL, GAS, OIL_GAS, WATER, or SAGD
    And or have statuses: Flowing CBM & Othr, Flowing CBM Coal, Pumping 
CBM Coal
    And nothing else

Thanks,

Alvin.



More information about the rspec-devel mailing list