Learning vs Testing: Strategies That Bridge the Gap