Diagnostic method and detection method for vehicles