rewritten testAccuracy() with given score method

simpler/shorter version of testAccuracy()