Some algorithms in testing