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

  • 2
  • Question
  • Updated 4 years ago
  • Answered
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
Age = Young, Adult, Senior
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?

Thanks in advance,
Photo of Roberto

Roberto

  • 7 Posts
  • 0 Reply Likes
  • frustrated

Posted 9 years ago

  • 2
Photo of Justin Hunter, Hexawise Founder

Justin Hunter, Hexawise Founder, Founder and CEO

  • 246 Posts
  • 15 Reply Likes
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 -----

Let's also talk about a second possible "Advanced" 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).
Type "Adult" and hit Enter
Create two "sub Values" Adult Male and Adult Female
Add this first Value Expansion

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
Add this second Value Expansion

-----

Comments: There are advantages and disadvantages to consider.

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
Photo of Roberto

Roberto

  • 7 Posts
  • 0 Reply Likes
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!
Photo of John Hunter

John Hunter, Hexawise Senior Consultant

  • 39 Posts
  • 0 Reply Likes
Answered.
Photo of Justin Hunter, Hexawise Founder

Justin Hunter, Hexawise Founder, Founder and CEO

  • 246 Posts
  • 15 Reply Likes
In case anyone is looking for a way to handle a 3-way constraint in Hexawise or create an invalid triple in Hexawise, please see the above solution.