# Any workaround to create an invalid "pair" of 3 values?

• Question
• Updated 4 years ago
Is there any workaround or suggestion to create a restriction (invalid pair) for a combination of values of 3 parameters?

For instance, imagine I'm trying to calculate a car insurance rate that depends on 4 parameters:
State = Low Risk State, Medium Risk State, High Risk State
Sex = Female, Male
Insurance Policy = 3rd Party, 3rd Party Extended, All Risk.

Imagine my Insurance Company does not allow a young male to take an All Risks Policy. How could I reflect this restriction without a big increase in the size of my parameters?

• 7 Posts
• frustrated

Posted 9 years ago

Justin Hunter, Hexawise Founder, Founder and CEO

• 246 Posts
Roberto,

Good question. Thank you for providing specifics. It makes it much easier to provide an answer.

----- FIRST POSSIBLE SOLUTION -----

When you select Parameters and Values, it is almost always a good idea to separate Age and Gender (as you have done here). It is almost always a bad idea to combine Age and Gender into one set of Parameter Values. When you want to create a constraint that involves 3 Values, it might well be time to throw out the rule book. Here's one solution that could work for you:

State = ((No change to your selection of Values))
Age and Gender = Young Female, Young Male, Adult Female, Adult Male, Senior Female, Senior Male
Insurance Policy = ((No change to your selection of Values))

Then you would create an Invalid Pair between Age and Gender = Young Male and Insurance Policy = All Risks.

The solution just described would accomplish your goals without increasing the number of Hexawise-generated tests much.

----- SECOND POSSIBLE SOLUTION -----

First, modify the Parameter and Value settings:

State = ((No change to your selection of Values))
Age and Gender = Young Female, Young Male, Adult ((not specifying a gender in the Value name)), Senior ((not specifying a gender in the Value name))
Insurance Policy = ((No change to your selection of Values))

Second, create an Invalid Pair between Young Male and Insurance Policy = "All Risks"

Third, create a Value Expansion for Adult

Click on "Add a Value Expansion" (on far left / side bar).

Fourth, create a Value Expansion for Senior

Click on "Add a Value Expansion"
Type "Senior" and hit Enter
Create two "sub Values" Senior Male and Senior Female

-----

The first solution may well have more total test cases. If that is acceptable to you (or if the solution does not in fact have more total test cases), use the first solution.

The second solution (which uses the Value Expansion feature) may have fewer total test cases. The potential problem though - depending on your coverage goals - is that the pairing up between Values in the Hexawise algorithm takes place at the Value level (not at the sub Value level). What this means is that in the Value "Adult" will be paired up with every other Value in your plan. The sub Value of Adult Male would probably not be paired up with every other Value in your Plan.

-----

I hope this helps. Again, very good question. I'm teaching a course today in Florida to a group of Hexawise users. I'll give your question to the attendees for them to try to figure out.

- Justin
• 7 Posts
Since my real case has more than 3 parameters i think i'll work better the 2nd solution to avoid increasing the number of test cases.

Many thanks!

John Hunter, Hexawise Senior Consultant

• 39 Posts