Algorithms for test