MATLAB Answers

How does pairwise parameterization work in the unit test framework?

11 views (last 30 days)
Brett Pantalone
Brett Pantalone on 3 Aug 2019
Edited: Greg on 28 Apr 2020
I have studied the example script in the documentation, but I can't see how the test parameters are being chosen in "pairwise" fashion. Why is the number of combinations 10 in this example? What is the algorithm to generate pairwise parameters?

  3 Comments

Brett Pantalone
Brett Pantalone on 9 Aug 2019
https://www.mathworks.com/help/matlab/matlab_prog/create-advanced-parameterized-test.html#d117e84603
Greg
Greg on 28 Apr 2020
8 months later and nothing on this? The documentation is extremely minimal on this, which is surprising and disappointing considering how thorough MATLAB documentation typically is. I would ask the additional question of what "pairwise" even means given the example has 3 input parameters - a group of 3 is not called a pair.

Sign in to comment.

Accepted Answer

Greg
Greg on 28 Apr 2020
Edited: Greg on 28 Apr 2020
According to an answer on stack exchange, the minimum number of pairwise combinations is 9. The concept of pairwise combination takes any 2 parameters at a time, and doesn't care about the rest. The trivial solution to the example is:
  1. dim1.small x dim2.small x dim3.small
  2. dim1.small x dim2.medium x dim3.medium
  3. dim1.small x dim2.large x dim3.large
  4. dim1.medium x dim2.small x dim3.medium
  5. dim1.medium x dim2.medium x dim3.large
  6. dim1.medium x dim2.large x dim3.small
  7. dim1.large x dim2.small x dim3.large
  8. dim1.large x dim2.medium x dim3.small
  9. dim1.large x dim2.large x dim3.medium
We have every possible value pair you could draw from any pair of parameters, but we do not have every unique triplet (that would be the "exhaustive" approach, and result in 3x3x3 = 27 combinations).
I still have no idea where 10 comes from in the documentation example.

  0 Comments

Sign in to comment.

More Answers (0)