Dna test?

Has anyone got a dna test with their baby and the father? I got one done and they swabbed his cheek the baby's and mine. Why would they need to swab mine ? Also are these tests accurate? It was at a dna office and pricey.