Automagic testing using guard