Checking the Quality of Business Rules - Gnorion/BizVR GitHub Wiki
There are many good decision modeling products available today. Most of them are based on decision tables.
Decision tables can be constructed in Excel, DMN tools and numerous proprietary products but they all follow a very similar format
Decision tables provide a convenient way for people to define the logic of their business policies in a way that doesn't require them to be professional programmers and that is also easy to communicate to other people. Showing the CEO your business rules in java simply does not work! But everyone is familiar with an excel spreadsheet.
So given that creating decision tables to represent business rules is much easier today there still remains the issue of checking those rules to make sure they are correct.
There are two tests we must perform:
- Are they the right rules? That is, are they correct representations of what our business policies are?
- Are they quality rules? That is are they free from various kinds of logical error.
Example suppose our business policy manual says:
- R1: if you are over 3 feet tall you can ride Space Mountain
- R2: If you are under 3 you cannot ride Space Mountain
There are many problems with these rules
First, in category 1, are the numbers the right ones? do they both mean height? or is the second rule about age? Do they both apply to Space Mountain (or did we just forget to edit after a copy/paste operation)?
Second, in category 2 if we assume they both apply to height, what rule applies to people exactly 3 feet tall? And if the second rule applies to age then what do we do about a 2 year old that is over 3 feet?
Problems in category 1 must be resolved by testing. That is designing a set of inputs and the expected result, then running the rules to prove that the desired outcome occurs. This requires the involvement of someone who knows the business rules.
Problems in category 2 can be identified with automated tools since they represent logical errors in the rules as opposed to errors of fact.
- R1: if you are over X feet tall you can ride ZZZ
- R2: If you are under X you cannot ride ZZZ
These rules are poor no matter what values you have for X and ZZZ. They are incomplete and inconsistent.
Checking the Business Rules for Errors
- Every distinct business case should lead to only one possible result or behavior. (consistency)
- Every possible business case should lead to some result or behavior. (completeness)
- Every rule, applied on any business case, has a significant contribution to the result or behavior. (redundancy)
Inconsistency is a condition in a set of business rules that occurs when two or more rules lead to a conflicting result or behavior.
Incompleteness is a condition in a set of business rules that occurs when there exists a business case that leads to undefined results or behavior.
Redundancy is a condition in a set of business rules that occurs when there exists a business rule that has no significant contribution to the possible results or behavior or simply duplicates another rule.