A method of testing the presence/absence of a specific substance in a food b y performing PCR with the use of primers which have been designed on the basis of data obtained from a part of a gene of the specific substance. This metho d is highly useful in detecting a trace component contained in a food or identifying a specific harmful allergen.