What’s the science behind this type of test?

In a patient with a COVID-19 infection, genetic material from SARS-CoV-2, the virus that causes COVID-19, is generally detectable in upper and lower respiratory specimens. Molecular tests are routinely used to detect the presence of viral genetic material in a sample. The specific technique that’s used is called reverse transcription polymerase chain reaction, or RT-PCR, where genetic material from a sample is copied and then compared to the genetic sequence of the virus you’re trying to detect.