Automatically detecting tests