Testing permutations