Mini Case Study - Gnorion/BizVR GitHub Wiki
Mini Case Study
Specification
Suppose we are given these rules by the business:
- if color = 'red' and size = 'small' then price is 1
- if color = 'green' then price is 2
- if color = 'blue' and size = 'large' then price is 3
Decision
Decision Table
Analysis
Summary
Warnings
Attribute size is tested in a rule but is never set in a rule or declared as a decision input. How does it get its value?
Add size as a decision input
Missing Rules
"summary" : "There are 7 missing rules",
"gaps" : ["color is (=other)", "size is (=other)"],
"rule" : "if color='red' and size='large' then result not specified"
"rule" : "if color='red' and size=other then result not specified"
"rule" : "if color='blue' and size='small' then result not specified"
"rule" : "if color='blue' and size=other then result not specified"
"rule" : "if color=other and size='small' then result not specified"
"rule" : "if color=other and size='large' then result not specified"
"rule" : "if color=other and size=other then result not specified"
Update the Rules to Cover other
Analysis
Now there are only 2 missing rules "rule" : "if color='red' and size='large' then result not specified" "rule" : "if color='blue' and size='small' then result not specified"
Add Rules to Cover these
So now the table looks like this
Analysis
Now there are no missing rules
But what about rule conflicts? "summary" : "ACTION CONFLICT - between R2 DT1 and R7 DT1", "severity" : "warning", "explanation" : "price is set to 2 by R2 and 0 by R7 when color ='green' and size =other",
We can make rule 2 more specific since it really only applies to large and small things
Final Analysis
Now everything is good
Test Data
The validator also suggested the following 12 test cases that should be run to prove the rules produce the expected results