Here is the same specification we used to test the CalculatorExample in AllCombinations. Try it using AllPairs.
eg.AllPairs |
|
input/AllPairs/magnitude/*.html |
|
input/AllPairs/sign/*.html |
|
input/AllPairs/function/*.html |
|
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 |
Implementation
The algorithm is largely JamesBach's from the source cited on the AllPairsExample page. My implementation can be summarized as follows.
The case currently being filled is called the slug. A pair will fit the slug only if the following hold.
The fixture uses these helper objects to represent the state of the algorithm.
See the source.
See AllPairsAlgorithm for some tests we've written for this algorithm itself.
Last edited November 9, 2002