On Sat, 15 Dec 2001 13:38 +0000 (GMT Standard Time), brangdon / cix.co.uk (Dave Harris) wrote: >That the function's result should not depend on the order of its arguments >is, in my view, an important fact that should be made more explicit than >it currently is. We can deduce it from the function's implementation, or >from the function's name plus what we know about triangles, but I'm not >sure that is enough to satisfy the "Once" part of "Once and Only Once". > >I suspect we need some more support from the test rig; some mechanism >which will generate all permutations of a collection of arguments and >#perform them. There are 6 permutations, and we need to test at least the >3 normal cases, but I would tend to regard the whole thing as 1 test >rather than 18. Given the implementation, I'm not clear on why we would want to test other permutations (since the internal representation is a sorted collection). Are you suggesting additional tests as protection against someone reimplementing the function erroneously? Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com