Here is the same specification we used to test the CalculatorExample in AllCombinations. Try it using AllPairs.

eg.AllPairs | |

Documents/AllPairs/magnitude/*.html | |

Documents/AllPairs/sign/*.html | |

Documents/AllPairs/function/*.html | |

#1 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [1] |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#2 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#3 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

no-change.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#4 | |

30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [2] |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#5 | |

30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#6 | |

30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

no-change.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#7 | |

360+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [3] |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#8 | |

360+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#9 | |

360+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

no-change.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#10 | |

90-30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [4] |

cosine.html | 0 right, 1 wrong, 0 ignored, 0 exceptions [5] |

#11 | |

90-30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 0 right, 1 wrong, 0 ignored, 0 exceptions [6] |

#12 | |

90-30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

no-change.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

cosine.html | 0 right, 1 wrong, 0 ignored, 0 exceptions [7] |

#13 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [8] |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#14 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

change-sign.html | 0 right, 0 wrong, 0 ignored, 1 exceptions [9] |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#15 | |

180+30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

cosine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

#16 | |

30.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

multiply.html | 0 right, 0 wrong, 0 ignored, 0 exceptions |

sine.html | 1 right, 0 wrong, 0 ignored, 0 exceptions |

To meet the "all pairs" requirement we need at least n X m cases, where n and m are the sizes of the two largest categories. That means with only two categories all combinations and all pairs are the same. The marvel of the all pairs algorithm is that it squeezes draws from additional categories into these same cases and possibly a few more.

fit.Summary | |

counts | 39 right, 9 wrong, 0 ignored, 0 exceptions |

counts run | 29 right, 3 wrong, 0 ignored, 6 exceptions |

input file | /Users/ward/Documents/Java/fit/Release/Documents/AllPairs.html |

input update | Mon Sep 15 16:47:23 PDT 2003 |

output file | /Users/ward/Documents/Java/fit/Release/Reports/AllPairs.html |

run date | Mon Sep 15 16:51:16 PDT 2003 |

run elapsed time | 0:00.58 |

**Implementation**

The algorithm is largely JamesBach's from the source cited on the AllPairsExample page. My implementation can be summarized as follows.

- Fill test cases with tests drawn from a list of
*most wanted*pairs. - Fill one case at a time. Never reexamine a case once filled.
- Recirculate used pairs back to the list but as
*less wanted*. - Quit filling cases when all pairs have been used at least once.

- At least one item of a pair is of a category that is not already filled.
- The other item must match the slug in its category or must also be unfilled.

- Item -- A value from within a category.
- Pair -- Two Items drawn from different categories.
- Var -- A category, one per list of files.

Last edited November 9, 2002