DNA tests from cheek swabs are effective despite the presence of bacteria in the mouth. The key to accurate results lies in the use of PCR (Polymerase Chain Reaction) with specific primers that target human DNA, effectively minimizing contamination from bacteria. These primers are designed to be human-specific, focusing on conserved loci in the human genome. Additionally, concerns about contamination from food are acknowledged, but the specificity of the primers helps ensure that only human DNA is amplified during testing.