How are pesticide residue limits set?

How are pesticide residue limits set?