How do STD tests work?

Antibodies & antigen. Most STDs will check for antibodies against the pathogen or check for the antigen itself. Some use dna tests.