79 lines
3.8 KiB
Plaintext
79 lines
3.8 KiB
Plaintext
|
!2 The aim of the baseline decision table is to make tests easier to read.
|
||
|
|
||
|
!3 Background
|
||
|
The idea of a [[decision table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]] is to demonstrate how different combinations of input parameters generate different results.
|
||
|
To make the impact of each parameter to the output results transparent it is good practice to modify just one parameter from row to row.
|
||
|
For big tables with many input parameters it is often not immediately visible to the reader which parameter changes from row to row.
|
||
|
|
||
|
!3 Syntax
|
||
|
As a user of the '''baseline decision table''' you specify in the first row below the header in each column the values for all input and output parameters.
|
||
|
This defines your ''base scenario'' and so far this is 100% identical to a normal decision table.
|
||
|
In all following lines you just specify the values which differ from the ''base scenario'' all other columns are left empty.
|
||
|
|
||
|
This makes your table more readable. It is also easier to maintain in case a value must be changed.
|
||
|
Don't repeat yourself is a good rule even when you write test cases. :)
|
||
|
|
||
|
!3 Fixture Code
|
||
|
When the baseline decision table is tested all empty columns are filled by the Slim test system with the corresponding values from the ''base scenario''.
|
||
|
In all other aspects the bahviour is identical to the decision table.
|
||
|
Your fixture code is identical to a [[decision table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]]. The fixture will not be able to identif any difference between a baseline decision table and a normal [[decision table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]].
|
||
|
|
||
|
!3 Example
|
||
|
Let's look at an example which you know already from the [[Decision Table][.FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable]]
|
||
|
|
||
|
!*> Dependencies
|
||
|
|
||
|
|import |
|
||
|
|fitnesse.slim.test|
|
||
|
|
||
|
*!
|
||
|
|
||
|
Given I have at least one milk remaining
|
||
|
Then I should NOT go to the store
|
||
|
|
||
|
|baseline: should I buy milk |
|
||
|
|cash in wallet|credit card|pints of milk remaining|go to store?|
|
||
|
|0 |no |1 |no |
|
||
|
| | |2 | |
|
||
|
| | |7 | |
|
||
|
|10 | | | |
|
||
|
| |yes | | |
|
||
|
|10 |yes | | |
|
||
|
|1 | |1 | |
|
||
|
|
||
|
|
||
|
Given I have no milk remaining
|
||
|
And a credit card
|
||
|
Then I should go to the store
|
||
|
|
||
|
|baseline: should I buy milk |
|
||
|
|cash in wallet|credit card|pints of milk remaining|go to store?|
|
||
|
|0 |yes |0 |yes |
|
||
|
|1 | | | |
|
||
|
|2 | | | |
|
||
|
|
||
|
|
||
|
Given I have no milk remaining
|
||
|
And at least three $
|
||
|
Then I should go to the store
|
||
|
|
||
|
|baseline: should I buy milk |
|
||
|
|cash in wallet|credit card|pints of milk remaining|go to store?|
|
||
|
|3 |no |0 |yes |
|
||
|
|10 | | | |
|
||
|
|7 | | | |
|
||
|
| |yes | | |
|
||
|
|
||
|
Given I have no milk remaining
|
||
|
And no credit card
|
||
|
And less then three $
|
||
|
Then I should NOT go to the store
|
||
|
|
||
|
|baseline: should I buy milk |
|
||
|
|cash in wallet|credit card|pints of milk remaining|go to store?|
|
||
|
|0 |no |0 |no |
|
||
|
|1 | | | |
|
||
|
|2 | | | |
|
||
|
|
||
|
|
||
|
!contents -R2 -g -p -f -h
|