Learning to test