According to a famous chinese legend, Shen-Nong, the god of husbandry, tasted thousands of herbs, poisoning himself 70 times a day, so taht people would know the sweet from the bitter.  In fact, this was probably what people did over centuries.  AS they looked for food, they tasted all kinds of plants and animal substances, observing their helpful or harmful effects.  Medicines were discovered by trial and error- sometimes fatal error.