baseline decision table

source | test results

ns
itl.example.milk
(usens:)

This table makes tests a bit easier to read and write, especially when testing a lot of permutations of something. You basically set up a base case in the first row, and that case is then the "default" for future rows that have missing values.

Here's an example, based on the same example function as the decision table:

Given I have at least one milk remaining
Then I should NOT go to the store

cash in walletcredit cardunits remaininggo to store?
0no1no
0no2no
0no7no
10no1no
0yes1no
10yes1no
1no1no
(bdt:buy-milk? parallel=true)

Given I have no milk remaining
And a credit card
Then I should go to the store

cash in walletcredit cardunits remaininggo to store?
0yes0yes
1yes0yes
2yes0yes
(bdt:buy-milk? parallel=true)

Given I have no milk remaining
And at least three $
Then I should go to the store

cash in walletcredit cardunits remaininggo to store?
3no0yes
10no0yes
7no0yes
3yes0yes
(bdt:buy-milk? parallel=true)

Given I have no milk remaining
And no credit card
And less then three $
Then I should NOT go to the store

cash in walletcredit cardunits remaininggo to store?
0no0no
1no0no
2no0no
(bdt:buy-milk? parallel=true)